update pulse installer
This commit is contained in:
@@ -53,6 +53,45 @@ assert_equal '{"type":"pve","enableCommands":false}' \
|
||||
"$(TAPM_PULSE_AGENT_TOKEN_REQUEST_JSON)" \
|
||||
"Proxmox-specific agent enrollment requested with commands disabled"
|
||||
|
||||
setup_token='0123456789abcdef0123456789abcdef'
|
||||
setup_host='https://pve1.example.test:8006'
|
||||
setup_old_url='https://pulse.example.test/api/setup-script?backup_perms=true'
|
||||
setup_response="$(
|
||||
SETUP_TOKEN="$setup_token" SETUP_HOST="$setup_host" SETUP_OLD_URL="$setup_old_url" \
|
||||
python3 -c '
|
||||
import json, os, sys, time
|
||||
old_url = os.environ["SETUP_OLD_URL"]
|
||||
token = os.environ["SETUP_TOKEN"]
|
||||
json.dump({
|
||||
"type": "pve",
|
||||
"host": os.environ["SETUP_HOST"],
|
||||
"url": old_url,
|
||||
"downloadURL": old_url + "&setup_token=" + token,
|
||||
"scriptFileName": "pulse-setup-pve.sh",
|
||||
"command": old_url + " PULSE_SETUP_TOKEN=" + token + " if",
|
||||
"commandWithEnv": old_url + " PULSE_SETUP_TOKEN=" + token + " if",
|
||||
"commandWithoutEnv": old_url + " if",
|
||||
"expires": int(time.time()) + 300,
|
||||
"setupToken": token,
|
||||
"tokenHint": token[:3] + "..." + token[-3:],
|
||||
}, sys.stdout)
|
||||
'
|
||||
)"
|
||||
normalized_setup="$(
|
||||
TAPM_PULSE_NORMALIZE_V611_SETUP_ARTIFACT \
|
||||
"$setup_response" 'http://10.10.2.30:7655'
|
||||
)"
|
||||
assert_equal "$setup_token" \
|
||||
"$(SETUP_RESPONSE="$normalized_setup" python3 -c 'import json, os; print(json.loads(os.environ["SETUP_RESPONSE"])["setupToken"])')" \
|
||||
"Pulse v6.1.1 compatibility preserves server-issued setup token"
|
||||
assert_equal \
|
||||
'http://10.10.2.30:7655/api/setup-script?host=https%3A%2F%2Fpve1.example.test%3A8006&pulse_url=http%3A%2F%2F10.10.2.30%3A7655&type=pve' \
|
||||
"$(SETUP_RESPONSE="$normalized_setup" python3 -c 'import json, os; print(json.loads(os.environ["SETUP_RESPONSE"])["url"])')" \
|
||||
"Pulse v6.1.1 compatibility normalizes setup artifact URL"
|
||||
assert_failure "Pulse v6.1.1 compatibility rejects missing setup token" \
|
||||
TAPM_PULSE_NORMALIZE_V611_SETUP_ARTIFACT \
|
||||
'{"type":"pve","host":"https://pve1:8006"}' 'http://10.10.2.30:7655'
|
||||
|
||||
nodes_json='[
|
||||
{"node":"pve3","status":"offline"},
|
||||
{"node":"pve2","status":"online"},
|
||||
|
||||
Reference in New Issue
Block a user