diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/buildah.spec b/buildah.spec index 999ab25..a39e9b2 100644 --- a/buildah.spec +++ b/buildah.spec @@ -79,9 +79,7 @@ or Summary: Tests for %{name} Requires: %{name} = %{epoch}:%{version}-%{release} -%if %{defined fedora} Requires: bats -%endif Requires: bzip2 Requires: podman Requires: golang @@ -94,7 +92,8 @@ Requires: git-daemon %description tests %{summary} -This package contains system tests for %{name} +This package contains system tests for %{name}. Only intended for distro +gating tests. End user/ customer usage not supported. %prep %autosetup -Sgit -n %{name}-%{version} diff --git a/gating.yaml b/gating.yaml index ae831e7..1fb3172 100644 --- a/gating.yaml +++ b/gating.yaml @@ -1,7 +1,16 @@ -# recipients: jnovy, lsm5, santiago --- !Policy product_versions: - - rhel-10 + - fedora-* +decision_contexts: + - bodhi_update_push_stable + - bodhi_update_push_testing +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} + +--- !Policy +product_versions: + - rhel-* decision_context: osci_compose_gate rules: - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/plans/main.fmf b/plans/main.fmf new file mode 100644 index 0000000..b982e76 --- /dev/null +++ b/plans/main.fmf @@ -0,0 +1,34 @@ +discover: + how: fmf + +execute: + how: tmt + +prepare: + - when: distro == centos-stream or distro == rhel + how: shell + script: | + dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm --eval '%{?rhel}').noarch.rpm + dnf -y config-manager --set-enabled epel + order: 10 + - when: initiator == packit + how: shell + script: | + COPR_REPO_FILE="/etc/yum.repos.d/*podman-next*.repo" + if compgen -G $COPR_REPO_FILE > /dev/null; then + sed -i -n '/^priority=/!p;$apriority=1' $COPR_REPO_FILE + fi + dnf -y upgrade --allowerasing + order: 20 + +provision: + how: artemis + hardware: + memory: ">= 16 GB" + cpu: + cores: ">= 4" + threads: ">=8" + disk: + - size: ">= 512 GB" + + diff --git a/tests/test_buildah.sh b/tests/test_buildah.sh deleted file mode 100755 index f8776bb..0000000 --- a/tests/test_buildah.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -e - -# Log program and kernel versions -echo "Important package versions:" -( - uname -r - rpm -qa |\ - egrep 'buildah|podman|conmon|containers-common|crun|runc|iptable|slirp|aardvark|netavark|containernetworking-plugins|systemd|container-selinux' |\ - sort -) | sed -e 's/^/ /' - -# Log environment; or at least the useful bits -echo "Environment:" -env | grep -v LS_COLORS= | sort | sed -e 's/^/ /' - -export BUILDAH_BINARY=/usr/bin/buildah -export IMGTYPE_BINARY=/usr/bin/buildah-imgtype -export COPY_BINARY=/usr/bin/buildah-copy -export TUTORIAL_BINARY=/usr/bin/buildah-tutorial - -############################################################################### -# BEGIN setup/teardown - -# Start a registry -pre_bats_setup() { - REGISTRY_FQIN=quay.io/libpod/registry:2 - - AUTHDIR=/tmp/buildah-tests-auth.$$ - mkdir -p $AUTHDIR - - CERT=$AUTHDIR/domain.crt - if [ ! -e $CERT ]; then - openssl req -newkey rsa:4096 -nodes -sha256 \ - -keyout $AUTHDIR/domain.key -x509 -days 2 \ - -out $AUTHDIR/domain.crt \ - -subj "/C=US/ST=Foo/L=Bar/O=Red Hat, Inc./CN=registry host certificate" \ - -addext subjectAltName=DNS:localhost - fi - - if [ ! -e $AUTHDIR/htpasswd ]; then - htpasswd -Bbn testuser testpassword > $AUTHDIR/htpasswd - fi - - podman rm -f registry || true - podman run -d -p 5000:5000 \ - --name registry \ - -v $AUTHDIR:/auth:Z \ - -e "REGISTRY_AUTH=htpasswd" \ - -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \ - -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/auth/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/auth/domain.key \ - $REGISTRY_FQIN -} - -post_bats_teardown() { - podman rm -f registry -} - -# END setup/teardown -############################################################################### -# BEGIN actual test - -pre_bats_setup -bats /usr/share/buildah/test/system -rc=$? -post_bats_teardown - -exit $rc diff --git a/tests/test_buildah.yml b/tests/test_buildah.yml deleted file mode 100644 index 8bb1ed0..0000000 --- a/tests/test_buildah.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- hosts: localhost - environment: - TMPDIR: /var/tmp - roles: - - role: standard-test-basic - tags: - - classic - - container - required_packages: - - buildah - - buildah-tests - tests: - - root-test: - dir: ./ - run: ./test_buildah.sh - timeout: 80m diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 596f735..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1 +0,0 @@ -- import_playbook: test_buildah.yml diff --git a/tests/tmt/system.fmf b/tests/tmt/system.fmf new file mode 100644 index 0000000..f34f4d9 --- /dev/null +++ b/tests/tmt/system.fmf @@ -0,0 +1,17 @@ +require: + - buildah-tests + - git-daemon + - slirp4netns + +environment: + BUILDAH_BINARY: /usr/bin/buildah + IMGTYPE_BINARY: /usr/bin/buildah-imgtype + INET_BINARY: /usr/bin/buildah-inet + COPY_BINARY: /usr/bin/buildah-copy + TUTORIAL_BINARY: /usr/bin/buildah-tutorial + TMPDIR: /var/tmp + +/local/root: + summary: System test + test: bash ./system.sh + duration: 60m diff --git a/tests/tmt/system.sh b/tests/tmt/system.sh new file mode 100644 index 0000000..73553aa --- /dev/null +++ b/tests/tmt/system.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -exo pipefail + +uname -r + +rpm -q \ + aardvark-dns \ + buildah \ + buildah-tests \ + conmon \ + container-selinux \ + containers-common \ + crun \ + netavark \ + systemd + +bats /usr/share/buildah/test/system