diff --git a/Makefile b/Makefile index 90a32c4..ed69ad0 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -LINUXCONFIG ?= linux.config +# LINUXCONFIG ?= linux.config # LINUXCONFIG ?= linux-cov.config -# LINUXCONFIG ?= linux-fast.config +LINUXCONFIG ?= linux-fast.config # LINUXCONFIG ?= linux-fasttrace.config # LINUXCONFIG ?= linux-nosmp.config @@ -8,7 +8,7 @@ ifdef SHALLOW_CLONE DEPTH ?= --depth 1 endif -all: kernel rootfs +all: kernel rootfs iperf setup: ([ -d buildroot ] || [ -h buildroot ]) || git clone $(DEPTH) git://git.buildroot.net/buildroot buildroot -b 2023.05 @@ -55,16 +55,31 @@ output-linux/.config: $(LINUXCONFIG) output-buildroot/.config: buildroot.config cp -p $< $@ -output-buildroot: +output-buildroot output-iperf3 output-linux: mkdir -p $@ -output-linux: - mkdir -p $@ +# local iperf + +iperf: iperf3 output-iperf3/src/iperf3 + +iperf3: + ([ -d iperf ] || [ -h iperf ]) || git clone $(DEPTH) https://github.com/LabNConsulting/iperf.git iperf3 -b imix + (cd iperf3 && git pull --rebase) + +iperf3/configure: iperf3/configure.ac + (cd iperf3 && ./bootstrap.sh) + +output-iperf3/Makefile: iperf3/configure + mkdir -p output-iperf3 + (cd output-iperf3 && ../iperf3/configure --enable-static-bin) + +output-iperf3/src/iperf3: output-iperf3/Makefile + (cd output-iperf3 && make -j$(nproc)) # # Testing # -tests/ci: +tests/ci: iperf sudo -E pytest -s tests/config tests/errors tests/frags tests/simplenet tests/utpkt/test_utpkt.py tests-trex/external_libs: @@ -73,7 +88,7 @@ tests-trex/external_libs: clean-trex: rm -rf tests-trex/podman-trex-extract tests-trex/trex tests-trex/trex_stl_lib tests-trex/external_libs -test: tests-trex/external_libs +test: iperf tests-trex/external_libs sudo -E pytest -s tests sudo -E pytest -s tests-trex @@ -92,30 +107,37 @@ ci-extract-cov: # PERFSLAB := tests.stress.test_stress_phy #PERFFILE := ./res-latest/$(PERFSLAB)/r1/perf-0.data -PERFTEST := tests/iperf/test_iperf_phy.py::test_iperf[False-False-False-88-] -PERFSLAB := tests.iperf.test_iperf_phy -PERFFILE := /tmp/unet-test/$(PERFSLAB)/r1/perf-0.data +# PERFTEST := tests/iperf/test_iperf_phy.py::test_iperf[False-False-False-88-] +# PERFSLAB := tests.iperf.test_iperf_phy + +PERFTEST := tests/iperf/test_iperf_phy.py::test_iperf[False-False-False-None-] + +PERFSLAB := $(subst /,.,$(shell SLAB=$(PERFTEST); echo $${SLAB%.py*})) + +PERFPFX := /tmp/unet-test/$(PERFSLAB) +PERFFILES := $(PERFPFX)/r1/perf-0.data $(PERFPFX)/r2/perf-0.data + +PERFBIN := ../output-buildroot/target/usr/bin/perf flame-clean: - sudo rm -f /tmp/out.perf-folded flame.svg $(PERFFILE) + sudo rm -f $(PERFPFX)/perf-*.data $(PERFPFX)/perf-*.fdata flame-r1.svg flame-r2.svg $(PERFFILES) -flame: flame.svg +flame: iperf flame-r1.svg flame-r2.svg scp flame.svg ja: -$(PERFFILE): +$(PERFFILES): sudo -E pytest -s -v '$(PERFTEST)' --enable-physical --profile || true -PERF := ../output-buildroot/target/usr/bin/perf - FlameGraph: git clone https://github.com/brendangregg/FlameGraph -/tmp/out.perf: FlameGraph $(PERFFILE) - (cd FlameGraph && $(PERF) script --vmlinux ../output-linux/vmlinux -i $< > /tmp/out.perf) +$(PERFPFX)/perf-%.data: $(PERFPFX)/%/perf-0.data + sudo chown $(USER) $(PERFPFX) + (cd FlameGraph && $(PERFBIN) script --vmlinux ../output-linux/vmlinux -i $< > $@) -/tmp/out.perf-folded: FlameGraph /tmp/out.perf - (cd FlameGraph && cat /tmp/out.perf | ./stackcollapse-perf.pl > /tmp/out.perf-folded) +$(PERFPFX)/perf-%.fdata: $(PERFPFX)/perf-%.data + sudo chown $(USER) $(PERFPFX) + (cd FlameGraph && ./stackcollapse-perf.pl $< > $@) -flame.svg: FlameGraph /tmp/out.perf-folded +flame-%.svg: $(PERFPFX)/perf-%.fdata (cd FlameGraph && ./flamegraph.pl --height=16 --fontsize=6 $< > ../$@) - diff --git a/scripts/feat2str.py b/scripts/feat2str.py old mode 100644 new mode 100755 diff --git a/tests/iperf/iperf.py b/tests/iperf/iperf.py index 19b46f3..fbe92be 100644 --- a/tests/iperf/iperf.py +++ b/tests/iperf/iperf.py @@ -20,20 +20,24 @@ # "Test iptfs tunnel using iperf with various configurations" import logging +import os import re import subprocess import time from pathlib import Path import pytest -from common.config import setup_policy_tun, setup_routed_tun +from common.config import cleanup_config, setup_policy_tun, setup_routed_tun +from common.tests import _test_net_up from common.util import start_profile, stop_profile from munet.base import cmd_error -from munet.testing.util import async_pause_test -from munet.watchlog import MatchFoundError skip_future = [] +iperf3 = Path(os.path.realpath(__file__)).parent.parent.parent / Path( + "output-iperf3/src/iperf3" +) + def std_result(o, e): o = "\n\tstdout: " + o.strip() if o and o.strip() else "" @@ -45,13 +49,13 @@ def convnum(val, letter): val = float(val) if not letter: return val - if letter == "K" or letter == "k": + if letter in ("K", "k"): val *= 1000 - elif letter == "M" or letter == "m": + if letter in ("M", "m"): val *= 1000000 - elif letter == "G" or letter == "k": + if letter in ("G", "g"): val *= 1000000000 - elif letter == "T" or letter == "t": + if letter in ("T", "t"): val *= 1000000000000 return val @@ -90,8 +94,35 @@ async def _test_iperf( ): h1 = unet.hosts["h1"] h2 = unet.hosts["h2"] + r1 = unet.hosts["r1"] r2 = unet.hosts["r2"] + if not iperf3.exists(): + pytest.skip( + "skipping test as local iperf3 not build -- run `make iperf` in the build environment" + ) + + if not unet.ipv6_enable and tun_ipv6: + pytest.skip("skipping ipv6 as --enable-ipv6 not specified") + + if tun_ipv6 and pktsize and pktsize < 536: + pytest.skip("Can't run IPv6 iperf with MSS < 536") + return + + r1.cmd_nostatus( + f"echo test start: routed={routed} v6tun={tun_ipv6} v6={ipv6} pktsize={pktsize} opts={iptfs_opts} > /dev/kmsg" + ) + r2.cmd_nostatus( + f"echo test start: routed={routed} v6tun={tun_ipv6} v6={ipv6} pktsize={pktsize} opts={iptfs_opts} > /dev/kmsg" + ) + + await cleanup_config(unet, ipv4=True, ipv6=True) + await _test_net_up(unet, ipv6=True, multihop=False) + check_logs(unet) + + if tun_ipv6 and pktsize and pktsize == 1442: + pktsize = 1428 + if routed: await setup_routed_tun( unet, @@ -121,8 +152,10 @@ async def _test_iperf( # pktsize = "536" # pktsize = None + print(iperf3) + logging.info("Starting iperf server on h2") - sargs = ["iperf3" if use_iperf3 else "iperf", "-s"] + sargs = [iperf3 if use_iperf3 else "iperf", "-s"] if not use_iperf3: if use_udp: sargs.append("-u") @@ -144,7 +177,7 @@ async def _test_iperf( evpath = trpath / "events/iptfs" tronpath = trpath / "tracing_on" if tracing: - afpath = trpath / "available_filter_functions" + # afpath = trpath / "available_filter_functions" evp = evpath / "enable" for rname in ["r1", "r2"]: @@ -192,13 +225,13 @@ async def _test_iperf( if use_iperf3: args = [ - "iperf3", + iperf3, # "--verbose", # "--get-server-output", # "--port=5201", # "--json", - "-P", - "8", + # "-P", + # "8", "-t", str(tval), # timeval # "-n", @@ -230,7 +263,8 @@ async def _test_iperf( ] # Start profiling if enabled - perfc = start_profile(unet, "r1", tval + 1) if profile else None + perfc1 = start_profile(unet, "r1", tval + 1) if profile else None + perfc2 = start_profile(unet, "r2", tval + 1) if profile else None logging.info("Starting iperf client on h1 for %s", tval) # logging.info("Starting iperf3 client on h1 at %s for %s", brate, tval) @@ -273,7 +307,7 @@ async def _test_iperf( # await async_pause_test(f"{'' if timeout else 'no '} timeout") - assert not timeout, f"client TIMEOUT" + assert not timeout, "client TIMEOUT" assert not rc, f"client FAILED: {cmd_error(rc, o, e)}" # @@ -333,15 +367,15 @@ async def _test_iperf( f"head {leakpath}" ).strip(), f"leaks found on {rname}" - if perfc: - stop_profile(perfc, filebase=f"perf-{profcount}.data") - perfc = None # result = json.loads(o) # logging.info("Results: %s", json.dumps(result, sort_keys=True, indent=2)) finally: - if perfc: - stop_profile(perfc, filebase=f"perf-{profcount}.data") - perfc = None + if perfc1: + stop_profile(perfc1, filebase=f"perf-{profcount}.data") + perfc1 = None + if perfc2: + stop_profile(perfc2, filebase=f"perf-{profcount}.data") + perfc2 = None if tracing: # disable tracing for rname in ["r1", "r2"]: diff --git a/tests/iperf/munet_phy.yaml b/tests/iperf/munet_phy.yaml index e9658f1..caddbf0 100644 --- a/tests/iperf/munet_phy.yaml +++ b/tests/iperf/munet_phy.yaml @@ -18,7 +18,7 @@ topology: mtu: 9000 # mtu: 1400 - name: r1 - kind: linux + kind: linux2 connections: - to: mgmt0 - to: r2 @@ -33,7 +33,7 @@ topology: mtu: 9000 # mtu: 1400 - name: r2 - kind: linux + kind: linux2 connections: - to: mgmt0 - to: r1 @@ -69,11 +69,11 @@ kinds: sshkey: "%CONFIGDIR%/../../root-key" #cmdline-extra: "acpi=off nokaslr idle=poll" # cmdline-extra: "nokaslr slub_debug=U,kmalloc-256,kmalloc-128" - # cmdline-extra: "nokaslr idle=poll" - cmdline-extra: "nokaslr" + cmdline-extra: "nokaslr idle=poll" + # cmdline-extra: "nokaslr" # memory: "8192M" memory: "16384M" kvm: true - ncpu: 3 + ncpu: 2 console: timeout: 180 diff --git a/tests/iperf/test_iperf.py b/tests/iperf/test_iperf.py index 0b5c303..989f64d 100644 --- a/tests/iperf/test_iperf.py +++ b/tests/iperf/test_iperf.py @@ -22,9 +22,8 @@ import os import pytest -from common.config import _network_up, cleanup_config -from common.tests import _test_net_up -from iperf import _test_iperf, check_logs, skip_future +from common.config import _network_up +from iperf import _test_iperf, skip_future from munet.testing.fixtures import _unet_impl # All tests are coroutines @@ -32,48 +31,6 @@ SRCDIR = os.path.dirname(os.path.abspath(__file__)) -MODE = "iptfs" - - -# When leaks happen there are 2 leaks pared up: -# -# unreferenced object 0xffff888104f41000 (size 256): -# comm "softirq", pid 0, jiffies 4294675993 (age 679.156s) -# hex dump (first 32 bytes): -# 00 00 00 00 00 00 00 00 60 3a 00 00 00 c9 ff ff ........`:...... -# 00 a0 d2 03 81 88 ff ff 00 00 00 00 00 00 00 00 ................ -# backtrace: -# [<00000000870c9727>] kmem_cache_alloc+0x164/0x290 -# [<00000000e6f3186a>] build_skb+0x29/0xe0 -# [<00000000021a22e7>] page_to_skb+0xa1/0x5c0 -# [<00000000cd01171f>] receive_buf+0x596/0x1a90 -# [<000000008ec2992e>] virtnet_poll+0x211/0x590 -# [<000000001e9d3881>] __napi_poll+0x2e/0x1d0 -# [<00000000d7e4cf66>] net_rx_action+0x289/0x300 -# [<00000000a90cd6f6>] __do_softirq+0xc5/0x299 -# unreferenced object 0xffff88810556c900 (size 128): -# comm "softirq", pid 0, jiffies 4294675993 (age 679.156s) -# hex dump (first 32 bytes): -# 01 00 00 00 01 0b 00 00 01 00 00 00 00 00 00 00 ................ -# 00 c0 55 05 81 88 ff ff 00 00 00 00 00 00 00 00 ..U............. -# backtrace: -# [<00000000870c9727>] kmem_cache_alloc+0x164/0x290 -# [<00000000a5bec97c>] skb_ext_add+0x109/0x1e0 -# [<00000000afcd5e7b>] secpath_set+0x6c/0x80 -# [<000000005ff45f44>] xfrm_input+0x233/0x1380 -# [<00000000266d293c>] xfrmi4_rcv+0x6a/0xa0 -# [<00000000a28f221f>] xfrm4_esp_rcv+0x2f/0x80 -# [<00000000439022c5>] ip_protocol_deliver_rcu+0x175/0x180 -# [<000000002c5b0086>] ip_local_deliver_finish+0x8a/0xb0 -# [<00000000f762997e>] ip_local_deliver+0x73/0x120 -# [<000000002b7ac9a3>] ip_sublist_rcv_finish+0x6b/0x80 -# [<00000000bd4e9dbb>] ip_sublist_rcv+0x116/0x1b0 -# [<00000000bc684f7f>] ip_list_rcv+0xfd/0x130 -# [<00000000884dbce6>] __netif_receive_skb_list_core+0x218/0x240 -# [<00000000ce3b3b77>] netif_receive_skb_list_internal+0x18f/0x2b0 -# [<0000000086d9c1fa>] napi_complete_done+0x7e/0x1c0 -# [<00000000780ac000>] virtnet_poll+0x408/0x590 - @pytest.fixture(scope="module", name="unet") async def _unet(rundir_module, pytestconfig): @@ -83,21 +40,6 @@ async def _unet(rundir_module, pytestconfig): x.hosts["r2"].add_watch_log("qemu.out") yield x - # try: - # print("XXX adding watch task") - # task = unet.hosts["r1"].add_watch_log("qemu.out", "(Kernel panic|BUG:|Oops:) ") - # tasks.append(task) - # print("XXX adding watch task") - # task = unet.hosts["r2"].add_watch_log("qemu.out", "(Kernel panic|BUG:|Oops:) ") - # tasks.append(task) - - # print("XXX yielding") - # yield - # print("XXX back from yield") - # finally: - # for task in tasks: - # task.cancel() - # 192.168.0.0/24 fd00::/64 # --+-------------------+------ mgmt0 ------+-------------------+--- @@ -108,66 +50,27 @@ async def _unet(rundir_module, pytestconfig): # 10.0.0.0/24 10.0.1.0/24 10.0.2.0/24 -# async def test_net_up(unet): -# await _test_net_up(unet, ipv6=True) -# check_logs(unet) - - -# @pytest.mark.parametrize("pktsize", [None, 64, 536, 1442]) - -# Leaks only with no dont-frag -# IPv4 tunnel with IPv4 inner, Fails start at 1403 -- 1442 - 1402 == 40 works 1403 == 39 doesn't -# @pytest.mark.parametrize("pktsize", [1400, 1401, 1402, 1403, 1404, 1405]) -# IPv6 tunnel with IPv4 inner or vice versa, fails start at 1383 -# @pytest.mark.parametrize("pktsize", [1380, 1381, 1382, 1383, 1384, 1385, 1386]) -# IPv6 Tunnel with IPv6 inner fails start at 1363 -# @pytest.mark.parametrize("pktsize", [1360, 1361, 1362, 1363, 1364, 1365]) -# [ 4.504257] INGRESS: LINEARIZE skb->len=2956 skb->data_len=2916 skb->nr_frags=1 skb->frag_list=0000000000000000 -# pktsize == 2916 works, 2917+ doesn't - - -# @pytest.mark.parametrize("iptfs_opts", ["init-delay 500"], scope="function") -# @pytest.mark.parametrize("pktsize", [None, 88, 536, 8000]) -# @pytest.mark.parametrize("ipv6", [False, True]) -# @pytest.mark.parametrize("tun_ipv6", [False, True]) -# @pytest.mark.parametrize("routed", [False, True]) - -# @pytest.mark.parametrize( -# "iptfs_opts", ["pkt-size 256 max-queue-size 100000"], scope="function" -# ) - - -@pytest.mark.parametrize("iptfs_opts", [""], scope="function") -@pytest.mark.parametrize("pktsize", [None, 88, 536, 1442]) -@pytest.mark.parametrize("ipv6", [False, True]) -@pytest.mark.parametrize("tun_ipv6", [False, True]) -@pytest.mark.parametrize("routed", [False, True]) +@pytest.mark.parametrize("mode", ["iptfs", "tunnel"]) +@pytest.mark.parametrize("iptfs_opts", [None]) +@pytest.mark.parametrize("pktsize", [None, 88, 256, 536, 1442]) +@pytest.mark.parametrize("inner", ["ipv4", "ipv6"]) +@pytest.mark.parametrize("encap", ["encap4", "encap6"]) +@pytest.mark.parametrize("routed", ["policy", "routed"]) async def test_iperf( - unet, astepf, pytestconfig, iptfs_opts, pktsize, ipv6, routed, tun_ipv6 + unet, astepf, pytestconfig, mode, iptfs_opts, pktsize, inner, encap, routed ): - if skip_future: - pytest.skip("Skipping test due to earlier failure") - unet.hosts["r1"].cmd_nostatus( - f"echo test start: routed={routed} v6tun={tun_ipv6} v6={ipv6} pktsize={pktsize} opts={iptfs_opts} > /dev/kmsg" - ) - unet.hosts["r2"].cmd_nostatus( - f"echo test start: routed={routed} v6tun={tun_ipv6} v6={ipv6} pktsize={pktsize} opts={iptfs_opts} > /dev/kmsg" - ) - - await cleanup_config(unet, ipv4=True, ipv6=True) - await _test_net_up(unet, ipv6=True, multihop=False) - check_logs(unet) - - if not unet.ipv6_enable and tun_ipv6: - pytest.skip("skipping ipv6 as --enable-ipv6 not specified") + if iptfs_opts is None: + iptfs_opts = "" + ipv6 = inner == "ipv6" + tun_ipv6 = encap == "encap6" + routed = routed == "routed" - if tun_ipv6 and pktsize and pktsize < 536: - pytest.skip("Can't run IPv6 iperf with MSS < 536") - return + if skip_future: + pytest.skip("Skipping test due to earlier failure") - if tun_ipv6 and pktsize and pktsize == 1442: - pktsize = 1428 + if mode == "tunnel" and ((not ipv6) != (not tun_ipv6)): + pytest.skip("Skipping std ipsec test with mixed modes") test_iperf.count += 1 @@ -178,7 +81,7 @@ async def test_iperf( result = await _test_iperf( unet, astepf, - mode=MODE, + mode=mode, ipsec_intf="eth2", use_iperf3=use_iperf3, iptfs_opts=iptfs_opts, diff --git a/tests/iperf/test_iperf_phy.py b/tests/iperf/test_iperf_phy.py index af9305b..900016f 100644 --- a/tests/iperf/test_iperf_phy.py +++ b/tests/iperf/test_iperf_phy.py @@ -22,9 +22,8 @@ import os import pytest -from common.config import _network_up, setup_policy_tun -from common.tests import _test_net_up -from iperf import _test_iperf, check_logs, skip_future +from common.config import _network_up +from iperf import _test_iperf, skip_future from munet.testing.fixtures import _unet_impl # All tests are coroutines @@ -42,21 +41,15 @@ async def checkrun(pytestconfig): ) -@pytest.fixture(scope="module", name="lcl_unet") +@pytest.fixture(scope="module", name="unet") async def _unet(rundir_module, pytestconfig): async for x in _unet_impl(rundir_module, pytestconfig, param="munet_phy"): + await _network_up(x, ipv6=x.ipv6_enable) + x.hosts["r1"].add_watch_log("qemu.out") + x.hosts["r2"].add_watch_log("qemu.out") yield x -@pytest.fixture(scope="module", autouse=True) -async def network_up(lcl_unet): - unet = lcl_unet - await _network_up(unet, ipv6=unet.ipv6_enable) - unet.hosts["r1"].add_watch_log("qemu.out") - unet.hosts["r2"].add_watch_log("qemu.out") - yield - - # 192.168.0.0/24 fd00::/64 # --+-------------------+------ mgmt0 ------+-------------------+--- # | .1 | .2 | .3 | .4 @@ -66,43 +59,6 @@ async def network_up(lcl_unet): # 10.0.0.0/24 10.0.1.0/24 10.0.2.0/24 # fc00::/64 fc00:0:0:1::/64 fc00:0:0:2::/64 - -async def test_net_up(lcl_unet): - unet = lcl_unet - await _test_net_up(unet, ipv6=unet.ipv6_enable) - check_logs(unet) - - -MODE = "iptfs" - - -async def test_tun_up(lcl_unet, astepf): - unet = lcl_unet - # iptfs_opts = "dont-frag" - await setup_policy_tun( - unet, - mode=MODE, - ipsec_intf="eth1", - iptfs_opts="", - ipv6=unet.ipv6_enable, - ) - - # h1 = unet.hosts["h1"] - # r1 = unet.hosts["r1"] - - # await astepf("Before R2R ping") - # # r1 (qemu side) pings r2 (qemu side) - # r1.conrepl.cmd_nostatus("ping -w1 -i.2 -c1 10.0.1.3") - # r1.conrepl.cmd_raises("ping -w1 -i.2 -c1 10.0.1.3") - - # await astepf("Before H2H ping") - # # h1 pings h2 - # h1.cmd_nostatus("ping -w1 -i.2 -c1 10.0.2.4") - # h1.cmd_raises("ping -w1 -i.2 -c1 10.0.2.4") - - check_logs(unet) - - # overrun the queue setup # @pytest.mark.parametrize( # "iptfs_opts", ["pkt-size 256 max-queue-size 100000"], scope="function" @@ -121,27 +77,29 @@ async def test_tun_up(lcl_unet, astepf): # @pytest.mark.parametrize("tun_ipv6", [False, True], scope="function") # @pytest.mark.parametrize("routed", [False, True], scope="function") - # @pytest.mark.parametrize("iptfs_opts", ["init-delay 1000"], scope="function") -@pytest.mark.parametrize("iptfs_opts", [""], scope="function") -@pytest.mark.parametrize("pktsize", [None, 88, 536, 1442], scope="function") -@pytest.mark.parametrize("ipv6", [False, True], scope="function") -@pytest.mark.parametrize("tun_ipv6", [False, True], scope="function") -@pytest.mark.parametrize("routed", [False, True], scope="function") +@pytest.mark.parametrize("mode", ["iptfs", "tunnel"]) +@pytest.mark.parametrize("iptfs_opts", [None]) +@pytest.mark.parametrize("pktsize", [None, 88, 256, 536, 1442]) +@pytest.mark.parametrize("inner", ["ipv4", "ipv6"]) +@pytest.mark.parametrize("encap", ["encap4", "encap6"]) +@pytest.mark.parametrize("routed", ["policy", "routed"]) async def test_iperf( - lcl_unet, rundir, astepf, pytestconfig, iptfs_opts, pktsize, ipv6, routed, tun_ipv6 + unet, astepf, pytestconfig, mode, iptfs_opts, pktsize, inner, encap, routed ): - unet = lcl_unet + if iptfs_opts is None: + iptfs_opts = "" + ipv6 = inner == "ipv6" + tun_ipv6 = encap == "encap6" + routed = routed == "routed" + if skip_future: pytest.skip("Skipping test due to earlier failure") - if not unet.ipv6_enable and tun_ipv6: - pytest.skip("skipping ipv6 as --enable-ipv6 not specified") - if ipv6 and pktsize and pktsize < 536: - pytest.skip("Can't run IPv6 iperf with MSS < 536") - return + if mode == "tunnel" and ((not ipv6) != (not tun_ipv6)): + pytest.skip("Skipping std ipsec test with mixed modes") test_iperf.count += 1 @@ -149,13 +107,10 @@ async def test_iperf( if use_iperf3 and pktsize and pktsize < 88: pktsize = 88 - # Leak cases tun_ipv6 = True | False, ipv6 = True - # Non-Leak cases tun_ipv6 = True | False, ipv6 = False - result = await _test_iperf( unet, astepf, - mode=MODE, + mode=mode, ipsec_intf="eth1", use_iperf3=use_iperf3, iptfs_opts=iptfs_opts, @@ -170,6 +125,7 @@ async def test_iperf( ) assert result, "No result from test!" + rundir = str(unet.rundir) fname = rundir[: rundir.rindex("/")] + "/speed-phy.csv" fmode = "w+" if test_iperf.count == 0 else "a+" tunstr = "routed" if routed else "policy" diff --git a/tests/kinds.yaml b/tests/kinds.yaml index e4bb1a4..3998dfd 100644 --- a/tests/kinds.yaml +++ b/tests/kinds.yaml @@ -13,12 +13,72 @@ kinds: #cmdline-extra: "idle=poll nokaslr trace_buf_size=1024M" cmdline-extra: "idle=poll nokaslr" #memory: "2048" - memory: "8192" + memory: "2048" + kvm: true + ncpu: 1 + console: + timeout: 180 + + - name: linux1 + merge: [ "qemu" ] + gdb-cmd: "/usr/bin/sudo -E gdb %CONFIGDIR%/../../output-linux/vmlinux" + gdb-target-cmds: ["target remote %RUNDIR%/s/gdbserver"] + gdb-run-cmds: ["c"] + gdb-run-cmd: ["c"] + qemu: + kernel: "%CONFIGDIR%/../../output-linux/arch/x86/boot/bzImage" + initrd: "%CONFIGDIR%/../../output-buildroot/images/rootfs.cpio.gz" + sshkey: "%CONFIGDIR%/../../root-key" + #cmdline-extra: "acpi=off idle=poll nokaslr" + #cmdline-extra: "idle=poll nokaslr trace_buf_size=1024M" + cmdline-extra: "idle=poll nokaslr" + #memory: "2048" + memory: "2048" + kvm: true + ncpu: 1 + console: + timeout: 180 + + - name: linux2 + merge: [ "qemu" ] + gdb-cmd: "/usr/bin/sudo -E gdb %CONFIGDIR%/../../output-linux/vmlinux" + gdb-target-cmds: ["target remote %RUNDIR%/s/gdbserver"] + gdb-run-cmds: ["c"] + gdb-run-cmd: ["c"] + qemu: + kernel: "%CONFIGDIR%/../../output-linux/arch/x86/boot/bzImage" + initrd: "%CONFIGDIR%/../../output-buildroot/images/rootfs.cpio.gz" + sshkey: "%CONFIGDIR%/../../root-key" + #cmdline-extra: "acpi=off idle=poll nokaslr" + #cmdline-extra: "idle=poll nokaslr trace_buf_size=1024M" + cmdline-extra: "idle=poll nokaslr" + #memory: "2048" + memory: "4096" kvm: true ncpu: 2 console: timeout: 180 + - name: linux3 + merge: [ "qemu" ] + gdb-cmd: "/usr/bin/sudo -E gdb %CONFIGDIR%/../../output-linux/vmlinux" + gdb-target-cmds: ["target remote %RUNDIR%/s/gdbserver"] + gdb-run-cmds: ["c"] + gdb-run-cmd: ["c"] + qemu: + kernel: "%CONFIGDIR%/../../output-linux/arch/x86/boot/bzImage" + initrd: "%CONFIGDIR%/../../output-buildroot/images/rootfs.cpio.gz" + sshkey: "%CONFIGDIR%/../../root-key" + #cmdline-extra: "acpi=off idle=poll nokaslr" + #cmdline-extra: "idle=poll nokaslr trace_buf_size=1024M" + cmdline-extra: "idle=poll nokaslr" + #memory: "2048" + memory: "6144" + kvm: true + ncpu: 3 + console: + timeout: 180 + - name: trex_phy privileged: true # image: quay.io/chopps/trex:v3.03