From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202508 header.b=pgpefzsy; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id ACBE65A027A for ; Thu, 07 Aug 2025 13:32:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1754566361; bh=LxX3rx1fjr2SZqSGaenFCvMpESZ8E0cNlhNkXmik4FQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pgpefzsyvIfsasnNdB1xluZZ2ety1UJqNEP9kn0LLJxM1F5o1SzO3eS0hZ+NeDzSu Q5OG+l3J9ICNXMwXeelktxNMe4Th8kRAOzlUXzPPcFhesopubK7ZjS5aUIHbfJnMyn 1JwUf0+8YrmxEvVQxSy9My3yz7rq0EMq47zudfJUOknKnx3xEDLRuFlXOXpy1HWGVO MJ/mG3/W+U3QUXsEI3gB9HE4FFPbOEWXD7cT/F7UePhu45SCM4iL69B3a6Amvd2k6L ImBkylRW2yP5QjEwGpTjobiubUMJHRNCE41PWx5Ebsq2Fxtm/0+cWysGezaMU2LQfv MFPg3BbxRJKkw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4byQ4n1YZ0z4w2Q; Thu, 7 Aug 2025 21:32:41 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v4 1/3] test: Extend test scripts to allow running exeter tests. Date: Thu, 7 Aug 2025 21:32:35 +1000 Message-ID: <20250807113237.548294-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250807113237.548294-1-david@gibson.dropbear.id.au> References: <20250807113237.548294-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: PNWUICK263BCFN3DHCRHE3H6NA7DS5BO X-Message-ID-Hash: PNWUICK263BCFN3DHCRHE3H6NA7DS5BO 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: 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: 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) 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() { + STATESETUP="${STATEBASE}/$1" + mkdir -p "${STATESETUP}" + + context_setup_host host + layout_host + + 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 +# +# 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 +# +# Copyright Red Hat +# Author: David Gibson + +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 "$@" -- 2.50.1