mirror of
https://github.com/clearlinux/micro-config-drive.git
synced 2026-08-20 12:35:52 +00:00
f9541b63ad
...so we can see more clearly in the test logs what's different.
24 lines
543 B
Bash
Executable File
24 lines
543 B
Bash
Executable File
#!/bin/bash -x
|
|
|
|
set -euo pipefail
|
|
SCRIPT_PATH="$(dirname "$(readlink -f "${BASH_SOURCE}")")"
|
|
|
|
# Launch a lightweight HTTP server and attempt to fetch cloud config from it
|
|
# Uses the "test" template in ucd-fetch-data
|
|
|
|
cd "${SCRIPT_PATH}/fetch_data"
|
|
python -m http.server 8123 --bind 127.0.0.254 &
|
|
HTTP_PID=$!
|
|
trap "sleep 1; kill ${HTTP_PID}" EXIT
|
|
cd "${SCRIPT_PATH}"
|
|
|
|
sleep 2
|
|
|
|
../ucd-data-fetch test
|
|
|
|
# Compare what we got/generated with what we expect
|
|
diff -y fetch_data/expected test-user-data
|
|
|
|
# Cleanup the test data file
|
|
rm test-user-data
|