Skip to content

Commit 952c5d1

Browse files
committedNov 14, 2019
Add test to test ssh key for node IP address
* Add test to verify that aws/aws-parallelcluster-node#188 is working * The warning message will no longer be in mpi_run.sh output because the IP address is already in known_hosts file Signed-off-by: Rex <[email protected]>
1 parent ce3516f commit 952c5d1

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed
 

‎tests/integration-tests/tests/scaling/test_mpi.py

+18-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_mpi(scheduler, region, os, instance, pcluster_config_reader, clusters_f
5858
)
5959

6060

61-
@pytest.mark.regions(["eu-west-1"])
61+
@pytest.mark.regions(["us-east-2"])
6262
@pytest.mark.instances(["c5.xlarge"])
6363
@pytest.mark.schedulers(["slurm", "sge", "torque"])
6464
@pytest.mark.usefixtures("region", "instance")
@@ -79,12 +79,25 @@ def _test_mpi_ssh(remote_command_executor, scheduler, os, test_datadir):
7979
compute_node = scheduler_commands.get_compute_nodes()
8080
assert_that(len(compute_node)).is_equal_to(1)
8181
remote_host = compute_node[0]
82+
83+
# Gets remote host ip from hostname
84+
remote_host_ip = remote_command_executor.run_remote_command(
85+
"getent hosts {0} | cut -d' ' -f1".format(remote_host)
86+
).stdout
87+
88+
# Below job will timeout if the IP address is not in known_hosts
89+
mpirun_out_ip = remote_command_executor.run_remote_script(
90+
str(test_datadir / "mpi_ssh.sh"), args=[mpi_module, remote_host_ip]
91+
).stdout.splitlines()
92+
93+
# mpirun_out_ip = "ip-10-0-127-71"
94+
assert_that(len(mpirun_out_ip)).is_equal_to(1)
95+
assert_that(mpirun_out_ip[-1]).is_equal_to(remote_host)
96+
8297
mpirun_out = remote_command_executor.run_remote_script(
8398
str(test_datadir / "mpi_ssh.sh"), args=[mpi_module, remote_host]
8499
).stdout.splitlines()
85100

86-
# mpirun_out =
87-
# "Warning: Permanently added the RSA host key for IP address '10.0.127.71' to the list of known hosts.\n
88-
# ip-10-0-127-71"
89-
assert_that(len(mpirun_out)).is_greater_than_or_equal_to(1)
101+
# mpirun_out = "ip-10-0-127-71"
102+
assert_that(len(mpirun_out)).is_equal_to(1)
90103
assert_that(mpirun_out[-1]).is_equal_to(remote_host)

0 commit comments

Comments
 (0)
Please sign in to comment.