From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id ECBDC5A026F for ; Tue, 19 Mar 2024 06:07:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1710824827; bh=RDFP2iqy+BUXPyOE3lebHINdbcbAA5Epk7sLd9co+PA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ruRYxXR71Y2S6/GHglXyAhYTX3hgzq3ZxYUo6D5IzIwQ2lOC2pVIOm4e6lU2xdTCa sKLDMYF5Zc/2bEQRaXe77KK0ZQ2EwHiUfp/8WNSS+Uh4TcR7tFQuAEUQTm9iozZFno VcNC6JHFFaDL4YLNRu5LuRSRxGtsEjXssRVuInoKaszSjSmfeXRWrWYERBku6JVNxa KS+FPEnEWjoowhCrnuEd1uh+ma6rTh+vANzl/zah1uZjs3aZspG0GMrYF/tvNBzXGp w8e0A+B/jH6K39JBsDRZc7jnw/yKQvRPKvSzkZvdnwvSvdIx+WOyMTF6RxMP0Wmjqq jgFOv/oD9BQgQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4TzKTR1jwCz4wc4; Tue, 19 Mar 2024 16:07:07 +1100 (AEDT) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 2/3] test: Build and download podman as a test asset Date: Tue, 19 Mar 2024 16:07:04 +1100 Message-ID: <20240319050705.526627-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240319050705.526627-1-david@gibson.dropbear.id.au> References: <20240319050705.526627-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 3G5C47MKZOARQLNLJZF4RDV3WJWGOTGN X-Message-ID-Hash: 3G5C47MKZOARQLNLJZF4RDV3WJWGOTGN 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: The pasta_podman/bats test scrpt downloads and builds podman, then runs its pasta specific tests. Downloading from within a test case has some drawbacks: * It can be very tedious if you have poor connectivity to the server * It makes a test that's ostensibly for pasta itself dependent on the state of the github server * It precludes runnning the tests in an isolated network environment The same concerns largely apply to building podman too, because it's pretty common for Go builds to download dependencies themselves. Therefore move the download and build of podman from the test itself, to the Makefile where we prepare other test assets. To avoid cryptic failures if something went wrong with the build, make running the test dependent on having the built podman binary. Signed-off-by: David Gibson --- test/.gitignore | 1 + test/Makefile | 12 ++++++++++-- test/pasta_podman/bats | 6 ++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/test/.gitignore b/test/.gitignore index 48374028..6dd4790b 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -1,5 +1,6 @@ test_logs/ mbuto/ +podman/ *.img QEMU_EFI.fd *.qcow2 diff --git a/test/Makefile b/test/Makefile index 711c61c1..35a3b559 100644 --- a/test/Makefile +++ b/test/Makefile @@ -52,10 +52,10 @@ 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 \ +DOWNLOAD_ASSETS = mbuto podman \ $(DEBIAN_IMGS) $(FEDORA_IMGS) $(OPENSUSE_IMGS) $(UBUNTU_IMGS) TESTDATA_ASSETS = small.bin big.bin medium.bin -LOCAL_ASSETS = mbuto.img mbuto.mem.img QEMU_EFI.fd \ +LOCAL_ASSETS = mbuto.img mbuto.mem.img podman/bin/podman QEMU_EFI.fd \ $(DEBIAN_IMGS:%=prepared-%) $(FEDORA_IMGS:%=prepared-%) \ $(UBUNTU_NEW_IMGS:%=prepared-%) \ nstool guest-key guest-key.pub \ @@ -76,6 +76,14 @@ mbuto: mbuto/mbuto: pull-mbuto +podman: + git clone https://github.com/containers/podman.git + +# To succesfully build podman, you will need gpgme and systemd +# development packages +podman/bin/podman: pull-podman + $(MAKE) -C podman + guest-key guest-key.pub: ssh-keygen -f guest-key -N '' diff --git a/test/pasta_podman/bats b/test/pasta_podman/bats index 21446f08..cb88aa41 100644 --- a/test/pasta_podman/bats +++ b/test/pasta_podman/bats @@ -11,11 +11,9 @@ # Copyright (c) 2022 Red Hat GmbH # Author: Stefano Brivio -htools git make go bats catatonit ip jq socat +htools git make go bats catatonit ip jq socat ./test/podman/bin/podman test Podman system test with bats -host git -C __STATEDIR__ clone https://github.com/containers/podman.git -host make -C __STATEDIR__/podman hout WD pwd -host PODMAN="__STATEDIR__/podman/bin/podman" CONTAINERS_HELPER_BINARY_DIR="__WD__" bats __STATEDIR__/podman/test/system/505-networking-pasta.bats +host PODMAN="test/podman/bin/podman" CONTAINERS_HELPER_BINARY_DIR="__WD__" bats test/podman/test/system/505-networking-pasta.bats -- 2.44.0