aboutgitcodebugslistschat
path: root/test/distro/opensuse
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-08-18 16:13:49 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-08-20 19:07:12 +0200
commita8598c7e70df60e1193993ac6b7c4c729518c7aa (patch)
treeea7bc8ae3176d6edb5cb479d6ab355f39ef0f513 /test/distro/opensuse
parent662407de0fae6335bbaff935a5d7969853e547a0 (diff)
downloadpasst-a8598c7e70df60e1193993ac6b7c4c729518c7aa.tar
passt-a8598c7e70df60e1193993ac6b7c4c729518c7aa.tar.gz
passt-a8598c7e70df60e1193993ac6b7c4c729518c7aa.tar.bz2
passt-a8598c7e70df60e1193993ac6b7c4c729518c7aa.tar.lz
passt-a8598c7e70df60e1193993ac6b7c4c729518c7aa.tar.xz
passt-a8598c7e70df60e1193993ac6b7c4c729518c7aa.tar.zst
passt-a8598c7e70df60e1193993ac6b7c4c729518c7aa.zip
test: Convert distro tests to use socat instead of nc/ncat
We've recently converted most of our tests to use socat instead of nc/netcat/ncat, because socat is more powerful and we don't need to deal with the several possible variants of netcat. We still use nc or ncat for the distro tests. Because there we control the guest environment and can pick our tools, there isn't the same reason to switch to socat. However, using socat here as well makes the tests a bit easier to read, and doesn't require people reading or modifying them to become familiar with an additional tool. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> [sbrivio: keep using netcat-openbsd in Ubuntu 16.04 ppc64 test, as socat is unavailable there] Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test/distro/opensuse')
-rw-r--r--test/distro/opensuse18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/distro/opensuse b/test/distro/opensuse
index d77821a..d48deb7 100644
--- a/test/distro/opensuse
+++ b/test/distro/opensuse
@@ -16,13 +16,13 @@ htools qemu-img virt-edit guestfish head sed cat kill qemu-system-x86_64 qemu-sy
# Quick pasta test: send message from init to ns, and from ns to init
def distro_quick_pasta_test
-host (nc -6 -l -p 10000 > /tmp/init_msg; echo "from_init" | nc -N ::1 9999) &
+host (socat -u TCP6-LISTEN:10000 OPEN:/tmp/init_msg,create,trunc; echo "from_init" | socat -u STDIN TCP6:[::1]:9999) &
hostb ./pasta
sleep 1
host PS1='$ '
-host nc -6 -l -p 9999 > /tmp/ns_msg &
+host socat -u TCP6-LISTEN:9999 OPEN:/tmp/ns_msg,create,trunc &
sleep 2
-host echo "from_ns" | nc -N ::1 10000
+host echo "from_ns" | socat -u STDIN TCP6:[::1]:10000
sleep 2
host echo
sleep 1
@@ -57,7 +57,7 @@ host ip link set eth0 up
sleep 2
host echo "DNSSERVERS='__DNS6__'" | netconfig modify -s dns_resolver -i eth0
# zypper sometimes segfaults, hence the retries
-host for i in $(seq 1 10); do zypper install -y gcc make netcat-openbsd && break; done; echo
+host for i in $(seq 1 10); do zypper install -y gcc make socat && break; done; echo
host make clean
host CFLAGS="-Werror" make
@@ -85,7 +85,7 @@ host ip link set eth0 up
sleep 2
host echo "DNSSERVERS='__DNS6__'" | netconfig modify -s dns_resolver -i eth0
# zypper sometimes segfaults, hence the retries
-host for i in $(seq 1 10); do zypper install -y gcc make netcat-openbsd && break; done; echo
+host for i in $(seq 1 10); do zypper install -y gcc make socat && break; done; echo
host make clean
host CFLAGS="-Werror" make
@@ -112,7 +112,7 @@ host ip link set eth0 up
sleep 2
host echo "DNSSERVERS='__DNS6__'" | netconfig modify -s dns_resolver -i eth0
# zypper sometimes segfaults, hence the retries
-host for i in $(seq 1 10); do zypper install -y gcc make netcat-openbsd && break; done; echo
+host for i in $(seq 1 10); do zypper install -y gcc make socat && break; done; echo
host make clean
host CFLAGS="-Werror" make
@@ -137,7 +137,7 @@ sleep 10
host echo "DNSSERVERS='__DNS6__'" | netconfig modify -s dns_resolver -i enp0s1
sleep 10
# No segfaults ever seen with this
-host zypper install -y gcc make netcat-openbsd; echo
+host zypper install -y gcc make socat; echo
host make clean
host CFLAGS="-Werror" make
@@ -165,7 +165,7 @@ host ip link set eth0 up
sleep 10
host echo "DNSSERVERS='__DNS6__'" | netconfig modify -s dns_resolver -i eth0
sleep 10
-host zypper install -y gcc make netcat-openbsd; echo
+host zypper install -y gcc make socat; echo
host make clean
host CFLAGS="-Werror" make
@@ -192,7 +192,7 @@ host ip link set ens2 up
sleep 2
host echo "DNSSERVERS='__DNS6__'" | netconfig modify -s dns_resolver -i ens2
# zypper sometimes segfaults, hence the retries
-host for i in $(seq 1 10); do zypper install -y gcc make netcat-openbsd && break; done; echo
+host for i in $(seq 1 10); do zypper install -y gcc make socat && break; done; echo
host make clean
host CFLAGS="-Werror" make