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 7E50B5A026D for ; Wed, 31 May 2023 03:59:05 +0200 (CEST) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4QWC9S4VK4z4x5d; Wed, 31 May 2023 11:58:52 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1685498332; bh=oudTt2PO3l7jid1kIX9ZL6js0QGj3PNCAzJ4iikRBd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dy6N51HgIpn+PA2wUDEcqb5DVS9SuP+RosFH8gA8qKd8sBRDfbenb+McLGaR02s9S w01vxdAiXpKItzAPzmTM7V3tCEUKxoYy/TWVE7cYZ59ew5YFeyhoBOxuO/iEwvlPbx 4TugReuN8GThHyI5gTAxTICoqaME8YwhO3oU3ip4= From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v3 20/20] avocado: Convert basic pasta tests Date: Wed, 31 May 2023 11:58:49 +1000 Message-Id: <20230531015849.3229596-21-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230531015849.3229596-1-david@gibson.dropbear.id.au> References: <20230531015849.3229596-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: DYQZNX32XYZSRXNYWZH3QX5IHOSUG4IL X-Message-ID-Hash: DYQZNX32XYZSRXNYWZH3QX5IHOSUG4IL 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: Cleber Rosa , jarichte@redhat.com, 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 | 195 +++++++++++++++++++++++++++++++++++++++++++++++ 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, 204 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..39f71d4 --- /dev/null +++ b/avocado/pasta.py @@ -0,0 +1,195 @@ +#! /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 contextlib +import ipaddress +import os + +from tasst import Tasst +from tasst.address import LOOPBACK4, LOOPBACK6 +from tasst.dhcp import BaseDhcpTasst, DhcpTasstInfo +from tasst.dhcpv6 import BaseDhcpv6Tasst, Dhcpv6TasstInfo +from tasst.ndp import BaseNdpTasst, NdpTasstInfo +from tasst.nstool import UnshareSite +from tasst.scenario.simple import simple_net +from tasst.transfer import BaseTransferTasst, TcpUploadTasst, UdpTransferTasst, TransferTasstInfo +from tasst.typing import typecheck + + +PASTA_BIN = './pasta' + + +class BasePastaTasst(Tasst): + IN_FWD_PORT = 10002 + SPLICE_FWD_PORT = 10003 + + @contextlib.contextmanager + def setup_pasta(self, configure=False): + name = type(self).__name__ + with simple_net(name) as simnet: + with UnshareSite(name + '.guestns', '-Ucnpf --mount-proc', + parent=simnet.simhost, sudo=True) as simnet.guestns: + + relpid = simnet.guestns.relative_pid(simnet.simhost) + + pidfile = os.path.join(self.workdir, 'pasta.pid') + + extra = '' + if configure: + extra = '--config-net' + + pastacmd = ('{} -f -t {} -u {} -T {} -U {} -P {} {} {}' + .format(PASTA_BIN, self.IN_FWD_PORT, self.IN_FWD_PORT, + self.SPLICE_FWD_PORT, self.SPLICE_FWD_PORT, + pidfile, extra, relpid)) + + with simnet.simhost.bg(pastacmd) as pasta: + # 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 + pid = int(open(pidfile).read()) + + yield simnet + + simnet.simhost.fg('kill -TERM {}'.format(pid)) + rc = pasta.wait(timeout=1.0) + self.assertEquals(rc, 0) + + +class PastaTasst(BasePastaTasst): + def test_ifname(self): + with self.setup_pasta() as simnet: + self.assertCountEqual(simnet.guestns.ifs(), ('lo', simnet.ifname)) + + +class PastaNdpTasst(BasePastaTasst, BaseNdpTasst): + @contextlib.contextmanager + def setup_ndp(self): + with self.setup_pasta() as simnet: + simnet.guestns.ifup(simnet.ifname) + yield NdpTasstInfo(simnet.guestns, simnet.ifname, simnet.ip6.network, simnet.gw_ip6_ll.ip) + + +class PastaDhcpTasst(BasePastaTasst, BaseDhcpTasst): + @contextlib.contextmanager + def setup_dhcp(self): + with self.setup_pasta() as simnet: + yield DhcpTasstInfo(simnet.guestns, simnet.ifname, simnet.ip4.ip, simnet.gw_ip4.ip, 65520) + + +class PastaDhcpv6Tasst(BasePastaTasst, BaseDhcpv6Tasst): + @contextlib.contextmanager + def setup_dhcpv6(self): + with self.setup_pasta() as simnet: + yield Dhcpv6TasstInfo(simnet.guestns, simnet.ifname, simnet.ip6.ip) + + +class PastaConfigNetTasst(BasePastaTasst): + def test_addr(self): + with self.setup_pasta(configure=True) as simnet: + addrs = simnet.guestns.addrs(simnet.ifname, scope='global') + self.assertCountEqual(addrs, [simnet.ip4, simnet.ip6]) + + def test_route4(self): + with self.setup_pasta(configure=True) as simnet: + (defroute,) = simnet.guestns.routes4(dst='default') + gateway = ipaddress.ip_address(defroute['gateway']) + self.assertEquals(gateway, simnet.gw_ip4.ip) + + def test_route6(self): + with self.setup_pasta(configure=True) as simnet: + (defroute,) = simnet.guestns.routes6(dst='default') + gateway = ipaddress.ip_address(defroute['gateway']) + self.assertEquals(gateway, simnet.gw_ip6_ll.ip) + + def test_mtu(self): + with self.setup_pasta(configure=True) as simnet: + mtu = simnet.guestns.mtu(simnet.ifname) + self.assertEquals(mtu, 65520) + + +class PastaOutwardTransferTasst(BasePastaTasst, BaseTransferTasst): + """ + :avocado: disable + """ + + OUT_CONNECT_PORT = 10000 + + @contextlib.contextmanager + def setup_transfer(self): + with self.setup_pasta(configure=True) as simnet: + yield TransferTasstInfo(self.DATAFILE, simnet.guestns, simnet.gw, + simnet.remote_ip4.ip, simnet.remote_ip6.ip, + self.OUT_CONNECT_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(BasePastaTasst, BaseTransferTasst): + """ + :avocado: disable + """ + + @contextlib.contextmanager + def setup_transfer(self): + with self.setup_pasta(configure=True) as simnet: + yield TransferTasstInfo(self.DATAFILE, simnet.gw, simnet.guestns, + simnet.ip4.ip, simnet.ip6.ip, self.IN_FWD_PORT, + from_ip4=simnet.remote_ip4.ip, from_ip6=simnet.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(BasePastaTasst, BaseTransferTasst): + """ + :avocado: disable + """ + + @contextlib.contextmanager + def setup_transfer(self): + with self.setup_pasta(configure=True) as simnet: + yield TransferTasstInfo(self.DATAFILE, simnet.guestns, simnet.simhost, + LOOPBACK4, LOOPBACK6, self.SPLICE_FWD_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