update
This commit is contained in:
+58
-2
@@ -48,6 +48,7 @@ assert payload["clustered"] is True
|
||||
'
|
||||
|
||||
printf '0\n' >"${test_dir}/curl-count"
|
||||
curl_should_fail=0
|
||||
curl() {
|
||||
local count data_path='' previous='' argument=''
|
||||
count="$(cat "${test_dir}/curl-count")"
|
||||
@@ -59,11 +60,11 @@ curl() {
|
||||
fi
|
||||
previous="$argument"
|
||||
done
|
||||
if [[ -n "$data_path" ]]; then
|
||||
if [[ -n "$data_path" && "$data_path" != '-' ]]; then
|
||||
cp "$data_path" "${test_dir}/curl-body-${count}.json"
|
||||
fi
|
||||
cat >"${test_dir}/curl-config-${count}"
|
||||
return 0
|
||||
(( curl_should_fail == 0 ))
|
||||
}
|
||||
|
||||
TAPM_FLEET_REGISTERED=1
|
||||
@@ -89,4 +90,59 @@ if compgen -G "${TMPDIR:-/tmp}/tapm-fleet-event.*" >/dev/null; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf '0\n' >"${test_dir}/curl-count"
|
||||
TAPM_FLEET_ENROLLED=0
|
||||
TAPM_FLEET_REGISTERED=0
|
||||
TAPM_FLEET_LAST_VERSION=''
|
||||
TAPM_FLEET_COLLECT_METADATA() {
|
||||
TAPM_FLEET_HOSTNAME='pve01'
|
||||
TAPM_FLEET_GIT_COMMIT='0123456789abcdef0123456789abcdef01234567'
|
||||
TAPM_FLEET_PVE_VERSION='pve-manager/9.2.4'
|
||||
TAPM_FLEET_OS_VERSION='Debian GNU/Linux 13 (trixie)'
|
||||
TAPM_FLEET_KERNEL_VERSION='6.14.11-5-pve'
|
||||
TAPM_FLEET_ARCHITECTURE='amd64'
|
||||
TAPM_FLEET_CLUSTERED=true
|
||||
}
|
||||
|
||||
TAPM_FLEET_START '2026.7.28-9'
|
||||
TAPM_FLEET_FINISH 0
|
||||
if [[ "$(cat "${test_dir}/curl-count")" != 2 ]]; then
|
||||
printf 'FAIL: initial run did not make exactly registration + completion calls\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
TAPM_FLEET_LOAD_IDENTITY
|
||||
if [[ "$TAPM_FLEET_ENROLLED" != 1 ||
|
||||
"$TAPM_FLEET_LAST_VERSION" != '2026.7.28-9' ]]; then
|
||||
printf 'FAIL: successful fleet enrollment was not persisted\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TAPM_FLEET_REGISTERED=0
|
||||
TAPM_FLEET_START '2026.7.28-9'
|
||||
TAPM_FLEET_FINISH 0
|
||||
if [[ "$(cat "${test_dir}/curl-count")" != 3 ]]; then
|
||||
printf 'FAIL: normal run made more than one broker call\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl_should_fail=1
|
||||
TAPM_FLEET_REGISTERED=0
|
||||
TAPM_FLEET_START '2026.7.28-9'
|
||||
TAPM_FLEET_FINISH 0
|
||||
TAPM_FLEET_LOAD_IDENTITY
|
||||
if [[ "$TAPM_FLEET_ENROLLED" != 0 ]]; then
|
||||
printf 'FAIL: failed fleet event did not schedule next-run re-enrollment\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl_should_fail=0
|
||||
TAPM_FLEET_REGISTERED=0
|
||||
TAPM_FLEET_START '2026.7.28-9'
|
||||
TAPM_FLEET_FINISH 0
|
||||
TAPM_FLEET_LOAD_IDENTITY
|
||||
if [[ "$TAPM_FLEET_ENROLLED" != 1 ]]; then
|
||||
printf 'FAIL: fleet client did not recover enrollment after a failed event\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf 'PASS: fleet identity and event client\n'
|
||||
|
||||
Reference in New Issue
Block a user