From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=N2DEbST0; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 231FE5A026F for ; Tue, 07 Oct 2025 22:01:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1759867260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4+trZh3mt9R97yOzhyYSrTQEdnxrR7xBavwre0OqiPA=; b=N2DEbST0NXkzXHZlpT87j5S5uKZO0wOj0Cs3vyOGbjxnkMP3+u50cjxrR+g4vmufI1sM3y Wq3zU5PDKyaPri+VlpMmB096KQUR+e1qjTyNo4gU14c/fzNcjcT4K760xYdKb2kGigOdsb bfrsjJI5WRysEj8K0sVXNmdkPVqopbI= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-288-Y1ET2haqO7ChmIX23BaJ-A-1; Tue, 07 Oct 2025 16:00:58 -0400 X-MC-Unique: Y1ET2haqO7ChmIX23BaJ-A-1 X-Mimecast-MFC-AGG-ID: Y1ET2haqO7ChmIX23BaJ-A_1759867257 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3ed9557f976so4413015f8f.3 for ; Tue, 07 Oct 2025 13:00:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759867256; x=1760472056; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4+trZh3mt9R97yOzhyYSrTQEdnxrR7xBavwre0OqiPA=; b=HgvsIp9bxm4biqWHkDZ0O+uN/bb5JDjCOwT9OPfrKl2F3Q4qQILLn6SZLNk1mTDPgr HpFG0nNf94irczPg3tayYX75+dADmH3yWJFinm1iGOgScwa1gmtEqaMOTfsM2TCTodf9 4q+wT4odWr8RCifVyuI7NJR2jNOX4L3qwxZIO/2NG6pOxQijnjl6SehP1aj6Hxcw+Pdw m3RhGB1rEjFzuP2iyh8W7hCTAputveDiMeQTSiZFZWJMC64//hDrTUuB9D43MWjVmA82 5O7SLWEsNTq25dI1ZeuXjyj+kFJzXfS0mCxEfl1dONDuWhx6j+Yc54ZDXctnflKDTxPi ZfOw== X-Gm-Message-State: AOJu0Ywfx+sAa3EBgksWjiGdVt0yDO1Qu+PqASFlbUk56qjIZnpHyE12 4tDcjy9UGxx9eZTYwhzZ9DopxxACfNQtG18JRN7Pi7/XcrDe2wLcLU7uumUqcjKzurXldW6ozJf QTgNZ6OZ61noEXEpOUETm0bXtEIfUAy8BooIFkDNWBVbcBMT472wMgZX5yoxQ/A== X-Gm-Gg: ASbGncs7eeH0t/ViUkonzblq4+LGYqi+yGyYENBJKO+RovkP9HaGpQzRxCU3BxLMbSR YncsvSTBaypRAN5o98P0HoIVRdBlF9KoWij3JKGNUruC+J7NCi6Wq7Jr9nT0lbWCvjBSmR4mR0p gmsOHCDPVzy5UhG1T6gLWIRSuzOSHFN8L728xzGu5KYIpJqkLgc/YCwpJh8Bow67gMg0Itb09x9 6CFf6oWa22BVtx1XztqZDX2SZwQBiCgqEbxOCX24WLi7sWYv3YUcRLX4Aya4DUVe7H7lQ4PGU46 62kjcbcnxuPrXhm0VEC/23oYtsW/nO4MafkNuc99GJFP2rspvrTW5pfZCqX3CYAHd2yaJLf5hA= = X-Received: by 2002:a05:6000:2209:b0:3e9:a1cb:ea93 with SMTP id ffacd0b85a97d-4266726c546mr358045f8f.21.1759867256131; Tue, 07 Oct 2025 13:00:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGGVvhaxtgQnu36KU7wavyOfO8t4J8xgMjPbAhU4JlJt7FrGy/rysKU8RfKVPKYnr9wMU+CQ== X-Received: by 2002:a05:6000:2209:b0:3e9:a1cb:ea93 with SMTP id ffacd0b85a97d-4266726c546mr358025f8f.21.1759867255599; Tue, 07 Oct 2025 13:00:55 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46fa3e29047sm21722225e9.6.2025.10.07.13.00.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Oct 2025 13:00:55 -0700 (PDT) Date: Tue, 7 Oct 2025 22:00:51 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 1/3] test: Prepare for tunbridge based tests Message-ID: <20251007220051.03a138d7@elisabeth> In-Reply-To: <20251002075708.461931-2-david@gibson.dropbear.id.au> References: <20251002075708.461931-1-david@gibson.dropbear.id.au> <20251002075708.461931-2-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: liotIiwcj3DhX8KeUZqaUQ-D1d1o6zZnIsyWzCBtv-0_1759867257 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: VUVKQBPOP4ZOXUC7EUATPY4CYMHPZCN5 X-Message-ID-Hash: VUVKQBPOP4ZOXUC7EUATPY4CYMHPZCN5 X-MailFrom: sbrivio@redhat.com 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: passt-dev@passt.top 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: One nit only (given it's a RFC...): On Thu, 2 Oct 2025 17:57:06 +1000 David Gibson wrote: > I plan to start converting many of our tests to the tunbridge[0] network > simulator framework. This is the first step: downloading and setting up > tunbridge to work within our test scripts. It also introduces a 'tasst' > Python library for code that we might want to reuse across various > tunbridge based tests. > > Signed-off-by: David Gibson > --- > test/.gitignore | 2 ++ > test/Makefile | 19 +++++++++++-------- > test/run | 2 +- > test/smoke/smoke.py | 26 ++++++++++++++++++++++++++ > test/tasst/__init__.py | 10 ++++++++++ > 5 files changed, 50 insertions(+), 9 deletions(-) > create mode 100755 test/smoke/smoke.py > create mode 100644 test/tasst/__init__.py > > diff --git a/test/.gitignore b/test/.gitignore > index 9412f0d3..71409c51 100644 > --- a/test/.gitignore > +++ b/test/.gitignore > @@ -12,4 +12,6 @@ rampstream > guest-key > guest-key.pub > /exeter/ > +/tunbridge/ > *.bats > +__pycache__/ > diff --git a/test/Makefile b/test/Makefile > index 5b5f0fc1..f66c7e7e 100644 > --- a/test/Makefile > +++ b/test/Makefile > @@ -54,7 +54,7 @@ UBUNTU_NEW_IMGS = xenial-server-cloudimg-powerpc-disk1.img \ > jammy-server-cloudimg-s390x.img > UBUNTU_IMGS = $(UBUNTU_OLD_IMGS) $(UBUNTU_NEW_IMGS) > > -DOWNLOAD_ASSETS = $(EXETOOL) mbuto podman \ > +DOWNLOAD_ASSETS = $(EXETOOL) tunbridge mbuto podman \ > $(DEBIAN_IMGS) $(FEDORA_IMGS) $(OPENSUSE_IMGS) $(UBUNTU_IMGS) > TESTDATA_ASSETS = small.bin big.bin medium.bin \ > rampstream > @@ -65,15 +65,15 @@ LOCAL_ASSETS = mbuto.img mbuto.mem.img podman/bin/podman QEMU_EFI.fd \ > > ASSETS = $(DOWNLOAD_ASSETS) $(LOCAL_ASSETS) > > -EXETER_PYPATH = exeter/py3 > -EXETER_PYTHON = build/build.py > -EXETER_BATS = smoke/smoke.sh.bats \ > - $(EXETER_PYTHON:%=%.bats) build/static_checkers.sh.bats > +EXETER_SH = smoke/smoke.sh build/static_checkers.sh > +EXETER_PYPATH = exeter/py3:tunbridge/:. > +EXETER_PYTHON = smoke/smoke.py build/build.py > +EXETER_BATS = $(EXETER_SH:%=%.bats) $(EXETER_PYTHON:%=%.bats) > BATS_FILES = $(EXETER_BATS) \ > podman/test/system/505-networking-pasta.bats > > # Python test code (for linters) > -PYPKGS = $(EXETER_PYTHON) > +PYPKGS = $(EXETER_PYTHON) tasst > > CFLAGS = -Wall -Werror -Wextra -pedantic -std=c99 > > @@ -88,6 +88,9 @@ exeter: > > exeter/exetool/exetool: pull-exeter > > +tunbridge: > + git clone https://gitlab.com/dgibson/tunbridge.git > + > mbuto: > git clone git://mbuto.sh/mbuto > > @@ -139,7 +142,7 @@ flake8: pull-exeter > mypy: pull-exeter > PYTHONPATH=$(EXETER_PYPATH) $(MYPY) $(PYPKGS) > > -$(EXETER_BATS): %.bats: % $(EXETOOL) > +$(EXETER_BATS): %.bats: % $(EXETOOL) pull-tunbridge > PYTHONPATH=$(EXETER_PYPATH) $(EXETOOL) bats -- $< > $@ > > bats: $(BATS_FILES) pull-podman > @@ -153,7 +156,7 @@ debug: assets > > clean: > rm -f perf.js *~ > - rm -rf .mypy_cache > + rm -rf .mypy_cache __pycache__ > rm -f $(LOCAL_ASSETS) > rm -f $(EXETER_BATS) > rm -rf test_logs > diff --git a/test/run b/test/run > index f858e558..3872a56e 100755 > --- a/test/run > +++ b/test/run > @@ -44,7 +44,7 @@ KERNEL=${KERNEL:-"/boot/vmlinuz-$(uname -r)"} > COMMIT="$(git log --oneline --no-decorate -1)" > > # Let exeter tests written in Python find their modules > -export PYTHONPATH=${BASEPATH}/exeter/py3 > +export PYTHONPATH=${BASEPATH}/exeter/py3:${BASEPATH}/tunbridge:${BASEPATH} > > . lib/util > . lib/context > diff --git a/test/smoke/smoke.py b/test/smoke/smoke.py > new file mode 100755 > index 00000000..cbf77ad9 > --- /dev/null > +++ b/test/smoke/smoke.py > @@ -0,0 +1,26 @@ > +#! /usr/bin/env python3 > +# > +# SPDX-License-Identifier: GPL-2.0-or-later > +# > +# test/smoke/smoke.py - Python smoke tests > +# > +# Copyright Red Hat > +# Author: David Gibson > + > +import exeter > + > + > +@exeter.test > +def py_test_libraries() -> None: > + """Check test in Python have access to the libraries we need""" tests -- Stefano