diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.packit.yaml b/.packit.yaml index 655b0db02..7cb245c11 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -24,17 +24,17 @@ jobs: - job: copr_build trigger: pull_request packages: [containers-common-fedora] - notifications: &ephemeral_build_failure_notification - failure_comment: - message: "Ephemeral COPR build failed. @containers/packit-build please check." +# notifications: &ephemeral_build_failure_notification +# failure_comment: + # message: "Ephemeral COPR build failed. @containers/packit-build please check." enable_net: true - targets: - - fedora-all + targets: &fedora_copr_targets + - fedora-rawhide - job: copr_build - trigger: pull_request + trigger: ignore packages: [containers-common-eln] - notifications: *ephemeral_build_failure_notification + #notifications: *ephemeral_build_failure_notification enable_net: true targets: fedora-eln: @@ -45,11 +45,11 @@ jobs: - https://kojipkgs.fedoraproject.org/repos/eln-build/latest/x86_64/ - job: copr_build - trigger: pull_request + trigger: ignore packages: [containers-common-centos] - notifications: *ephemeral_build_failure_notification + #notifications: *ephemeral_build_failure_notification enable_net: true - targets: + targets: ¢os_copr_targets - centos-stream-9 - centos-stream-10 @@ -65,6 +65,22 @@ jobs: project: podman-next enable_net: true + # All tests specified in the `/plans/` subdir + - job: tests + trigger: pull_request + packages: [containers-common-fedora] + targets: *fedora_copr_targets + enable_net: true + tf_extra_params: + environments: + - artifacts: + - type: repository-file + id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-$releasever/rhcontainerbot-podman-next-fedora-$releasever.repo + tmt: + context: + revdeps: "yes" + + - job: propose_downstream trigger: release packages: [containers-common-fedora] diff --git a/contrib/tmtplans/buildah_build_test.sh b/contrib/tmtplans/buildah_build_test.sh new file mode 100644 index 000000000..d1d5a858c --- /dev/null +++ b/contrib/tmtplans/buildah_build_test.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -eox pipefail + +rpm -q golang + +if [ -f /etc/fedora-release ]; then + export TMPDIR=/var/tmp +fi + +git clone https://github.com/containers/podman + +cd podman +dnf -y builddep rpm/podman.spec + +go mod edit -replace github.com/containers/common=../ +make vendor +cat go.mod + +git add vendor/ +git config --global user.email "you@example.com" +git config --global user.name "Your Name" + +make rpm diff --git a/contrib/tmtplans/main.fmf b/contrib/tmtplans/main.fmf new file mode 100644 index 000000000..7cde74cf0 --- /dev/null +++ b/contrib/tmtplans/main.fmf @@ -0,0 +1,12 @@ +prepare: + - how: install + package: + - containers-common + - containers-common-extra + - podman-tests + +/podman_build_test: + summary: Build Podman + execute: + how: tmt + script: bash ./contrib/tmtplans/podman_build_test.sh diff --git a/contrib/tmtplans/podman_build_test.sh b/contrib/tmtplans/podman_build_test.sh new file mode 100644 index 000000000..4269d104a --- /dev/null +++ b/contrib/tmtplans/podman_build_test.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +set -exo pipefail + +rpm -q golang + +#if [ -f /etc/fedora-release ]; then +# export TMPDIR=/var/tmp +#fi + +# Navigate to parent dir of default working dir +cd .. + +# Clone podman +git clone https://github.com/containers/podman + +cd podman +dnf -y builddep rpm/podman.spec + +# Vendor c/common from PR +# TMT_TREE points to the default working dir +go mod edit -replace github.com/containers/common=$TMT_TREE +make vendor +cat go.mod + +make diff --git a/plans/main.fmf b/plans/main.fmf new file mode 100644 index 000000000..add8a1d6d --- /dev/null +++ b/plans/main.fmf @@ -0,0 +1,31 @@ +discover: + how: fmf +execute: + how: tmt +adjust: + - when: initiator == packit + because: "We need to test with updated packages from rhcontainerbot/podman-next copr" + prepare+: + how: shell + script: sed -i -n '/^priority=/!p;$apriority=5' /etc/yum.repos.d/*rhcontainerbot*.repo + - when: distro == centos-stream or distro == rhel + because: "bats package is present in epel" + prepare+: + how: feature + epel: enabled + +/upstream: + summary: Run SELinux specific Podman tests on upstream PRs + discover+: + filter: tag:upstream + adjust+: + - when: initiator is not defined or initiator != packit + enabled: false + +/downstream: + summary: Run SELinux specific Podman tests on bodhi / errata and dist-git PRs + discover+: + filter: tag:downstream + adjust+: + - when: initiator == packit + enabled: false diff --git a/plans/podman.fmf b/plans/podman.fmf new file mode 100644 index 000000000..24c243fd0 --- /dev/null +++ b/plans/podman.fmf @@ -0,0 +1,43 @@ +enabled: false + +adjust+: + - when: revdeps == yes + enabled: true + - when: initiator == packit + because: "We need to test with updated packages from rhcontainerbot/podman-next copr" + prepare+: + how: shell + script: sed -i -n '/^priority=/!p;$apriority=5' /etc/yum.repos.d/*rhcontainerbot*.repo + - when: distro == centos-stream or distro == rhel + because: "bats package is present in epel" + prepare+: + how: feature + epel: enabled + +discover: + how: fmf + url: https://github.com/lsm5/podman + ref: "tmt-fedora-centos" + +execute: + how: tmt + +/local-root: + summary: Run local rootful tests + discover+: + test: /test/tmt/system-test/local-root + +/local-rootless: + summary: Run local rootless tests + discover+: + test: /test/tmt/system-test/local-rootless + +/remote-root: + summary: Run remote rootful tests + discover+: + test: /test/tmt/system-test/remote-root + +/remote-rootless: + summary: Run remote rootless tests + discover+: + test: /test/tmt/system-test/remote-rootless