Skip to content

Commit 45327bf

Browse files
authored
Merge pull request #318 from xcp-ng/fix-access-links
Fix access-links tests
2 parents cfc760d + 7e43aa9 commit 45327bf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/misc/test_access_links.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import subprocess
33
import hashlib
44

5+
from lib import commands
6+
57
# This test is designed to verify the accessibility of the XOA deployment script
68
#
79
# Requirements:
@@ -10,29 +12,29 @@
1012
@pytest.mark.parametrize("command_id", ["curl", "wget"])
1113
@pytest.mark.parametrize("url_id", [
1214
"xoa",
13-
"xcp-ng",
15+
"xcpng",
1416
"vates"
1517
])
1618
def test_access_links(host, command_id, url_id):
1719
"""
1820
Verifies that the specified URL responds correctly via the specified command
1921
and compares the checksum of the downloaded content between local and remote.
2022
"""
21-
command = {"curl": "curl -fsSL",
22-
"wget": "wget -qO-"}[command_id]
23+
command = {"curl": ["curl", "-fsSL"],
24+
"wget": ["wget", "-qO-"]}[command_id]
2325
url = {
2426
"xoa": "https://xoa.io/deploy",
2527
"xcpng": "https://updates.xcp-ng.org/trace",
2628
"vates": "https://repo.vates.tech/README.txt"
2729
}[url_id]
28-
COMMAND = f"{command} '{url}'"
30+
COMMAND = command + [url]
2931

3032
# Download from remote host
3133
remote_result = host.ssh(COMMAND)
3234

3335
# Verify the download worked by comparing with local download
3436
# This ensures the content is accessible and identical from both locations
35-
local_result = host.local_cmd(COMMAND)
37+
local_result = commands.local_cmd(COMMAND)
3638

3739
assert local_result.returncode == 0, (
3840
f"Failed to fetch URL locally: {local_result.stderr}"

0 commit comments

Comments
 (0)