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 <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2019-12-07 14:51:29 +01:00 committed by Lars Karlitski
parent 79b868d423
commit 59ab975fea
4 changed files with 2 additions and 20 deletions

View file

@ -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": {

View file

@ -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": {

View file

@ -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": {

View file

@ -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",