From a058d4df5935ff6d17b5258228b7c68e1e96805e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 10 Oct 2024 10:07:19 +0200 Subject: [PATCH] tmt: run new go tests to check container subscription access in tmt This commit wires up the needed credentials and scaffolding to run the integration tests about subscribed content in containers via tmt. For this it passes in the `RHSM_{ORG,ACTIVATION_KEY}` secrets and runs the go tests as root. --- .github/workflows/testingfarm.yml | 2 +- plans/{all.fmf => integration.fmf} | 1 - plans/unit-go.fmf | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) rename plans/{all.fmf => integration.fmf} (96%) create mode 100644 plans/unit-go.fmf diff --git a/.github/workflows/testingfarm.yml b/.github/workflows/testingfarm.yml index 1fa47724..b0f6d643 100644 --- a/.github/workflows/testingfarm.yml +++ b/.github/workflows/testingfarm.yml @@ -56,4 +56,4 @@ jobs: git_ref: ${{ github.event.pull_request.head.ref }} pull_request_status_name: "Testing farm" tf_scope: private - secrets: "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }};AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}" + secrets: "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }};AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }};RHSM_ORG=${{ secrets.RHSM_ORG }};RHSM_ACTIVATION_KEY=${{ secrets.RHSM_ACTIVATION_KEY }} " diff --git a/plans/all.fmf b/plans/integration.fmf similarity index 96% rename from plans/all.fmf rename to plans/integration.fmf index 688250ba..7fb26637 100644 --- a/plans/all.fmf +++ b/plans/integration.fmf @@ -19,7 +19,6 @@ prepare: - python3-paramiko - python3-pip - skopeo - - subscription-manager - qemu-kvm - qemu-system-aarch64 - qemu-user-static diff --git a/plans/unit-go.fmf b/plans/unit-go.fmf new file mode 100644 index 00000000..e41dc1fc --- /dev/null +++ b/plans/unit-go.fmf @@ -0,0 +1,19 @@ +summary: Run all tests inside a VM environment +provision: + how: virtual + image: fedora:40 +prepare: + how: install + package: + - btrfs-progs-devel + - device-mapper-devel + - gpgme-devel + - golang + - osbuild-depsolve-dnf + - podman + - subscription-manager +execute: + how: tmt + script: | + echo "Run tests as root" + cd bib && go test -v ./...