diff --git a/.gitignore b/.gitignore index d352833..62eb9bc 100644 --- a/.gitignore +++ b/.gitignore @@ -93,3 +93,12 @@ crun-0.1.1.tar.gz /crun-1.18.2.tar.zst /crun-1.19.tar.zst /crun-1.19.1.tar.zst +/crun-1.20.tar.zst +/crun-1.21.tar.zst +/crun-1.22.tar.zst +/crun-1.23.tar.zst +/crun-1.23.1.tar.zst +/crun-1.24.tar.zst +/crun-1.25.tar.zst +/crun-1.25.1.tar.zst +/crun-1.26.tar.zst diff --git a/.packit.yaml b/.packit.yaml index 363614f..b7dc6ae 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -29,8 +29,6 @@ packages: crun-centos: pkg_tool: centpkg specfile_path: rpm/crun.spec - crun-rhel: - specfile_path: rpm/crun.spec crun-eln: specfile_path: rpm/crun.spec @@ -67,25 +65,11 @@ jobs: trigger: pull_request packages: [crun-centos] notifications: *copr_build_failure_notification - targets: ¢os_targets - # Need epel9 repos to fetch wasmedge build dependency - centos-stream-9-x86_64: - additional_repos: - - https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/ - centos-stream-9-aarch64: - additional_repos: - - https://dl.fedoraproject.org/pub/epel/9/Everything/aarch64/ - # TODO: build on CS10 with wasmedge once epel-10 is available - centos-stream-10-x86_64: {} - centos-stream-10-aarch64: {} - - - job: copr_build - trigger: pull_request - packages: [crun-rhel] - notifications: *copr_build_failure_notification - targets: - - epel-9-x86_64 - - epel-9-aarch64 + targets: ¢os_copr_targets + - centos-stream-9-x86_64 + - centos-stream-9-aarch64 + - centos-stream-10-x86_64 + - centos-stream-10-aarch64 # Run on commit to main branch - job: copr_build @@ -102,9 +86,9 @@ jobs: - job: tests trigger: pull_request packages: [crun-fedora] - notifications: &podman_system_test_fail_notification + notifications: &test_failure_notification failure_comment: - message: "podman system tests failed. @containers/packit-build please check." + message: "TMT tests failed. @containers/packit-build please check." targets: *fedora_copr_targets tf_extra_params: environments: @@ -116,42 +100,30 @@ jobs: - job: tests trigger: pull_request packages: [crun-centos] - notifications: *podman_system_test_fail_notification - targets: *centos_targets + notifications: *test_failure_notification + # TODO: Re-enable centos-stream-10-x86_64 once criu issues are solved + # Ref: https://github.com/containers/crun/pull/1758#issuecomment-2901772392 + # Issue filed: https://github.com/containers/crun/issues/1759 + #targets: *centos_copr_targets + targets: + - centos-stream-9-x86_64 + - centos-stream-9-aarch64 + - centos-stream-10-aarch64 tf_extra_params: environments: - artifacts: - type: repository-file id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/centos-stream-$releasever/rhcontainerbot-podman-next-centos-stream-$releasever.repo - # Podman system tests for RHEL - - job: tests - trigger: pull_request - packages: [crun-rhel] - use_internal_tf: true - notifications: *podman_system_test_fail_notification - targets: - epel-9-x86_64: - distros: [RHEL-9.4.0-Nightly,RHEL-9-Nightly] - epel-9-aarch64: - distros: [RHEL-9.4.0-Nightly,RHEL-9-Nightly] - #TODO: Enable RHEL10 targets once epel-10 copr target is available - tf_extra_params: - environments: - - artifacts: - - type: repository-file - id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/epel-$releasever/rhcontainerbot-podman-next-epel-$releasever.repo - - type: repository-file - id: https://src.fedoraproject.org/rpms/epel-release/raw/epel9/f/epel.repo - - job: propose_downstream trigger: release packages: [crun-fedora] dist_git_branches: &fedora_targets - fedora-all + # Disabled until we're switching to Packit for CentOS Stream - job: propose_downstream - trigger: release + trigger: ignore packages: [crun-centos] dist_git_branches: - c10s diff --git a/README.packit b/README.packit index 3826605..9bb65f0 100644 --- a/README.packit +++ b/README.packit @@ -1,3 +1,3 @@ This repository is maintained by packit. https://packit.dev/ -The file was generated using packit 0.106.0. +The file was generated using packit 1.13.0.post1.dev2+g84134016c. diff --git a/crun.spec b/crun.spec index 18756c9..5cfc631 100644 --- a/crun.spec +++ b/crun.spec @@ -9,20 +9,17 @@ # krun and wasm support only on aarch64 and x86_64 %ifarch aarch64 || x86_64 -# Disable wasmedge on rhel 10 until EPEL10 is in place, otherwise it causes -# build issues on copr -%if %{defined fedora} || (%{defined copr_build} && %{defined rhel} && 0%{?rhel} < 10) +%if %{defined fedora} +# krun only exists on fedora +%global krun_support 1 +%global krun_opts --with-libkrun + +# Keep wasmedge enabled only on Fedora. It breaks a lot on EPEL. %global wasm_support 1 %global wasmedge_support 1 %global wasmedge_opts --with-wasmedge %endif -# krun only exists on fedora -%if %{defined fedora} -%global krun_support 1 -%global krun_opts --with-libkrun -%endif - %endif %if %{defined fedora} || (%{defined rhel} && 0%{?rhel} < 10) @@ -42,7 +39,7 @@ Epoch: 102 # If that's what you're reading, Version must be 0, and will be updated by Packit for # copr and koji builds. # If you're reading this on dist-git, the version is automatically filled in by Packit. -Version: 1.19.1 +Version: 1.26 Release: %autorelease URL: https://github.com/containers/%{name} Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.zst @@ -69,15 +66,14 @@ BuildRequires: libseccomp-devel BuildRequires: python3-libmount BuildRequires: libtool BuildRequires: protobuf-c-devel -%ifnarch riscv64 BuildRequires: criu-devel >= 3.17.1-2 Recommends: criu >= 3.17.1 Recommends: criu-libs -%endif %if %{defined wasmedge_support} BuildRequires: wasmedge-devel %endif BuildRequires: python +BuildRequires: glibc-static Provides: oci-runtime %description @@ -121,6 +117,9 @@ Recommends: wasmedge %make_install prefix=%{_prefix} rm -rf %{buildroot}%{_prefix}/lib* +# Placeholder check to silence rpmlint +%check + %files %license COPYING %{_bindir}/%{name} diff --git a/gating.yaml b/gating.yaml index 4efb29f..f86de09 100644 --- a/gating.yaml +++ b/gating.yaml @@ -1,7 +1,7 @@ --- !Policy product_versions: - fedora-* -decision_context: +decision_contexts: - bodhi_update_push_stable - bodhi_update_push_testing rules: diff --git a/plans/main.fmf b/plans/main.fmf index 10bf493..7a4ae15 100644 --- a/plans/main.fmf +++ b/plans/main.fmf @@ -3,27 +3,38 @@ discover: execute: how: tmt prepare: - - how: feature - epel: enabled - - when: initiator == packit - because: "We need to test with updated packages from rhcontainerbot/podman-next copr" + - when: distro == centos-stream or distro == rhel how: shell script: | - sed -i -n '/^priority=/!p;$apriority=1' /etc/yum.repos.d/*podman-next*.repo + 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 + - how: install + package: + - bats + - crun + - podman-tests -/upstream: - summary: Run crun specific Podman system tests on upstream PRs +/shellcheck: discover+: - filter: tag:upstream - adjust+: - - enabled: false - when: initiator is not defined or initiator != packit + filter: 'tag:shellcheck' + enabled: true + adjust: + enabled: false + when: distro == centos-stream-10 or distro == rhel-10 + prepare+: + - how: install + package: ShellCheck -/downstream: - summary: Run crun specific Podman system tests on bodhi / errata and dist-git PRs +/tests: discover+: - filter: tag:downstream - adjust+: - - enabled: false - when: initiator == packit + filter: 'tag:podman | tag:sanity' diff --git a/plans/tmt.fmf b/plans/tmt.fmf new file mode 100644 index 0000000..1941978 --- /dev/null +++ b/plans/tmt.fmf @@ -0,0 +1,9 @@ +/: + inherit: false + +summary: Run tmt's integration tests +plan: + import: + url: https://github.com/teemtee/tmt + path: /plans/friends + name: /podman diff --git a/sources b/sources index 30431be..233ea40 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (crun-1.19.1.tar.zst) = 4122b6474a1da4c17d781e0ccf2f97a89cbddd4bfca1bca55b4cb15b11bef03f9101b00a921dc6dbcac43be3661a64d61bb7ddfd750672b5bf85561df13cc7a8 +SHA512 (crun-1.26.tar.zst) = 0785af6095a26290f433c5739bea5d98a029c3f0e8efbeed420481849ebddd70acde6c1105133c392abf26bca90d232cced5e5994da7506d66a020a02c129fb3 diff --git a/tests/tmt/podman/system-test.fmf b/tests/tmt/podman/system-test.fmf index 9beb3c9..8df55c2 100644 --- a/tests/tmt/podman/system-test.fmf +++ b/tests/tmt/podman/system-test.fmf @@ -1,15 +1,7 @@ -require: - - bats - - conmon - - crun - - make - - podman-tests - adjust: duration: 10m when: arch == aarch64 -/system_test: - tag: [ upstream, downstream ] - summary: Run crun specific Podman tests - test: bash ./system-test.sh +summary: Run crun specific Podman tests +test: bash ./system-test.sh +tag: [ podman ] diff --git a/tests/tmt/podman/system-test.sh b/tests/tmt/podman/system-test.sh index 4d04562..974f829 100644 --- a/tests/tmt/podman/system-test.sh +++ b/tests/tmt/podman/system-test.sh @@ -14,3 +14,4 @@ rpm -q conmon containers-common crun podman podman-tests bats -t /usr/share/podman/test/system/030-run.bats bats -t /usr/share/podman/test/system/075-exec.bats bats -t /usr/share/podman/test/system/280-update.bats +bats -t /usr/share/podman/test/system/520-checkpoint.bats diff --git a/tests/tmt/sanity/main.fmf b/tests/tmt/sanity/main.fmf index f430351..ccfa4ca 100644 --- a/tests/tmt/sanity/main.fmf +++ b/tests/tmt/sanity/main.fmf @@ -1,5 +1,4 @@ -require: [crun, podman] summary: Sanity test for crun -tag: ['upstream', 'downstream'] test: bash ./runtest.sh duration: 10m +tag: [ sanity ] diff --git a/tests/tmt/sanity/runtest.sh b/tests/tmt/sanity/runtest.sh index d1d453c..3e13986 100644 --- a/tests/tmt/sanity/runtest.sh +++ b/tests/tmt/sanity/runtest.sh @@ -10,82 +10,104 @@ cat /etc/redhat-release uname -r rpm -q crun criu -crun --version -[ $? -ne 0 ] && exit 1 +if ! crun --version; then + exit 1 +fi -crun features -[ $? -ne 0 ] && exit 1 +if ! crun features; then + exit 1 +fi -crun list -[ $? -ne 0 ] && exit 1 +if ! crun list; then + exit 1 +fi # create the top most bundle and rootfs directory -mkdir -p $TEMPDIR/rootfs +mkdir -p "$TEMPDIR"/rootfs # export busybox via podman into the rootfs directory -podman export $(podman create $TESTIMG) | tar -C $TEMPDIR/rootfs -xvf - -[ $? -ne 0 ] && exit 1 +if ! (podman export "$(podman create $TESTIMG)" | tar -C "$TEMPDIR"/rootfs -xvf -); then + exit 1 +fi # use existing spec -cp ./config.json $TEMPDIR -ls $TEMPDIR -cd $TEMPDIR +cp ./config.json "$TEMPDIR" +ls "$TEMPDIR" +cd "$TEMPDIR" -crun create $CNAME -[ $? -ne 0 ] && exit 1 +if ! crun create $CNAME; then + exit 1 +fi -crun list -[ $? -ne 0 ] && exit 1 +if ! crun list; then + exit 1 +fi -crun start $CNAME -[ $? -ne 0 ] && exit 1 +if ! crun start $CNAME; then + exit 1 +fi -crun list -[ $? -ne 0 ] && exit 1 +if ! crun list; then + exit 1 +fi -crun state $CNAME -[ $? -ne 0 ] && exit 1 +if ! crun state $CNAME; then + exit 1 +fi -crun ps $CNAME -[ $? -ne 0 ] && exit 1 +if ! crun ps $CNAME; then + exit 1 +fi -ret=$(crun exec $CNAME pwd) -[ $? -ne 0 ] || [ $ret != '/' ] && exit 1 +if ! ret=$(crun exec $CNAME pwd) || [[ "$ret" != '/' ]]; then + exit 1 +fi -crun pause $CNAME -[ $? -ne 0 ] && exit 1 +if ! crun pause $CNAME; then + exit 1 +fi -crun state $CNAME -[ $? -ne 0 ] && exit 1 +if ! crun state $CNAME; then + exit 1 +fi -crun resume $CNAME -[ $? -ne 0 ] && exit 1 +if ! crun resume $CNAME; then + exit 1 +fi -crun state $CNAME -[ $? -ne 0 ] && exit 1 +if ! crun state $CNAME; then + exit 1 +fi -ret=$(crun exec $CNAME pwd) -[ $? -ne 0 ] || [ $ret != '/' ] && exit 1 +if ! ret=$(crun exec $CNAME pwd) || [[ "$ret" != '/' ]]; then + exit 1 +fi -crun delete --force $CNAME -[ $? -ne 0 ] && exit 1 +if ! crun delete --force $CNAME; then + exit 1 +fi -crun list -[ $? -ne 0 ] && exit 1 +if ! crun list; then + exit 1 +fi -crun run $CNAME & -[ $? -ne 0 ] && exit 1 +if ! (crun run $CNAME &); then + exit 1 +fi -crun list -[ $? -ne 0 ] && exit 1 +if ! crun list; then + exit 1 +fi # make sure the container is running state sleep 2 -ret=$(crun exec $CNAME echo 'ok') -[ $? -ne 0 ] || [ $ret != 'ok' ] && exit 1 +if ! ret=$(crun exec $CNAME echo 'ok') || [[ "$ret" != 'ok' ]]; then + exit 1 +fi -crun kill $CNAME -[ $? -ne 0 ] && exit 1 +if ! crun kill $CNAME; then + exit 1 +fi exit 0 diff --git a/tests/tmt/shellcheck/main.fmf b/tests/tmt/shellcheck/main.fmf new file mode 100644 index 0000000..7d220b4 --- /dev/null +++ b/tests/tmt/shellcheck/main.fmf @@ -0,0 +1,4 @@ +summary: Shellcheck tests +test: find ../ -type f -name "*.sh" -exec shellcheck {} + +duration: 10m +tag: [ shellcheck ]