From 6703da44c16b9bdfc4d959db270961d8ab826570 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 10 Jun 2022 12:32:41 +1000 Subject: 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 [sbrivio: Fix port argument in distro_quick_pasta_test{,_fedora34} too] Signed-off-by: Stefano Brivio --- test/distro/fedora | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/distro/fedora') 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 -- cgit v1.2.3