Skip to content

Commit 9e29f1d

Browse files
committed
Ping multiple sites to make test multi nic more stable
1 parent 193fa41 commit 9e29f1d

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

tests/integration-tests/tests/multiple_nics/test_multiple_nics.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,19 @@ def _test_compute_node_nic(ip_address, remote_command_executor, scheduler_comman
8484
)
8585
assert_that(result.stdout).matches("Hello")
8686
# ping test from compute node
87-
result = scheduler_commands.submit_command("ping -I {0} -c 5 amazon.com > /shared/ping_{0}.out".format(ip_address))
87+
results = {}
88+
sites = ["amazon.com", "google.com", "github.com"]
89+
for site in sites:
90+
results[site] = _check_ping(scheduler_commands, remote_command_executor, ip_address, site)
91+
92+
assert any(results.values()), f"Ping test failed for all sites. Results: {results}"
93+
94+
95+
def _check_ping(scheduler_commands, remote_command_executor, ip_address, site):
96+
result = scheduler_commands.submit_command(
97+
f"ping -I {ip_address} -c 5 {site} > /shared/ping_{ip_address}_{site}.out"
98+
)
8899
job_id = scheduler_commands.assert_job_submitted(result.stdout)
89100
scheduler_commands.wait_job_completed(job_id)
90-
scheduler_commands.assert_job_succeeded(job_id)
91-
result = remote_command_executor.run_remote_command("cat /shared/ping_{0}.out".format(ip_address))
92-
assert_that(result.stdout).matches(".*5 packets transmitted, 5 received, 0% packet loss,.*")
101+
result = remote_command_executor.run_remote_command(f"cat /shared/ping_{ip_address}_{site}.out")
102+
return "5 packets transmitted, 5 received, 0% packet loss" in result.stdout

0 commit comments

Comments
 (0)