From 59ab975feac7f7bce13107d472d037e125d2dfae Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Sat, 7 Dec 2019 14:51:29 +0100 Subject: [PATCH] test: use the standard port for sshd For the qemu tests this makes no difference as we are anyway forwarding the ports. But the nspawn tests share the same network namespace between the image and the ssh client running the test without any forwarding. In order for that to work we had to modify the image to use a non-standard port. We don't want this for two reasons: we want to make sure we test our images unmodified, and also this meant that when we changed our pipeline generation we were not verifying that the boot test cases were updated accordingly. As a result they have now drifted. Signed-off-by: Tom Gundersen --- test/cases/disk_local_boot.json | 6 ------ test/cases/ext4_local_boot.json | 6 ------ test/cases/tar_local_boot.json | 6 ------ test/run | 4 ++-- 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/test/cases/disk_local_boot.json b/test/cases/disk_local_boot.json index 916abbef6..e59b84615 100644 --- a/test/cases/disk_local_boot.json +++ b/test/cases/disk_local_boot.json @@ -120,12 +120,6 @@ "kernel_opts": "ro biosdevname=0 net.ifnames=0" } }, - { - "name": "org.osbuild.script", - "options": { - "script": "sed -i 's|#Port 22|Port 1022|' /etc/ssh/sshd_config; sed -i 's|#ListenAddress 0.0.0.0|ListenAddress 127.0.0.1|' /etc/ssh/sshd_config" - } - }, { "name": "org.osbuild.systemd", "options": { diff --git a/test/cases/ext4_local_boot.json b/test/cases/ext4_local_boot.json index ed587c88a..839d66929 100644 --- a/test/cases/ext4_local_boot.json +++ b/test/cases/ext4_local_boot.json @@ -105,12 +105,6 @@ "kernel_opts": "ro biosdevname=0 net.ifnames=0" } }, - { - "name": "org.osbuild.script", - "options": { - "script": "sed -i 's|#Port 22|Port 1022|' /etc/ssh/sshd_config; sed -i 's|#ListenAddress 0.0.0.0|ListenAddress 127.0.0.1|' /etc/ssh/sshd_config" - } - }, { "name": "org.osbuild.systemd", "options": { diff --git a/test/cases/tar_local_boot.json b/test/cases/tar_local_boot.json index a02fdd919..2f1d8a0b3 100644 --- a/test/cases/tar_local_boot.json +++ b/test/cases/tar_local_boot.json @@ -105,12 +105,6 @@ "kernel_opts": "ro biosdevname=0 net.ifnames=0" } }, - { - "name": "org.osbuild.script", - "options": { - "script": "sed -i 's|#Port 22|Port 1022|' /etc/ssh/sshd_config; sed -i 's|#ListenAddress 0.0.0.0|ListenAddress 127.0.0.1|' /etc/ssh/sshd_config" - } - }, { "name": "org.osbuild.systemd", "options": { diff --git a/test/run b/test/run index 5dc539638..6a41eacf6 100755 --- a/test/run +++ b/test/run @@ -92,7 +92,7 @@ def qemu_boot_image(image_file): "-m", "2048", "-snapshot", "-accel", "accel=kvm:hvf:tcg", - "-net", "nic,model=rtl8139", "-net", "user,hostfwd=tcp::1022-:22", + "-net", "nic,model=rtl8139", "-net", "user,hostfwd=tcp::22-:22", "-nographic", image_file ] @@ -186,7 +186,7 @@ def get_local_boot_test_case(fname: str) -> Union[Tuple[str, str, Dict[Any, Any] def run_ssh_test(private_key): cmd = ["ssh", - "-p", "1022", + "-p", "22", "-i", private_key, "-o", "StrictHostKeyChecking=no", "redhat@localhost",