aboutgitcodebugslistschat
path: root/test
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-06-10 12:32:41 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-06-15 09:37:03 +0200
commit6703da44c16b9bdfc4d959db270961d8ab826570 (patch)
treeacd645d709152019463b5e0b55f1486dfae62a6c /test
parentd7d467f60cb5502782f7dbf88ce7eace3b0f38c1 (diff)
downloadpasst-6703da44c16b9bdfc4d959db270961d8ab826570.tar
passt-6703da44c16b9bdfc4d959db270961d8ab826570.tar.gz
passt-6703da44c16b9bdfc4d959db270961d8ab826570.tar.bz2
passt-6703da44c16b9bdfc4d959db270961d8ab826570.tar.lz
passt-6703da44c16b9bdfc4d959db270961d8ab826570.tar.xz
passt-6703da44c16b9bdfc4d959db270961d8ab826570.tar.zst
passt-6703da44c16b9bdfc4d959db270961d8ab826570.zip
tests: Use more explicit netcat options for distro/fedora tests
distro/fedora contains two versions of the basic tests, used for different Fedora versions. One uses explicit listening address for netcat in some extra places, the other does not. Apparently the older netcat versions didn't require the explicit addresses. Not supplying addresses doesn't test anything useful though, just a detail in netcat's behaviour. So, it's cleaner to just always supply explicit addresses. In addition, we're explicitly expecting the nmap version of ncat, also known as "ncat". So, it's more explicit what we're after if we invoke it via that name rather than "nc", which will go via an /etc/alternatives link. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> [sbrivio: Fix port argument in distro_quick_pasta_test{,_fedora34} too] Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/distro/fedora14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/distro/fedora b/test/distro/fedora
index f2f8f27..7a5eaef 100644
--- a/test/distro/fedora
+++ b/test/distro/fedora
@@ -16,13 +16,13 @@ htools wget virt-edit guestfish head sed cat kill
# 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 ::1 9999) &
+host (ncat -6 -l ::1 10000 > /tmp/init_msg; echo "from_init" | ncat ::1 9999) &
hostb ./pasta
sleep 1
host PS1='$ '
-host nc -6 -l -p 9999 > /tmp/ns_msg &
+host ncat -6 -l ::1 9999 > /tmp/ns_msg &
sleep 2
-host echo "from_ns" | nc ::1 10000
+host echo "from_ns" | ncat ::1 10000
sleep 2
host echo
sleep 1
@@ -34,17 +34,17 @@ hout INIT_MSG cat /tmp/init_msg
check [ __INIT_MSG__ = "from_ns" ]
endef
-# Explicit listening address, bracketed paste mode off, needed from Fedora 34
+# Bracketed paste mode off, needed from Fedora 34
def distro_quick_pasta_test_fedora34
host bind 'set enable-bracketed-paste off'
-host (nc -6 -l -p 10000 > /tmp/init_msg; echo "from_init" | nc -6 ::1 9999) &
+host (ncat -6 -l ::1 10000 > /tmp/init_msg; echo "from_init" | ncat -6 ::1 9999) &
hostb ./pasta
sleep 1
host PS1='$ '
host bind 'set enable-bracketed-paste off'
-host nc -6 -l ::1 9999 > /tmp/ns_msg &
+host ncat -6 -l ::1 9999 > /tmp/ns_msg &
sleep 2
-host echo "from_ns" | nc -6 ::1 10000
+host echo "from_ns" | ncat -6 ::1 10000
sleep 2
host echo
hout NS_MSG cat /tmp/ns_msg