aboutgitcodebugslistschat
path: root/test/distro/debian
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/debian
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/debian')
-rw-r--r--test/distro/debian28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/distro/debian b/test/distro/debian
index 1548761..0fac983 100644
--- a/test/distro/debian
+++ b/test/distro/debian
@@ -18,12 +18,12 @@ htools cat kill qemu-system-x86_64 qemu-system-aarch64 qemu-system-ppc64
def distro_quick_pasta_test
host export SHELL="/bin/dash"
host dash
-host (nc -w1 -6 -l -p 10000 > /tmp/init_msg; echo "from_init" | nc -q0 ::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 nc -w1 -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 -q0 ::1 10000
+host echo "from_ns" | socat -u STDIN TCP6:[::1]:10000
sleep 2
host echo
sleep 1
@@ -47,7 +47,7 @@ host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial
host PS1='$ '
sleep 2
host apt-get update
-host apt-get -y install make gcc netcat-openbsd
+host apt-get -y install make gcc socat
host make clean
host CFLAGS="-Wno-missing-field-initializers -Wno-missing-braces -Wno-type-limits" make
@@ -68,7 +68,7 @@ host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial
host PS1='$ '
sleep 2
host apt-get update
-host apt-get -y install make gcc netcat-openbsd
+host apt-get -y install make gcc socat
host make clean
host CFLAGS="-Werror" make
@@ -86,7 +86,7 @@ host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial
host PS1='$ '
sleep 2
host apt-get update
-host apt-get -y install make gcc netcat-openbsd
+host apt-get -y install make gcc socat
host make clean
host CFLAGS="-Werror" make
@@ -104,7 +104,7 @@ host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios _
host PS1='$ '
sleep 2
host apt-get update
-host apt-get -y install make gcc netcat-openbsd
+host apt-get -y install make gcc socat
host make clean
host CFLAGS="-Werror" make
@@ -122,7 +122,7 @@ host ./qrap 5 qemu-system-ppc64 -m 2048 -smp 2 -nographic -serial stdio -nodefau
host PS1='$ '
sleep 2
host apt-get update
-host apt-get -y install make gcc netcat-openbsd
+host apt-get -y install make gcc socat
host make clean
host CFLAGS="-Werror" make
@@ -140,7 +140,7 @@ test Debian GNU/Linux 11 (bullseye, stable), amd64
host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-11-nocloud-amd64.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot
sleep 2
host apt-get update
-host apt-get -y install make gcc netcat-openbsd
+host apt-get -y install make gcc socat
host make clean
host CFLAGS="-Werror" make
@@ -156,7 +156,7 @@ test Debian GNU/Linux 11 (bullseye, stable), aarch64
host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-11-generic-arm64.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot
sleep 2
host apt-get update
-host apt-get -y install make gcc netcat-openbsd
+host apt-get -y install make gcc socat
host make clean
host CFLAGS="-Werror" make
@@ -172,7 +172,7 @@ test Debian GNU/Linux 11 (bullseye, stable), ppc64le
host ./qrap 5 qemu-system-ppc64 -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-11-generic-ppc64el.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot
sleep 2
host apt-get update
-host apt-get -y install make gcc netcat-openbsd
+host apt-get -y install make gcc socat
host make clean
host CFLAGS="-Werror" make
@@ -198,7 +198,7 @@ sleep 2
host growpart /dev/sda 1
host resize2fs -p /dev/sda1
host apt-get update
-host apt-get -y install make gcc netcat-openbsd
+host apt-get -y install make gcc socat
host make clean
host CFLAGS="-Werror" make
@@ -217,7 +217,7 @@ sleep 2
host growpart /dev/vda 1
host resize2fs -p /dev/vda1
host apt-get update
-host apt-get -y install make gcc netcat-openbsd
+host apt-get -y install make gcc socat
host make clean
host CFLAGS="-Werror" make
@@ -233,7 +233,7 @@ test Debian GNU/Linux sid (experimental), ppc64le
host ./qrap 5 qemu-system-ppc64 -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-sid-nocloud-ppc64el-daily.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot
sleep 2
host apt-get update
-host apt-get -y install make gcc netcat-openbsd
+host apt-get -y install make gcc socat
host make clean
host CFLAGS="-Werror" make