aboutgitcodebugslistschat
path: root/test/distro
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-09-05 14:32:14 +0200
committerStefano Brivio <sbrivio@redhat.com>2022-09-05 14:32:14 +0200
commitc8807478834a27315a6c3af68acf1016f81d79c5 (patch)
tree729260f8a6481a14a84f72967507b50d5ecd7e54 /test/distro
parent7ce9fd165f4f0c85e13dcaf4ff97c53d34b4a51d (diff)
downloadpasst-c8807478834a27315a6c3af68acf1016f81d79c5.tar
passt-c8807478834a27315a6c3af68acf1016f81d79c5.tar.gz
passt-c8807478834a27315a6c3af68acf1016f81d79c5.tar.bz2
passt-c8807478834a27315a6c3af68acf1016f81d79c5.tar.lz
passt-c8807478834a27315a6c3af68acf1016f81d79c5.tar.xz
passt-c8807478834a27315a6c3af68acf1016f81d79c5.tar.zst
passt-c8807478834a27315a6c3af68acf1016f81d79c5.zip
test: Wait for systemd-resolved to be ready on Ubuntu 22.04 for s390x
On new Ubuntu 22.04 images, stopping systemd-resolved to get the dhclient script override resolv.conf doesn't work anymore. I originally used that hack to avoid introducing a delay which is needed when running it on TCG. Keep systemd-resolved running instead, and wait for it to be ready by retrying to resolve a domain a few times before installing packages, so that we don't add another ugly delay that might unnecessarily slow down things even further. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test/distro')
-rw-r--r--test/distro/ubuntu8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/distro/ubuntu b/test/distro/ubuntu
index 6666f38..5e67a46 100644
--- a/test/distro/ubuntu
+++ b/test/distro/ubuntu
@@ -54,6 +54,11 @@ hout INIT_MSG cat /tmp/init_msg
check [ __INIT_MSG__ = "from_ns" ]
endef
+# With systemd-resolved and TCG, DNS might take a while to work
+def dns_ready_wait
+host r=10; while [ \${r} -gt 0 ]; do host ubuntu.com && break; sleep 5; r=\$((r - 1)); done
+endef
+
# Start passt, set common variables
hostb ./passt -P __PIDFILE__ &
sleep 1
@@ -185,11 +190,10 @@ test Ubuntu 22.04 (Jammy Jellyfish), s390x
host ./qrap 5 qemu-system-s390x -m 2048 -smp 2 -serial stdio -nodefaults -nographic __BASEPATH__/prepared-jammy-server-cloudimg-s390x.img -net socket,fd=5 -net nic,model=virtio -device virtio-rng-ccw -snapshot
-host service systemd-resolved stop
host export DEBIAN_FRONTEND=noninteractive
host apt-get -y remove needrestart snapd
host dhclient -4
-sleep 2
+dns_ready_wait
host apt-get update
host apt-get -y install make gcc socat