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=OU9K98oS; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id A34675A0271 for ; Tue, 19 Aug 2025 16:27:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1755613669; 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=Q6KUovYwFC0HbkHbKMKhdIbYcTf0U516yFqnlrcPA3M=; b=OU9K98oSqAN9++B10WWvCGmPGkwW4KFclNldhlOycSsVrz6V9HU9ZnjUGF3cc5MyDooALY Oo+VWu+cOqZfeBDbe9XvzN2WfWW5NzxyMH151omyLS2uvhqx5nvHLGQK1Nyjfj7GR+7f1e TBS3luCwmb8MOTUaHSNwg0PPB/H1LPs= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-29-1Mue84Q-O3m-3XkXH-CppQ-1; Tue, 19 Aug 2025 10:27:47 -0400 X-MC-Unique: 1Mue84Q-O3m-3XkXH-CppQ-1 X-Mimecast-MFC-AGG-ID: 1Mue84Q-O3m-3XkXH-CppQ_1755613667 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-45a1b0cb0aaso32496995e9.3 for ; Tue, 19 Aug 2025 07:27:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755613666; x=1756218466; 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=Q6KUovYwFC0HbkHbKMKhdIbYcTf0U516yFqnlrcPA3M=; b=Xbesq15DOlVHizW0/+WfDrrAphxBlZgy0QlQ0WWvSSMMGHW33r4t43iaIQYi//bkHV lyKpBmYZyus0lHdJosR7TzX3WiAMHB1Yfuk/6R08b3mOKq1rQJRZf+8yIeacy7RcrwLp AgeFn2rib8/iJpqmzJEAtbmzf/9bGy7eoPB653esjBUaO9IU9e9ABfrfQmBnOEZwBfZs ZbVwJeXN6AFNsyKCG3yGXsTCtfLVk4QCFsDPah5i9bGJOS7l7M/DwlPr8Wp6RskFv2vL Q8oHGzP3z1iRqX4O2cR+tAxqkvn89WFNLHX0EhXp7N7sKcbajrwGPCrpFCDT50O0XIm5 Ohkw== X-Gm-Message-State: AOJu0YzPbdHJb/OrfT17+j3ZiH50fc38bergkPA5t5i0mECYkW25U/20 End1qBo2NoaU3KV2QetBUlC7kfbb5Ym7jOhxJ+juZLE8AKD6mKTs3Nhap0inBoGq0uPiGXS5kPE WT1iwfmFjOVwHdHp+S14ZkBdpaWKqT4TT5bMofH5zD5TN1nPZ6uNmuw== X-Gm-Gg: ASbGncvYai5Bi1fzajl8Dr5P/nqUUT8eXuaxX/QC69N8W0liFWgvCfBByZOp/wzEgKh dMLmJk/o3lurvucMjLFXh3t2p9Zu0uA1XtvJxPOUY0U7dsYZO2TG5AE0dk6EatGob+w/eiNs9dh lEn0UqnGLr3v5XlMwOXSBcpaCCfUjwZFO40MC3mhwOmxP4Ay0SBstHv5H3se8GAE/9cDcvDiDN8 pPRBIJVUDrjcOzvE1xVqFyghnUADFxa7giMiYyxFqb+FG/4FAsxTe0iOuzjy96CJhwhcjyUIf+Y Ue1YEpNQLCGaKsOtPLgZA3lez2hmmwNwH74LozMT/UucnGzKEQM= X-Received: by 2002:a05:600c:468d:b0:459:e025:8c40 with SMTP id 5b1f17b1804b1-45b43dbbf10mr23892095e9.10.1755613666502; Tue, 19 Aug 2025 07:27:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFUJt0MjnmB4OxZ0WT0EeY15ofJt5ehekNVykYiH7eYg0JuacIKbhzUz9FJSSoZ1aN5mcqZA== X-Received: by 2002:a05:600c:468d:b0:459:e025:8c40 with SMTP id 5b1f17b1804b1-45b43dbbf10mr23891815e9.10.1755613665776; Tue, 19 Aug 2025 07:27:45 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45a1c6cd044sm229457435e9.9.2025.08.19.07.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Aug 2025 07:27:45 -0700 (PDT) Date: Tue, 19 Aug 2025 16:27:38 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v4 1/3] test: Extend test scripts to allow running exeter tests. Message-ID: <20250819162738.36d35d52@elisabeth> In-Reply-To: <20250807113237.548294-2-david@gibson.dropbear.id.au> References: <20250807113237.548294-1-david@gibson.dropbear.id.au> <20250807113237.548294-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: bZp8ObPrLbZ_tAdQWNBL--6U5xBWr19AFI8hpN9XSqs_1755613667 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: IYMVQRFKJIWC5LP62LGH2T5IHPW3VQ3V X-Message-ID-Hash: IYMVQRFKJIWC5LP62LGH2T5IHPW3VQ3V 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: On Thu, 7 Aug 2025 21:32:35 +1000 David Gibson wrote: > Introduce some trivial testcases based on the exeter library. These run > passt and pasta with --help and --version options. Extend our test > scripts to run these tests. > > Signed-off-by: David Gibson > --- > test/.gitignore | 1 + > test/Makefile | 5 ++++- > test/lib/exeter | 46 +++++++++++++++++++++++++++++++++++++++++++++ > test/run | 9 ++++++++- > test/smoke/smoke.sh | 27 ++++++++++++++++++++++++++ > 5 files changed, 86 insertions(+), 2 deletions(-) > create mode 100644 test/lib/exeter > create mode 100755 test/smoke/smoke.sh > > diff --git a/test/.gitignore b/test/.gitignore > index 3573444f..cf48b885 100644 > --- a/test/.gitignore > +++ b/test/.gitignore > @@ -11,3 +11,4 @@ nstool > rampstream > guest-key > guest-key.pub > +/exeter/ > diff --git a/test/Makefile b/test/Makefile > index bf63db87..332f3f3e 100644 > --- a/test/Makefile > +++ b/test/Makefile > @@ -50,7 +50,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 = mbuto podman \ > +DOWNLOAD_ASSETS = exeter mbuto podman \ > $(DEBIAN_IMGS) $(FEDORA_IMGS) $(OPENSUSE_IMGS) $(UBUNTU_IMGS) Pre-existing, but this broke a while after you switched the image preparation to Makefile targets, so you can't really expect people to issue 'make' at the moment. I ran 'make exeter' to get further. It would be nice to update test/README.md (or fix the Makefile... or both). > TESTDATA_ASSETS = small.bin big.bin medium.bin \ > rampstream > @@ -70,6 +70,9 @@ assets: $(ASSETS) > pull-%: % > git -C $* pull > > +exeter: > + git clone https://gitlab.com/dgibson/exeter.git > + > mbuto: > git clone git://mbuto.sh/mbuto > > diff --git a/test/lib/exeter b/test/lib/exeter > new file mode 100644 > index 00000000..4f7bcff9 > --- /dev/null > +++ b/test/lib/exeter > @@ -0,0 +1,46 @@ > +#!/bin/sh > +# > +# 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/lib/exeter - Run exeter tests within the rest of passt's tests > +# > +# Copyright Red Hat > +# Author: David Gibson > + > +exeter() { It would be nice to have the usual arguments / function description here. > + STATESETUP="${STATEBASE}/$1" > + mkdir -p "${STATESETUP}" > + > + context_setup_host host > + layout_host Indentation here was done with tabs, this adds spaces instead. > + > + cd test > + > + __ntests=$("$@" --list | wc -l) > + if [ $? != 0 ]; then > + info "Failed to get exeter manifest for $@" > + pause_continue \ > + "Press any key to pause test session" \ > + "Resuming in " \ > + "Paused, press any key to continue" \ > + 5 > + return > + fi > + > + status_file_start "Exeter tests: $*" ${__ntests} > + > + for __testid in $("$@" --list); do > + status_test_start "${__testid}" > + context_run host "$@" "${__testid}" && status_test_ok || status_test_fail > + done > + > + cd .. > + > + teardown_context_watch ${PANE_HOST} host > +} > diff --git a/test/run b/test/run > index f73c3119..9e183682 100755 > --- a/test/run > +++ b/test/run > @@ -53,6 +53,7 @@ COMMIT="$(git log --oneline --no-decorate -1)" > . lib/layout_ugly > . lib/test > . lib/video > +. lib/exeter > > # cleanup() - Remove temporary files > cleanup() { > @@ -67,6 +68,8 @@ run() { > perf_init > [ ${CI} -eq 1 ] && video_start ci > > + exeter smoke/smoke.sh > + > setup build > test build/all > test build/cppcheck > @@ -223,6 +226,10 @@ run_selected() { > > __setup= > for __test; do > + if "test/${__test}" --list; then > + exeter "${__test}" > + continue > + fi > # HACK: the migrate tests need the setup repeated for > # each test > if [ "${__test%%/*}" != "${__setup}" -o \ > @@ -234,7 +241,7 @@ run_selected() { > > test "${__test}" > done > - teardown "${__setup}" > + [ -n "${__setup}" ] && teardown "${__setup}" > > log "PASS: ${STATUS_PASS}, FAIL: ${STATUS_FAIL}, SKIPPED: ${STATUS_SKIPPED}" > > diff --git a/test/smoke/smoke.sh b/test/smoke/smoke.sh > new file mode 100755 > index 00000000..26a98d31 > --- /dev/null > +++ b/test/smoke/smoke.sh > @@ -0,0 +1,27 @@ > +#! /bin/sh ...this is desirable, I think (and, for consistency, I'd use "#!/bin/sh") as Bash is not universally available, but: > +# > +# 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/smoke/smoke.sh - Basic snoke tests smoke > +# > +# Copyright Red Hat > +# Author: David Gibson > + > +source $(dirname $0)/../exeter/sh/exeter.sh this is specific to Bash, so what I get with dash is: smoke/smoke.sh: 16: source: not found smoke/smoke.sh: 21: exeter_register: not found smoke/smoke.sh: 22: exeter_register: not found smoke/smoke.sh: 24: exeter_register: not found smoke/smoke.sh: 25: exeter_register: not found smoke/smoke.sh: 27: exeter_main: not found ... same for build/static_checkers.sh and build/source.sh. See also: $ checkbashisms test/build/static_checkers.sh possible bashism in test/build/static_checkers.sh line 16 (should be '.', not 'source'): source $(dirname $0)/../exeter/sh/exeter.sh > + > +PASST=$(dirname $0)/../../passt > +PASTA=$(dirname $0)/../../pasta > + > +exeter_register passt_version $PASST --version > +exeter_register pasta_version $PASTA --version > + > +exeter_register passt_help $PASST --help > +exeter_register pasta_help $PASTA --help > + > +exeter_main "$@"