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 8BED65A026D for ; Wed, 20 Mar 2024 14:13:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1710940429; bh=KAGcxfwCgTDHJLWM8iZNZCStpN8B9FsCfITy5kabei4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XyqN3q9hYj/Yr81RvC8dosMlqRUB0MiALIDlVXFS7PXOxXfGWrLpYRe2uV8vF96R7 C0ZIav5UdPwZ6cAaMQKA80VX23aqtfVINdUJrwgrFqcwYfEYU3oBmaaO3/gJm+9fGR +I8THcAmaZtXTN57Yu5wTFA2jRlRNWLkVHjEBY2wzvCpgpTpP6yikkXGNJO7qpWjte OlwAGwQunAFXK5M+rw6Gxr3ffFirIeMyB6eq2dFjgmuJE7C2O5ez9OXTiKnvPKiQ5+ 43xikGFnxa1ny/rOTIksNg7/E3y+cwaP0+rsz1m/ewM7kDfMH0rjA/F7r5gFoQS0BI WILi7565/yRgg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4V08DY0S77z4wcq; Thu, 21 Mar 2024 00:13:49 +1100 (AEDT) Date: Thu, 21 Mar 2024 00:08:38 +1100 From: David Gibson To: Paul Holzinger Subject: Re: [PATCH 2/3] test: Build and download podman as a test asset Message-ID: References: <20240319050705.526627-1-david@gibson.dropbear.id.au> <20240319050705.526627-3-david@gibson.dropbear.id.au> <58492898-b9fe-493d-8fd5-9943eb6e3c93@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oN2o3EQrxBTTXSDn" Content-Disposition: inline In-Reply-To: <58492898-b9fe-493d-8fd5-9943eb6e3c93@redhat.com> Message-ID-Hash: XXBSAUQU3O2LZYXASKS2COAL2L7DNI5H X-Message-ID-Hash: XXBSAUQU3O2LZYXASKS2COAL2L7DNI5H 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: passt-dev@passt.top, Stefano Brivio 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: --oN2o3EQrxBTTXSDn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 19, 2024 at 11:07:40AM +0100, Paul Holzinger wrote: >=20 > On 19/03/2024 06:07, David Gibson wrote: > > 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 > >=20 > > The same concerns largely apply to building podman too, because it's pr= etty > > common for Go builds to download dependencies themselves. Therefore mo= ve > > the download and build of podman from the test itself, to the Makefile > > where we prepare other test assets. > FYI, we use vendoring in podman and most of our other repos. So running > something like `make podman` should never download anything. The only tar= get > that downloads the deps is `make vendor` which is not needed unless you > update the dependencies. Anyhow it doesn't change the fact that your other > reasons for this change are valid. Ok, good to know. > > To avoid cryptic failures if something went wrong with the build, make > > running the test dependent on having the built podman binary. > >=20 > > Signed-off-by: David Gibson > > --- > > test/.gitignore | 1 + > > test/Makefile | 12 ++++++++++-- > > test/pasta_podman/bats | 6 ++---- > > 3 files changed, 13 insertions(+), 6 deletions(-) > >=20 > > 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 =3D xenial-server-cloudimg-powerpc-= disk1.img \ > > jammy-server-cloudimg-s390x.img > > UBUNTU_IMGS =3D $(UBUNTU_OLD_IMGS) $(UBUNTU_NEW_IMGS) > > -DOWNLOAD_ASSETS =3D mbuto \ > > +DOWNLOAD_ASSETS =3D mbuto podman \ > > $(DEBIAN_IMGS) $(FEDORA_IMGS) $(OPENSUSE_IMGS) $(UBUNTU_IMGS) > > TESTDATA_ASSETS =3D small.bin big.bin medium.bin > > -LOCAL_ASSETS =3D mbuto.img mbuto.mem.img QEMU_EFI.fd \ > > +LOCAL_ASSETS =3D mbuto.img mbuto.mem.img podman/bin/podman QEMU_EFI.fd= \ > > $(DEBIAN_IMGS:%=3Dprepared-%) $(FEDORA_IMGS:%=3Dprepared-%) \ > > $(UBUNTU_NEW_IMGS:%=3Dprepared-%) \ > > 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=3D"__STATEDIR__/podman/bin/podman" CONTAINERS_HELPER_BINAR= Y_DIR=3D"__WD__" bats __STATEDIR__/podman/test/system/505-networking-pasta.= bats > > +host PODMAN=3D"test/podman/bin/podman" CONTAINERS_HELPER_BINARY_DIR=3D= "__WD__" bats test/podman/test/system/505-networking-pasta.bats > Note while these env vars are stable and should not change I would strong= ly > recommend to add some kind of smoke test here in the form of running `pod= man > info --format "{{.Host.Pasta.Executable}}"`, this will return the full pa= th > to the binary so you should make sure this is the path to your test binary > and not the system pasta version to ensure you are actually testing the > right thing. Good idea, I've added that for v2. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --oN2o3EQrxBTTXSDn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmX639UACgkQzQJF27ox 2GdlLA//csdtUzJnZq4vIu/hyOnsx4GJzvTcPdE9E1oZxj/NB06KMYOr39nPATEp 27OivPprD8jtvNaVRLQXA2fyzgR2L8wLaZhPuiKwyloVy35JImaCXcHD62Zo4aUj 76sQu1z89K0OId/KU3q99i75deWdeNLdeC18g+XkJzZiqzykHgUixE2CqMlgUQUE W8mMLQkzelrRMqWmvgpk1oGy5QRROFig3Q5Acf6Jxpjr46fJ3YjgMeL00bCG5EMN mbTwy4U9A7/a5Hb3MRseRE6neLU1nUi0lzR/0WY+RY7/RAkcbwnNtiomIHdryBMb f7P7ZMEPadEj9LChu0E22tMRIKVwRcccEHhQ1IGf+r/MgaBKzSgGG2+xnyjyMhvs 4ubZFfK7Fk33aTKp7ffKeOmfOSKts5z6LfUD+qdMLVB8DAzO3BBpiWTO4BW2YznH excDRoPZaCeoFaOmZ6W0K7WCgjc9pQpX9U5SkKgI4rFJhJNOReIjodhdP7NjzcYe JTwkeGNshD/+h9fnEjcGTKocfb18qiBAfsEsut6i8gSObefST1iJQ1DXXEF6GdMH MqWKCK+Aa6AbNIKnNeVfV0KUK2cBh7xKknX1buNjYoLfVvD2HYHEwWMjm6AYqCpH vLX9l4ly9qCQVfJJsSa5JvwlvjEzlAa0RQmvt0DnppL/QING2bo= =w26E -----END PGP SIGNATURE----- --oN2o3EQrxBTTXSDn--