public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top, Stefano Brivio <sbrivio@redhat.com>
Cc: jarichte@redhat.com, Cleber Rosa <crosa@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH v2 21/21] avocado: Convert basic pasta tests
Date: Tue, 16 May 2023 12:01:35 +1000	[thread overview]
Message-ID: <20230516020135.1901256-22-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20230516020135.1901256-1-david@gibson.dropbear.id.au>

Convert the old-style tests for pasta (DHCP, NDP, TCP and UDP transfers)
to using avocado.  There are a few differences in what we test, but this
should generally improve coverage:

 * We run in a constructed network environment, so we no longer depend on
   the real host's networking configuration
 * We do independent setup for each individual test
 * We add explicit tests for --config-net, which we use to accelerate that
   setup for the TCP and UDP tests
 * The TCP and UDP tests now test transfers between the guest and a
   (simulated) remote site that's on a different network from the simulated
   pasta host.  This better matches the typical passt/pasta usecase

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 Makefile         |   4 +-
 avocado/pasta.py | 183 +++++++++++++++++++++++++++++++++++++++++++++++
 oldtest/run      |  14 ++--
 test/lib/layout  |  31 --------
 test/lib/setup   |  40 -----------
 test/pasta/dhcp  |  46 ------------
 test/pasta/ndp   |  33 ---------
 test/pasta/tcp   |  96 -------------------------
 test/pasta/udp   |  59 ---------------
 test/run         |   8 ---
 10 files changed, 192 insertions(+), 322 deletions(-)
 create mode 100644 avocado/pasta.py
 delete mode 100644 test/pasta/dhcp
 delete mode 100644 test/pasta/ndp
 delete mode 100644 test/pasta/tcp
 delete mode 100644 test/pasta/udp

diff --git a/Makefile b/Makefile
index 8eaae0f..00c52c6 100644
--- a/Makefile
+++ b/Makefile
@@ -298,8 +298,8 @@ cppcheck: $(SRCS) $(HEADERS)
 
 AVOCADO = avocado
 
-avocado-assets:
-	$(MAKE) -C test nstool small.bin
+avocado-assets: pasta
+	$(MAKE) -C test nstool small.bin big.bin medium.bin
 
 avocado-%: avocado-assets
 	PYTHONPATH=./avocado $(AVOCADO) run avocado --filter-by-tags=$*
diff --git a/avocado/pasta.py b/avocado/pasta.py
new file mode 100644
index 0000000..5ef856d
--- /dev/null
+++ b/avocado/pasta.py
@@ -0,0 +1,183 @@
+#! /usr/bin/python3
+
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# avocado/pasta.py - Basic tests for pasta mode
+#
+# Copyright Red Hat
+# Author: David Gibson <david@gibson.dropbear.id.au>
+
+import ipaddress
+import os
+
+from tasst.address import LOOPBACK4, LOOPBACK6
+from tasst.scenario.simple import SimpleNetTasst
+from tasst.dhcp import BaseDhcpTasst
+from tasst.dhcpv6 import BaseDhcpv6Tasst
+from tasst.ndp import BaseNdpTasst
+from tasst.nstool import UnshareSite
+from tasst.transfer import BaseTransferTasst, TcpUploadTasst, UdpTransferTasst
+
+
+PASTA_BIN = './pasta'
+
+
+class UnconfiguredPastaTasst(SimpleNetTasst):
+    EXTRA_OPTS = ''
+    INBOUND_PORT = 10002
+    OUTBOUND_PORT = 10003
+
+    def setUp(self):
+        super().setUp()
+
+        self.guestns = UnshareSite(self.__class__.__name__ + '.guestns',
+                                   '-Ucnpf --mount-proc',
+                                   parent=self.simhost, sudo=True)
+        self.guestns_relpid = self.guestns.relative_pid(self.simhost)
+
+        pidfile = os.path.join(self.workdir, 'pasta.pid')
+        pastacmd = ('{} -f -t {} -u {} -T {} -U {} -P {} {} {}'
+                    .format(PASTA_BIN, self.INBOUND_PORT, self.INBOUND_PORT,
+                            self.OUTBOUND_PORT, self.OUTBOUND_PORT,
+                            pidfile, self.EXTRA_OPTS, self.guestns_relpid))
+
+        self.pasta = self.simhost.bg(pastacmd)
+
+        # Wait for the pidfile to be written
+        while not os.path.exists(pidfile) or not open(pidfile).read():
+            pass
+        # PID of pasta process in simhost namespace
+        self.pastapid = int(open(pidfile).read())
+
+    def tearDown(self):
+        self.simhost.fg('kill -TERM {}'.format(self.pastapid))
+        rc = self.pasta.wait(timeout=1.0)
+        self.assertEqual(rc, 0)
+        self.guestns.close()
+        super().tearDown()
+
+
+class PastaIfnameTasst(UnconfiguredPastaTasst):
+    def test_ifname(self):
+        self.assertCountEqual(self.guestns.ifs(), ('lo', self.ifname))
+
+
+class PastaNdpTasst(UnconfiguredPastaTasst, BaseNdpTasst):
+    def setUp(self):
+        super().setUp()
+        self.guestns.ifup(self.ifname)
+        BaseNdpTasst.subsetup(self, self.guestns, self.ifname, self.ip6.network, self.gw_ip6_ll.ip)
+
+
+class PastaDhcpTasst(UnconfiguredPastaTasst, BaseDhcpTasst):
+    def setUp(self):
+        super().setUp()
+        BaseDhcpTasst.subsetup(self, self.guestns, self.ifname, self.ip4.ip, self.gw_ip4.ip, 65520)
+
+
+class PastaDhcpv6Tasst(UnconfiguredPastaTasst, BaseDhcpv6Tasst):
+    def setUp(self):
+        super().setUp()
+        BaseDhcpv6Tasst.subsetup(self, self.guestns, self.ifname, self.ip6.ip)
+
+
+class ConfiguredPastaTasst(UnconfiguredPastaTasst):
+    EXTRA_OPTS = '--config-net'
+
+
+class ConfigNetTasst(ConfiguredPastaTasst):
+    def test_addr(self):
+        addrs = self.guestns.addrs(self.ifname, scope='global')
+        self.assertCountEqual(addrs, [self.ip4, self.ip6])
+
+    def test_route4(self):
+        (defroute,) = self.guestns.routes4(dst='default')
+        gateway = ipaddress.ip_address(defroute['gateway'])
+        self.assertEquals(gateway, self.gw_ip4.ip)
+
+    def test_route6(self):
+        (defroute,) = self.guestns.routes6(dst='default')
+        gateway = ipaddress.ip_address(defroute['gateway'])
+        self.assertEquals(gateway, self.gw_ip6_ll.ip)
+
+    def test_mtu(self):
+        mtu = self.guestns.mtu(self.ifname)
+        self.assertEquals(mtu, 65520)
+
+
+class PastaOutwardTransferTasst(ConfiguredPastaTasst, BaseTransferTasst):
+    """
+    :avocado: disable
+    """
+
+    PORT = 10000
+    def setUp(self):
+        super().setUp()
+
+        BaseTransferTasst.subsetup(self, self.DATAFILE, self.guestns, self.gw,
+                                   self.remote_ip4.ip, self.remote_ip6.ip, self.PORT)
+
+
+class PastaOutwardSmallTcpUploadTasst(PastaOutwardTransferTasst, TcpUploadTasst):
+    DATAFILE = './test/small.bin'
+
+
+class PastaOutwardBigTcpUploadTasst(PastaOutwardSmallTcpUploadTasst):
+    DATAFILE = './test/big.bin'
+    timeout = 30.0
+
+
+class PastaOutwardUdpTransferTasst(PastaOutwardTransferTasst, UdpTransferTasst):
+    DATAFILE = './test/medium.bin'
+
+
+class PastaInwardTransferTasst(ConfiguredPastaTasst, BaseTransferTasst):
+    """
+    :avocado: disable
+    """
+
+    def setUp(self):
+        super().setUp()
+
+        BaseTransferTasst.subsetup(self, self.DATAFILE, self.gw, self.guestns,
+                                   self.ip4.ip, self.ip6.ip, self.INBOUND_PORT,
+                                   from_ip4=self.remote_ip4.ip, from_ip6=self.remote_ip6.ip)
+
+
+class PastaInwardSmallTcpUploadTasst(PastaInwardTransferTasst, TcpUploadTasst):
+    DATAFILE = './test/small.bin'
+
+
+class PastaInwardBigTcpUploadTasst(PastaInwardSmallTcpUploadTasst):
+    DATAFILE = './test/big.bin'
+    timeout = 30.0
+
+
+class PastaInwardUdpTransferTasst(PastaInwardTransferTasst, UdpTransferTasst):
+    DATAFILE = './test/medium.bin'
+
+
+class PastaSplicedTransferTasst(ConfiguredPastaTasst, BaseTransferTasst):
+    """
+    :avocado: disable
+    """
+
+    def setUp(self):
+        super().setUp()
+
+        BaseTransferTasst.subsetup(self, self.DATAFILE, self.guestns, self.simhost,
+                                   LOOPBACK4, LOOPBACK6, self.OUTBOUND_PORT,
+                                   listen_ip4=LOOPBACK4, listen_ip6=LOOPBACK6)
+
+
+class PastaSplicedSmallTcpUploadTasst(PastaSplicedTransferTasst, TcpUploadTasst):
+    DATAFILE = './test/small.bin'
+
+
+class PastaSplicedBigTcpUploadTasst(PastaSplicedSmallTcpUploadTasst):
+    DATAFILE = './test/big.bin'
+    timeout = 30.0
+
+
+class PastaSplicedUdpTransferTasst(PastaSplicedTransferTasst, UdpTransferTasst):
+    DATAFILE = './test/medium.bin'
diff --git a/oldtest/run b/oldtest/run
index a16bc49..f1157f9 100755
--- a/oldtest/run
+++ b/oldtest/run
@@ -70,13 +70,13 @@ run() {
 	test build/clang_tidy
 	teardown build
 
-#	setup pasta
-#	test pasta/ndp
-#	test pasta/dhcp
-#	test pasta/tcp
-#	test pasta/udp
-#	test passt/shutdown
-#	teardown pasta
+	setup pasta
+	test pasta/ndp
+	test pasta/dhcp
+	test pasta/tcp
+	test pasta/udp
+	test passt/shutdown
+	teardown pasta
 
 #	setup pasta_options
 #	test pasta_options/log_to_file
diff --git a/test/lib/layout b/test/lib/layout
index f9a1cf1..e2b1db0 100644
--- a/test/lib/layout
+++ b/test/lib/layout
@@ -13,37 +13,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio@redhat.com>
 
-# layout_pasta() - Panes for host, pasta, and separate one for namespace
-layout_pasta() {
-	sleep 3
-
-	tmux kill-pane -a -t 0
-	cmd_write 0 clear
-
-	tmux split-window -v -t passt_test
-	tmux split-window -h -t passt_test
-	tmux split-window -h -l '42%' -t passt_test:1.0
-
-	PANE_NS=0
-	PANE_INFO=1
-	PANE_HOST=2
-	PANE_PASST=3
-
-	get_info_cols
-
-	tmux send-keys -l -t ${PANE_INFO} 'while cat '"$STATEBASE/log_pipe"'; do :; done'
-	tmux send-keys -t ${PANE_INFO} -N 100 C-m
-	tmux select-pane -t ${PANE_INFO} -T "test log"
-
-	pane_watch_contexts ${PANE_HOST} host host
-	pane_watch_contexts ${PANE_PASST} pasta passt
-	pane_watch_contexts ${PANE_NS} "namespace" unshare ns
-
-	info_layout "single pasta instance with namespace"
-
-	sleep 1
-}
-
 # layout_passt() - Panes for host, passt, and guest
 layout_passt() {
 	sleep 3
diff --git a/test/lib/setup b/test/lib/setup
index 5386805..7abf206 100755
--- a/test/lib/setup
+++ b/test/lib/setup
@@ -61,36 +61,6 @@ setup_passt() {
 	context_setup_guest guest $GUEST_CID
 }
 
-# setup_pasta() - Create a network and user namespace, connect pasta to it
-setup_pasta() {
-	context_setup_host host
-	context_setup_host passt
-	context_setup_host unshare
-
-	layout_pasta
-
-	context_run_bg unshare "unshare -rUnpf ${NSTOOL} hold ${STATESETUP}/ns.hold"
-
-	context_setup_nstool ns ${STATESETUP}/ns.hold
-
-	# Ports:
-	#
-	#                 ns        |         host
-	#         ------------------|---------------------
-	#  10002      as server     |    spliced to ns
-	#  10003   spliced to init  |      as server
-
-	__opts=
-	[ ${PCAP} -eq 1 ] && __opts="${__opts} -p ${LOGDIR}/pasta.pcap"
-	[ ${DEBUG} -eq 1 ] && __opts="${__opts} -d"
-	[ ${TRACE} -eq 1 ] && __opts="${__opts} --trace"
-
-	context_run_bg passt "./pasta ${__opts} -f -t 10002 -T 10003 -u 10002 -U 10003 -P ${STATESETUP}/passt.pid $(${NSTOOL} info -pw ${STATESETUP}/ns.hold)"
-
-	# pidfile isn't created until pasta is ready
-	wait_for [ -f "${STATESETUP}/passt.pid" ]
-}
-
 # setup_passt_in_ns() - Set up namespace (with pasta), run qemu and passt into it
 setup_passt_in_ns() {
 	context_setup_host host
@@ -270,16 +240,6 @@ teardown_passt() {
 	teardown_context_watch ${PANE_GUEST} qemu guest
 }
 
-# teardown_pasta() - Exit namespace, kill pasta process
-teardown_pasta() {
-	${NSTOOL} stop "${STATESETUP}/ns.hold"
-	context_wait unshare
-
-	teardown_context_watch ${PANE_HOST} host
-	teardown_context_watch ${PANE_PASST} passt
-	teardown_context_watch ${PANE_NS} unshare ns
-}
-
 # teardown_passt_in_ns() - Exit namespace, kill qemu and pasta, remove pid file
 teardown_passt_in_ns() {
 	context_run ns kill $(cat "${STATESETUP}/qemu.pid")
diff --git a/test/pasta/dhcp b/test/pasta/dhcp
deleted file mode 100644
index 309001b..0000000
--- a/test/pasta/dhcp
+++ /dev/null
@@ -1,46 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-#
-# PASST - Plug A Simple Socket Transport
-#  for qemu/UNIX domain socket mode
-#
-# PASTA - Pack A Subtle Tap Abstraction
-#  for network namespace/tap device mode
-#
-# test/pasta/dhcp - Check DHCP and DHCPv6 functionality in pasta mode
-#
-# Copyright (c) 2021 Red Hat GmbH
-# Author: Stefano Brivio <sbrivio@redhat.com>
-
-nstools	ip jq /sbin/dhclient
-htools	ip jq
-
-test	Interface name
-nsout	IFNAME ip -j link show | jq -rM '.[] | select(.link_type == "ether").ifname'
-check	[ -n "__IFNAME__" ]
-
-test	DHCP: address
-ns	/sbin/dhclient -4 --no-pid __IFNAME__
-nsout	ADDR ip -j -4 addr show|jq -rM '.[] | select(.ifname == "__IFNAME__").addr_info[0].local'
-hout	HOST_ADDR ip -j -4 addr show|jq -rM '.[] | select(.ifname == "__IFNAME__").addr_info[0].local'
-check	[ __ADDR__ = __HOST_ADDR__ ]
-
-test	DHCP: route
-nsout	GW ip -j -4 route show|jq -rM '.[] | select(.dst == "default").gateway'
-hout	HOST_GW ip -j -4 route show|jq -rM '[.[] | select(.dst == "default").gateway] | .[0]'
-check	[ __GW__ = __HOST_GW__ ]
-
-test	DHCP: MTU
-nsout	MTU ip -j link show | jq -rM '.[] | select(.ifname == "__IFNAME__").mtu'
-check	[ __MTU__ = 65520 ]
-
-test	DHCPv6: address
-ns	/sbin/dhclient -6 --no-pid __IFNAME__
-hout	HOST_IFNAME6 ip -j -6 route show|jq -rM '[.[] | select(.dst == "default").dev] | .[0]'
-nsout	ADDR6 ip -j -6 addr show|jq -rM '.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.prefixlen == 128).local'
-hout	HOST_ADDR6 ip -j -6 addr show|jq -rM '.[] | select(.ifname == "__HOST_IFNAME6__").addr_info[] | select(.scope == "global").local'
-check	[ __ADDR6__ = __HOST_ADDR6__ ]
-
-test	DHCPv6: route
-nsout	GW6 ip -j -6 route show|jq -rM '.[] | select(.dst == "default").gateway'
-hout	HOST_GW6 ip -j -6 route show|jq -rM '[.[] | select(.dst == "default").gateway] | .[0]'
-check	[ __GW6__ = __HOST_GW6__ ]
diff --git a/test/pasta/ndp b/test/pasta/ndp
deleted file mode 100644
index bb33110..0000000
--- a/test/pasta/ndp
+++ /dev/null
@@ -1,33 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-#
-# PASST - Plug A Simple Socket Transport
-#  for qemu/UNIX domain socket mode
-#
-# PASTA - Pack A Subtle Tap Abstraction
-#  for network namespace/tap device mode
-#
-# test/pasta/ndp - Check DHCP and DHCPv6 functionality in pasta mode
-#
-# Copyright (c) 2021 Red Hat GmbH
-# Author: Stefano Brivio <sbrivio@redhat.com>
-
-nstools	ip jq sipcalc grep cut
-htools	ip jq sipcalc grep cut
-
-test	Interface name
-nsout	IFNAME ip -j link show | jq -rM '.[] | select(.link_type == "ether").ifname'
-check	[ -n "__IFNAME__" ]
-ns	ip link set dev __IFNAME__ up
-sleep	2
-
-test	SLAAC: prefix
-nsout	ADDR6 ip -j -6 addr show|jq -rM '.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.scope == "global" and .prefixlen == 64).local'
-nsout	PREFIX6 sipcalc __ADDR6__/64 | grep prefix | cut -d' ' -f4
-hout	HOST_ADDR6 ip -j -6 addr show|jq -rM '.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.scope == "global").local'
-hout	HOST_PREFIX6 sipcalc __HOST_ADDR6__/64 | grep prefix | cut -d' ' -f4
-check	[ "__PREFIX6__" = "__HOST_PREFIX6__" ]
-
-test	SLAAC: route
-nsout	GW6 ip -j -6 route show|jq -rM '.[] | select(.dst == "default").gateway'
-hout	HOST_GW6 ip -j -6 route show|jq -rM '[.[] | select(.dst == "default").gateway] | .[0]'
-check	[ __GW6__ = __HOST_GW6__ ]
diff --git a/test/pasta/tcp b/test/pasta/tcp
deleted file mode 100644
index 6ab18c5..0000000
--- a/test/pasta/tcp
+++ /dev/null
@@ -1,96 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-#
-# PASST - Plug A Simple Socket Transport
-#  for qemu/UNIX domain socket mode
-#
-# PASTA - Pack A Subtle Tap Abstraction
-#  for network namespace/tap device mode
-#
-# test/pasta/tcp - Check TCP functionality for pasta
-#
-# Copyright (c) 2021 Red Hat GmbH
-# Author: Stefano Brivio <sbrivio@redhat.com>
-
-htools	socat ip jq
-nstools	socat ip jq
-
-set	TEMP_BIG __STATEDIR__/test_big.bin
-set	TEMP_NS_BIG __STATEDIR__/test_ns_big.bin
-set	TEMP_SMALL __STATEDIR__/test_small.bin
-set	TEMP_NS_SMALL __STATEDIR__/test_ns_small.bin
-
-test	TCP/IPv4: host to ns: big transfer
-nsb	socat -u TCP4-LISTEN:10002,bind=127.0.0.1 OPEN:__TEMP_NS_BIG__,create,trunc
-host	socat -u OPEN:__BASEPATH__/big.bin TCP4:127.0.0.1:10002
-nsw
-check	cmp __BASEPATH__/big.bin __TEMP_NS_BIG__
-
-test	TCP/IPv4: ns to host (spliced): big transfer
-hostb	socat -u TCP4-LISTEN:10003,bind=127.0.0.1 OPEN:__TEMP_BIG__,create,trunc
-ns	socat -u OPEN:__BASEPATH__/big.bin TCP4:127.0.0.1:10003
-hostw
-check	cmp __BASEPATH__/big.bin __TEMP_BIG__
-
-test	TCP/IPv4: ns to host (via tap): big transfer
-hostb	socat -u TCP4-LISTEN:10003 OPEN:__TEMP_BIG__,create,trunc
-nsout	GW ip -j -4 route show|jq -rM '.[] | select(.dst == "default").gateway'
-ns	socat -u OPEN:__BASEPATH__/big.bin TCP4:__GW__:10003
-hostw
-check	cmp __BASEPATH__/big.bin __TEMP_BIG__
-
-test	TCP/IPv4: host to ns: small transfer
-nsb	socat -u TCP4-LISTEN:10002,bind=127.0.0.1 OPEN:__TEMP_NS_SMALL__,create,trunc
-host	socat OPEN:__BASEPATH__/small.bin TCP4:127.0.0.1:10002
-nsw
-check	cmp __BASEPATH__/small.bin __TEMP_NS_SMALL__
-
-test	TCP/IPv4: ns to host (spliced): small transfer
-hostb	socat -u TCP4-LISTEN:10003,bind=127.0.0.1 OPEN:__TEMP_SMALL__,create,trunc
-ns	socat OPEN:__BASEPATH__/small.bin TCP4:127.0.0.1:10003
-hostw
-check	cmp __BASEPATH__/small.bin __TEMP_SMALL__
-
-test	TCP/IPv4: ns to host (via tap): small transfer
-hostb	socat -u TCP4-LISTEN:10003 OPEN:__TEMP_SMALL__,create,trunc
-nsout	GW ip -j -4 route show|jq -rM '.[] | select(.dst == "default").gateway'
-ns	socat -u OPEN:__BASEPATH__/small.bin TCP4:__GW__:10003
-hostw
-check	cmp __BASEPATH__/small.bin __TEMP_SMALL__
-
-test	TCP/IPv6: host to ns: big transfer
-nsb	socat -u TCP6-LISTEN:10002,bind=[::1] OPEN:__TEMP_NS_BIG__,create,trunc
-host	socat -u OPEN:__BASEPATH__/big.bin TCP6:[::1]:10002
-nsw
-check	cmp __BASEPATH__/big.bin __TEMP_NS_BIG__
-
-test	TCP/IPv6: ns to host (spliced): big transfer
-hostb	socat -u TCP6-LISTEN:10003,bind=[::1] OPEN:__TEMP_BIG__,create,trunc
-ns	socat -u OPEN:__BASEPATH__/big.bin TCP6:[::1]:10003
-hostw
-check	cmp __BASEPATH__/big.bin __TEMP_BIG__
-
-test	TCP/IPv6: ns to host (via tap): big transfer
-hostb	socat -u TCP6-LISTEN:10003 OPEN:__TEMP_BIG__,create,trunc
-nsout	GW6 ip -j -6 route show|jq -rM '.[] | select(.dst == "default").gateway'
-nsout	IFNAME ip -j link show | jq -rM '.[] | select(.link_type == "ether").ifname'
-ns	socat -u OPEN:__BASEPATH__/big.bin TCP6:[__GW6__%__IFNAME__]:10003
-hostw
-check	cmp __BASEPATH__/big.bin __TEMP_BIG__
-
-test	TCP/IPv6: host to ns: small transfer
-nsb	socat -u TCP6-LISTEN:10002,bind=[::1] OPEN:__TEMP_NS_SMALL__,create,trunc
-host	socat -u OPEN:__BASEPATH__/small.bin TCP6:[::1]:10002
-nsw
-check	cmp __BASEPATH__/small.bin __TEMP_NS_SMALL__
-
-test	TCP/IPv6: ns to host (spliced): small transfer
-hostb	socat -u TCP6-LISTEN:10003,bind=[::1] OPEN:__TEMP_SMALL__,create,trunc
-ns	socat -u OPEN:__BASEPATH__/small.bin TCP6:[::1]:10003
-hostw
-check	cmp __BASEPATH__/small.bin __TEMP_SMALL__
-
-test	TCP/IPv6: ns to host (via tap): small transfer
-hostb	socat -u TCP6-LISTEN:10003 OPEN:__TEMP_SMALL__,create,trunc
-ns	socat -u OPEN:__BASEPATH__/small.bin TCP6:[__GW6__%__IFNAME__]:10003
-hostw
-check	cmp __BASEPATH__/small.bin __TEMP_SMALL__
diff --git a/test/pasta/udp b/test/pasta/udp
deleted file mode 100644
index 30e3a85..0000000
--- a/test/pasta/udp
+++ /dev/null
@@ -1,59 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-#
-# PASST - Plug A Simple Socket Transport
-#  for qemu/UNIX domain socket mode
-#
-# PASTA - Pack A Subtle Tap Abstraction
-#  for network namespace/tap device mode
-#
-# test/pasta/udp - Check UDP functionality for pasta
-#
-# Copyright (c) 2021 Red Hat GmbH
-# Author: Stefano Brivio <sbrivio@redhat.com>
-
-nstools	socat ip jq
-htools	dd socat ip jq
-
-set	TEMP __STATEDIR__/test.bin
-set	TEMP_NS __STATEDIR__/test_ns.bin
-
-test	UDP/IPv4: host to ns
-nsb	socat -u UDP4-LISTEN:10002,bind=127.0.0.1,null-eof OPEN:__TEMP_NS__,create,trunc
-host	socat OPEN:__BASEPATH__/medium.bin UDP4:127.0.0.1:10002,shut-null
-nsw
-check	cmp __BASEPATH__/medium.bin __TEMP_NS__
-
-test	UDP/IPv4: ns to host (recvmmsg/sendmmsg)
-hostb	socat -u UDP4-LISTEN:10003,bind=127.0.0.1,null-eof OPEN:__TEMP__,create,trunc
-sleep	1
-ns	socat OPEN:__BASEPATH__/medium.bin UDP4:127.0.0.1:10003,shut-null
-hostw
-check	cmp __BASEPATH__/medium.bin __TEMP__
-
-test	UDP/IPv4: ns to host (via tap)
-hostb	socat -u UDP4-LISTEN:10003,null-eof OPEN:__TEMP__,create,trunc
-nsout	GW ip -j -4 route show|jq -rM '.[] | select(.dst == "default").gateway'
-ns	socat -u OPEN:__BASEPATH__/medium.bin UDP4:__GW__:10003,shut-null
-hostw
-check	cmp __BASEPATH__/medium.bin __TEMP__
-
-test	UDP/IPv6: host to ns
-nsb	socat -u UDP6-LISTEN:10002,bind=[::1],null-eof OPEN:__TEMP_NS__,create,trunc
-host	socat -u OPEN:__BASEPATH__/medium.bin UDP6:[::1]:10002,shut-null
-nsw
-check	cmp __BASEPATH__/medium.bin __TEMP_NS__
-
-test	UDP/IPv6: ns to host (recvmmsg/sendmmsg)
-hostb	socat -u UDP6-LISTEN:10003,bind=[::1],null-eof OPEN:__TEMP__,create,trunc
-sleep	1
-ns	socat -u OPEN:__BASEPATH__/medium.bin UDP6:[::1]:10003,shut-null
-hostw
-check	cmp __BASEPATH__/medium.bin __TEMP__
-
-test	UDP/IPv6: ns to host (via tap)
-hostb	socat -u UDP6-LISTEN:10003,null-eof OPEN:__TEMP__,create,trunc
-nsout	GW6 ip -j -6 route show|jq -rM '.[] | select(.dst == "default").gateway'
-nsout	IFNAME ip -j link show | jq -rM '.[] | select(.link_type == "ether").ifname'
-ns	socat -u OPEN:__BASEPATH__/medium.bin UDP6:[__GW6__%__IFNAME__]:10003,shut-null
-hostw
-check	cmp __BASEPATH__/medium.bin __TEMP__
diff --git a/test/run b/test/run
index b800022..f4f5fc8 100755
--- a/test/run
+++ b/test/run
@@ -64,14 +64,6 @@ run() {
 	perf_init
 	[ ${CI} -eq 1 ]   && video_start ci
 
-	setup pasta
-	test pasta/ndp
-	test pasta/dhcp
-	test pasta/tcp
-	test pasta/udp
-	test passt/shutdown
-	teardown pasta
-
 	setup pasta_options
 	test pasta_options/log_to_file
 	teardown pasta_options
-- 
@@ -64,14 +64,6 @@ run() {
 	perf_init
 	[ ${CI} -eq 1 ]   && video_start ci
 
-	setup pasta
-	test pasta/ndp
-	test pasta/dhcp
-	test pasta/tcp
-	test pasta/udp
-	test passt/shutdown
-	teardown pasta
-
 	setup pasta_options
 	test pasta_options/log_to_file
 	teardown pasta_options
-- 
2.40.1


      parent reply	other threads:[~2023-05-16  2:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16  2:01 [PATCH v2 00/21] RFCv2: Proof-of-concept conversion of some tests to Avocado framework David Gibson
2023-05-16  2:01 ` [PATCH v2 01/21] test/nstool: Provide useful error if given a path that's too long David Gibson
2023-05-16  2:01 ` [PATCH v2 02/21] test/nstool: Fix fd leak in accept() loop David Gibson
2023-05-16  2:01 ` [PATCH v2 03/21] avocado: Make a duplicate copy of testsuite for comparison purposes David Gibson
2023-05-16  2:01 ` [PATCH v2 04/21] avocado: Don't double download assets for test/ and oldtest/ David Gibson
2023-05-16  2:01 ` [PATCH v2 05/21] avocado: Move static checkers to avocado David Gibson
2023-05-16  2:01 ` [PATCH v2 06/21] avocado/tasst: Helper functions for executing commands in different places David Gibson
2023-05-16  2:01 ` [PATCH v2 07/21] avocado: Convert build tests to avocado David Gibson
2023-05-16  2:01 ` [PATCH v2 08/21] avocado/tasst: Add helpers for running background commands on sites David Gibson
2023-05-16  2:01 ` [PATCH v2 09/21] avocado/tasst: Add helper to get network interface names for a site David Gibson
2023-05-16  2:01 ` [PATCH v2 10/21] avocado/tasst: Add helpers to run commands with nstool David Gibson
2023-05-16  2:01 ` [PATCH v2 11/21] avocado/tasst: Add ifup and network address helpers to Site David Gibson
2023-05-16  2:01 ` [PATCH v2 12/21] avocado/tasst: Helper for creating veth devices between namespaces David Gibson
2023-05-16  2:01 ` [PATCH v2 13/21] avocado/tasst: Add helper for getting MTU of a network interface David Gibson
2023-05-16  2:01 ` [PATCH v2 14/21] avocado/tasst: Add helper to wait for IP address to appear David Gibson
2023-05-16  2:01 ` [PATCH v2 15/21] avocado/tasst: Add helpers for getting a site's routes David Gibson
2023-05-16  2:01 ` [PATCH v2 16/21] avocado/tasst: Helpers for test transferring data between sites David Gibson
2023-05-16  2:01 ` [PATCH v2 17/21] avocado/tasst: IP address allocation helpers David Gibson
2023-05-16  2:01 ` [PATCH v2 18/21] avocado/tasst: Helpers for testing NDP behaviour David Gibson
2023-05-16  2:01 ` [PATCH v2 19/21] avocado/tasst: Helpers for testing DHCP & DHCPv6 behaviour David Gibson
2023-05-16  2:01 ` [PATCH v2 20/21] avocado/tasst: Helpers to construct a simple network environment for tests David Gibson
2023-05-16  2:01 ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230516020135.1901256-22-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=crosa@redhat.com \
    --cc=jarichte@redhat.com \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).