From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id E31765A026D for ; Tue, 19 Mar 2024 11:07:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710842864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yDWR0ajzE8vSVCf30ivggdyAIqUDJUlQmA0bnphiq8A=; b=TYJWhRbo8w6HBkFdxWQ/mDW5PanOyQ8UvPSfdm64W//b2eeFF7dkBUngh3+mvOkD2C8njP SVjhb+G1EMdf/gwmT0Jde0036U1R6TCjDuZuoMnpV0jwAKNP3zRTKgxY8tU5c3FpL86b68 lLHYWgvJ85lj59sGxe1R+Hh7A2BOgQ4= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-UJ8JPiXlO9GHszjlABJ3NQ-1; Tue, 19 Mar 2024 06:07:43 -0400 X-MC-Unique: UJ8JPiXlO9GHszjlABJ3NQ-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3418f237c0bso43707f8f.3 for ; Tue, 19 Mar 2024 03:07:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710842862; x=1711447662; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yDWR0ajzE8vSVCf30ivggdyAIqUDJUlQmA0bnphiq8A=; b=iNmpN3pOpcKYqUuRlV98ZQHFXwDjv8dKQu6M2C+xd+ANiVK5WAnImtx4VEM4zEJUVf DUwaWbtvJScfBGwX3J0CEDfu7iUEQeUOP2Ub5pN9zn3TeugnCZvPrXUFhett/YXlMNRz TGstcmF+flMo+GZwAtpu7FdBcTv+N6Z+4tgqqsqJNrUYOR1hdAB7GCQJzxgR9hYJRWy5 /mBqg+lQKrLuL9ntYR+tcz7mCkjAzC/oaGR4dlO7osX1PVtCRtQvdecoxrqvsmaxq8Wz aT5taDTWNDt2H8mlVDMYmOn6UK7wC/ckr5DH94xd1sMfUBmn6tW9EqSZpjHMtjGUlk1F 1MTw== X-Forwarded-Encrypted: i=1; AJvYcCVnRPC/8q2YhQ9z7CVIzQS/fNjPRYuBeASILxXmofTKMbEscskLrVXXIW8u30LuhHB7KyxGXyBww8CWUqHccmXFbZ82 X-Gm-Message-State: AOJu0YxFgNSuiC+uwjcXMiaCL0Clwadu5e3pzNBfcDHXHVpXwpRGlY5U 1CU4oOgWXw9DP64VDO6BiWfyxqX7zoszbyf0Dy/mqClQQiqj5Z0c7TBdCWpZGNKzUDNFSQdPmIs ZM3VS+ZrOrLfmcAgh48AdFlSvREuEIt2p2unf0XKI74CLkAPfgg== X-Received: by 2002:a5d:534a:0:b0:33e:aea4:fdab with SMTP id t10-20020a5d534a000000b0033eaea4fdabmr8959992wrv.68.1710842861993; Tue, 19 Mar 2024 03:07:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwJdDfIAz8OwTMXIFqseklEpAfpThAg02r6ZwuHsioZP3o9NjtA7RYOlaSFgfJ4CKUNDjGEw== X-Received: by 2002:a5d:534a:0:b0:33e:aea4:fdab with SMTP id t10-20020a5d534a000000b0033eaea4fdabmr8959983wrv.68.1710842861592; Tue, 19 Mar 2024 03:07:41 -0700 (PDT) Received: from [192.168.188.25] ([80.243.52.134]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm12019609wrp.69.2024.03.19.03.07.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Mar 2024 03:07:41 -0700 (PDT) Message-ID: <58492898-b9fe-493d-8fd5-9943eb6e3c93@redhat.com> Date: Tue, 19 Mar 2024 11:07:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] test: Build and download podman as a test asset To: David Gibson , passt-dev@passt.top, Stefano Brivio References: <20240319050705.526627-1-david@gibson.dropbear.id.au> <20240319050705.526627-3-david@gibson.dropbear.id.au> From: Paul Holzinger In-Reply-To: <20240319050705.526627-3-david@gibson.dropbear.id.au> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: XT4QFSGOTY2ERAQZJKFH2KWD23NDWDPT X-Message-ID-Hash: XT4QFSGOTY2ERAQZJKFH2KWD23NDWDPT X-MailFrom: pholzing@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 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 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 > > 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. FYI, we use vendoring in podman and most of our other repos. So running something like `make podman` should never download anything. The only target 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. > 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 Note while these env vars are stable and should not change I would strongly recommend to add some kind of smoke test here in the form of running `podman info --format "{{.Host.Pasta.Executable}}"`, this will return the full path 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.