From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id F1FEF5A0299 for ; Tue, 16 May 2023 04:01:49 +0200 (CEST) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4QKzxd4wd8z4y1r; Tue, 16 May 2023 12:01:41 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1684202501; bh=4ycnYFCjYSHEHwZYdEAqt75Zk7C8xHkweFGgdSDidcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qCDSe7IhFIvc46Enh1oYOW1JM9HbrlxG+/gFgMWYX/4Y+vlH7A0HClso85EWLWVpX 3+vsR59N5EII6RL9h34fPx/PdeR9CuTLwaDJ5Mz96QDmaeunFyQzO9deq4mwRyqYoO XY/h47SGMcve1az/iUFIsc/uQVzRyuYE4uSuG4zw= From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v2 21/21] avocado: Convert basic pasta tests Date: Tue, 16 May 2023 12:01:35 +1000 Message-Id: <20230516020135.1901256-22-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230516020135.1901256-1-david@gibson.dropbear.id.au> References: <20230516020135.1901256-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: A7QZNVXAMGMWSNONUCW5FU7CWGWVUW2M X-Message-ID-Hash: A7QZNVXAMGMWSNONUCW5FU7CWGWVUW2M X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: jarichte@redhat.com, Cleber Rosa , David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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 + +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 -# 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 - -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 - -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 - -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 - -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 -- 2.40.1