mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-03 12:47:49 +00:00
Correct private-bootstrap renderer and URL assertions
Require the exact shared artifact command, stdin PVE authorization and correctly delimited normalized URL instead of legacy pipe/header forms or an over-broad path substring. These corrections retain installer, ACL and transport assertions; no runtime change. Change-source: pulse-maintainer
This commit is contained in:
parent
4af4f9119d
commit
3fb4b0456a
2 changed files with 5 additions and 3 deletions
|
|
@ -182,7 +182,8 @@ func TestBuildProxmoxAgentInstallCommand_NormalizesTrailingSlashes(t *testing.T)
|
|||
require.Contains(t, command, "https://pulse.example.com/base")
|
||||
require.Contains(t, command, `--token-file "$token_file"`)
|
||||
require.NotContains(t, command, "//install.sh")
|
||||
require.NotContains(t, command, "https://pulse.example.com/base/")
|
||||
require.Contains(t, command, "--url "+posixShellQuote("https://pulse.example.com/base"))
|
||||
require.NotContains(t, command, posixShellQuote("https://pulse.example.com/base/"))
|
||||
}
|
||||
|
||||
func TestBuildProxmoxAgentInstallCommand_IncludesCommandsWhenRequested(t *testing.T) {
|
||||
|
|
@ -332,7 +333,7 @@ fi`,
|
|||
})
|
||||
|
||||
require.Contains(t, script, `SETUP_SCRIPT_URL="https://pulse.example/api/setup-script?backup_perms=true&host=https%3A%2F%2Fpve1.local%3A8006&pulse_url=https%3A%2F%2Fpulse.example&type=pve"`)
|
||||
require.Contains(t, script, `PULSE_BOOTSTRAP_COMMAND_WITH_ENV='curl -fsSL '"'"'https://pulse.example/api/setup-script?backup_perms=true&host=https%3A%2F%2Fpve1.local%3A8006&pulse_url=https%3A%2F%2Fpulse.example&type=pve'"'"' | `)
|
||||
require.Contains(t, script, "PULSE_BOOTSTRAP_COMMAND_WITH_ENV="+posixShellQuote(artifact.CommandWithEnv))
|
||||
require.Contains(t, script, `PULSE_SETUP_TOKEN="${PULSE_SETUP_TOKEN:-setup-token-123}"`)
|
||||
require.Contains(t, script, `pveum aclmod /storage -user pulse-monitor@pve -role PVEDatastoreAdmin`)
|
||||
require.Contains(t, script, `pveum aclmod /storage -token "$PULSE_TOKEN_ID" -role PVEDatastoreAdmin`)
|
||||
|
|
|
|||
|
|
@ -1504,7 +1504,8 @@ fi`
|
|||
`pveum aclmod /storage -user pulse-monitor@pve -role PVEDatastoreAdmin`,
|
||||
`pveum aclmod /storage -token "$PULSE_TOKEN_ID" -role PVEDatastoreAdmin`,
|
||||
`smoke_test_pve_token() {`,
|
||||
`Authorization: PVEAPIToken=$PULSE_TOKEN_ID=$TOKEN_VALUE`,
|
||||
`printf 'Authorization: PVEAPIToken=%s=%s\n' "$PULSE_TOKEN_ID" "$TOKEN_VALUE" | curl`,
|
||||
`-H @-`,
|
||||
`${HOST_URL%/}/api2/json/nodes`,
|
||||
`if smoke_test_pve_token; then`,
|
||||
} {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue