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/.gitignore b/.gitignore index d977000..ae2c48c 100644 --- a/.gitignore +++ b/.gitignore @@ -693,3 +693,45 @@ /v1.28.0.tar.gz /v1.28.2.tar.gz /v1.29.0.tar.gz +/v1.29.1.tar.gz +/v1.30.0.tar.gz +/v1.31.0.tar.gz +/v1.31.1.tar.gz +/v1.31.2.tar.gz +/v1.31.3.tar.gz +/v1.32.0.tar.gz +/v1.32.1.tar.gz +/v1.32.2.tar.gz +/v1.33.2.tar.gz +/v1.34.0.tar.gz +/v1.34.1.tar.gz +/v1.35.0.tar.gz +/v1.35.1.tar.gz +/v1.35.2.tar.gz +/v1.35.3.tar.gz +/v1.35.4.tar.gz +/v1.36.0.tar.gz +/v1.37.0.tar.gz +/v1.37.1.tar.gz +/v1.37.2.tar.gz +/v1.37.3.tar.gz +/v1.37.4.tar.gz +/v1.37.5.tar.gz +/v1.38.0.tar.gz +/v1.38.1.tar.gz +/v1.39.0.tar.gz +/v1.39.1.tar.gz +/v1.39.2.tar.gz +/v1.39.3.tar.gz +/v1.39.4.tar.gz +/v1.40.0.tar.gz +/v1.40.1.tar.gz +/v1.41.0.tar.gz +/v1.41.1.tar.gz +/v1.41.2.tar.gz +/v1.41.3.tar.gz +/v1.41.4.tar.gz +/v1.41.5.tar.gz +/v1.42.0.tar.gz +/v1.42.1.tar.gz +/v1.42.2.tar.gz diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..032e9e1 --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,149 @@ +--- +# See the documentation for more information: +# https://packit.dev/docs/configuration/ + +downstream_package_name: buildah +upstream_tag_template: v{version} + +# These files get synced from upstream to downstream (Fedora / CentOS Stream) on every +# propose-downstream job. This is done so tests maintained upstream can be run +# downstream in Zuul CI and Bodhi. +# Ref: https://packit.dev/docs/configuration#files_to_sync +files_to_sync: + - src: rpm/gating.yaml + dest: gating.yaml + delete: true + - src: plans/ + dest: plans/ + delete: true + mkpath: true + - src: tests/tmt/ + dest: tests/tmt/ + delete: true + mkpath: true + - src: .fmf/ + dest: .fmf/ + delete: true + - .packit.yaml + +packages: + buildah-fedora: + pkg_tool: fedpkg + specfile_path: rpm/buildah.spec + buildah-centos: + pkg_tool: centpkg + specfile_path: rpm/buildah.spec + buildah-eln: + specfile_path: rpm/buildah.spec + +srpm_build_deps: + - make + +jobs: + - job: copr_build + trigger: pull_request + packages: [buildah-fedora] + notifications: &copr_build_failure_notification + failure_comment: + message: "Ephemeral COPR build failed. @containers/packit-build please check." + # Fedora aliases documentation: https://packit.dev/docs/configuration#aliases + # python3-fedora-distro-aliases provides `resolve-fedora-aliases` command + targets: &fedora_copr_targets + - fedora-all-x86_64 + - fedora-all-aarch64 + enable_net: true + # Disable osh diff scan until Go support is available + # Ref: https://github.com/openscanhub/known-false-positives/pull/30#issuecomment-2858698495 + osh_diff_scan_after_copr_build: false + + # Ignore until golang is updated in distro buildroot to 1.23.3+ + - job: copr_build + trigger: ignore + packages: [buildah-eln] + notifications: *copr_build_failure_notification + targets: + fedora-eln-x86_64: + additional_repos: + - "https://kojipkgs.fedoraproject.org/repos/eln-build/latest/x86_64/" + fedora-eln-aarch64: + additional_repos: + - "https://kojipkgs.fedoraproject.org/repos/eln-build/latest/aarch64/" + enable_net: true + + # Ignore until golang is updated in distro buildroot to 1.23.3+ + - job: copr_build + trigger: ignore + packages: [buildah-centos] + notifications: *copr_build_failure_notification + targets: ¢os_copr_targets + - centos-stream-9-x86_64 + - centos-stream-9-aarch64 + - centos-stream-10-x86_64 + - centos-stream-10-aarch64 + enable_net: true + + # Run on commit to main branch + - job: copr_build + trigger: commit + packages: [buildah-fedora] + notifications: + failure_comment: + message: "podman-next COPR build failed. @containers/packit-build please check." + branch: main + owner: rhcontainerbot + project: podman-next + enable_net: true + + # Tests on Fedora for main branch PRs + - job: tests + trigger: pull_request + packages: [buildah-fedora] + targets: + - fedora-all-x86_64 + 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 + + # Ignore until golang is updated in distro buildroot to 1.23.3+ + # Tests on CentOS Stream for main branch PRs + - job: tests + trigger: ignore + packages: [buildah-centos] + targets: + - centos-stream-9-x86_64 + - centos-stream-10-x86_64 + 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 + + # Sync to Fedora + - job: propose_downstream + trigger: release + packages: [buildah-fedora] + update_release: false + dist_git_branches: &fedora_targets + - fedora-all + + # Sync to CentOS Stream + - job: propose_downstream + trigger: release + packages: [buildah-centos] + update_release: false + dist_git_branches: + - c10s + + # Fedora Koji build + - job: koji_build + trigger: commit + packages: [buildah-fedora] + sidetag_group: podman-releases + # Dependents are not rpm dependencies, but the package whose bodhi update + # should include this package. + # Ref: https://packit.dev/docs/fedora-releases-guide/releasing-multiple-packages + dependents: + - podman + dist_git_branches: *fedora_targets diff --git a/README.packit b/README.packit new file mode 100644 index 0000000..b4b46e3 --- /dev/null +++ b/README.packit @@ -0,0 +1,3 @@ +This repository is maintained by packit. +https://packit.dev/ +The file was generated using packit 1.12.0.post1.dev20+g7d30dac21. diff --git a/buildah.spec b/buildah.spec index 6984b4e..9751b59 100644 --- a/buildah.spec +++ b/buildah.spec @@ -7,165 +7,74 @@ %global debug_package %{nil} %endif -%global provider github -%global provider_tld com -%global project containers -%global repo buildah -# https://github.com/containers/buildah -%global import_path %{provider}.%{provider_tld}/%{project}/%{repo} -%global git0 https://%{import_path} +%global gomodulesmode GO111MODULE=on -%global built_tag v1.29.0 -%global built_tag_strip %(b=%{built_tag}; echo ${b:1}) -%global gen_version %(b=%{built_tag_strip}; echo ${b/-/"~"}) +%if %{defined fedora} +%define build_with_btrfs 1 +%if 0%{?fedora} >= 43 +%define sequoia 1 +%endif +%endif -Name: %{repo} -Version: %{gen_version} -License: ASL 2.0 and BSD and MIT and MPLv2.0 +%if %{defined rhel} +%define fips 1 +%endif + +%global git0 https://github.com/containers/%{name} + +Name: buildah +# Set different Epoch for copr +%if %{defined copr_username} +Epoch: 102 +%else +Epoch: 2 +%endif +# DO NOT TOUCH the Version string! +# The TRUE source of this specfile is: +# https://github.com/containers/skopeo/blob/main/rpm/skopeo.spec +# 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.42.2 +# The `AND` needs to be uppercase in the License for SPDX compatibility +License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 Release: %autorelease +%if %{defined golang_arches_future} +ExclusiveArch: %{golang_arches_future} +%else +ExclusiveArch: aarch64 ppc64le s390x x86_64 +%endif Summary: A command line tool used for creating OCI Images URL: https://%{name}.io # Tarball fetched from upstream -Source: %{git0}/archive/%{built_tag}.tar.gz -BuildRequires: go-md2man +Source: %{git0}/archive/v%{version}.tar.gz BuildRequires: device-mapper-devel BuildRequires: git-core BuildRequires: golang >= 1.16.6 BuildRequires: glib2-devel BuildRequires: glibc-static +%if !%{defined gobuild} BuildRequires: go-rpm-macros +%endif BuildRequires: gpgme-devel BuildRequires: libassuan-devel BuildRequires: make -BuildRequires: ostree-devel +%if %{defined build_with_btrfs} BuildRequires: btrfs-progs-devel +%endif BuildRequires: shadow-utils-subid-devel -%if 0%{?fedora} > 37 -Requires: containers-common-extra >= 4:1-78 -%else -%if 0%{?fedora} == 37 -Requires: containers-common-extra >= 4:1-73 -%else -Requires: containers-common-extra >= 4:1-62 -%endif -%endif +BuildRequires: sqlite-devel +Requires: containers-common-extra +%if %{defined fedora} BuildRequires: libseccomp-static +%else +BuildRequires: libseccomp-devel +%endif Requires: libseccomp >= 2.4.1-0 Suggests: cpp -# awk '{print "Provides: bundled(golang("$1")) = "$2}' go.mod | sort | uniq | sed -e 's/-/_/g' -e '/bundled(golang())/d' -e '/bundled(golang(go\|module\|replace\|require))/d' -Provides: bundled(golang(github.com/Azure/go_ansiterm)) = v0.0.0_20210617225240_d185dfc1b5a1 -Provides: bundled(golang(github.com/BurntSushi/toml)) = v1.2.1 -Provides: bundled(golang(github.com/Microsoft/go_winio)) = v0.6.0 -Provides: bundled(golang(github.com/Microsoft/hcsshim)) = v0.9.6 -Provides: bundled(golang(github.com/VividCortex/ewma)) = v1.2.0 -Provides: bundled(golang(github.com/acarl005/stripansi)) = v0.0.0_20180116102854_5a71ef0e047d -Provides: bundled(golang(github.com/asaskevich/govalidator)) = v0.0.0_20210307081110_f21760c49a8d -Provides: bundled(golang(github.com/blang/semver/v4)) = v4.0.0 -Provides: bundled(golang(github.com/chzyer/readline)) = v1.5.1 -Provides: bundled(golang(github.com/container_orchestrated_devices/container_device_interface)) = v0.5.3 -Provides: bundled(golang(github.com/containerd/cgroups)) = v1.0.4 -Provides: bundled(golang(github.com/containerd/containerd)) = v1.6.15 -Provides: bundled(golang(github.com/containerd/stargz_snapshotter/estargz)) = v0.13.0 -Provides: bundled(golang(github.com/containernetworking/cni)) = v1.1.2 -Provides: bundled(golang(github.com/containernetworking/plugins)) = v1.2.0 -Provides: bundled(golang(github.com/containers/common)) = v0.51.0 -Provides: bundled(golang(github.com/containers/image/v5)) = v5.24.0 -Provides: bundled(golang(github.com/containers/libtrust)) = v0.0.0_20230121012942_c1716e8a8d01 -Provides: bundled(golang(github.com/containers/ocicrypt)) = v1.1.7 -Provides: bundled(golang(github.com/containers/storage)) = v1.45.3 -Provides: bundled(golang(github.com/cyberphone/json_canonicalization)) = v0.0.0_20220623050100_57a0ce2678a7 -Provides: bundled(golang(github.com/cyphar/filepath_securejoin)) = v0.2.3 -Provides: bundled(golang(github.com/davecgh/go_spew)) = v1.1.1 -Provides: bundled(golang(github.com/disiqueira/gotree/v3)) = v3.0.2 -Provides: bundled(golang(github.com/docker/distribution)) = v2.8.1+incompatible -Provides: bundled(golang(github.com/docker/docker)) = v20.10.23+incompatible -Provides: bundled(golang(github.com/docker/docker_credential_helpers)) = v0.7.0 -Provides: bundled(golang(github.com/docker/go_connections)) = v0.4.1_0.20210727194412_58542c764a11 -Provides: bundled(golang(github.com/docker/go_units)) = v0.5.0 -Provides: bundled(golang(github.com/fsnotify/fsnotify)) = v1.6.0 -Provides: bundled(golang(github.com/fsouza/go_dockerclient)) = v1.9.3 -Provides: bundled(golang(github.com/ghodss/yaml)) = v1.0.0 -Provides: bundled(golang(github.com/go_openapi/analysis)) = v0.21.4 -Provides: bundled(golang(github.com/go_openapi/errors)) = v0.20.3 -Provides: bundled(golang(github.com/go_openapi/jsonpointer)) = v0.19.5 -Provides: bundled(golang(github.com/go_openapi/jsonreference)) = v0.20.0 -Provides: bundled(golang(github.com/go_openapi/loads)) = v0.21.2 -Provides: bundled(golang(github.com/go_openapi/runtime)) = v0.24.1 -Provides: bundled(golang(github.com/go_openapi/spec)) = v0.20.7 -Provides: bundled(golang(github.com/go_openapi/strfmt)) = v0.21.3 -Provides: bundled(golang(github.com/go_openapi/swag)) = v0.22.3 -Provides: bundled(golang(github.com/go_openapi/validate)) = v0.22.0 -Provides: bundled(golang(github.com/gogo/protobuf)) = v1.3.2 -Provides: bundled(golang(github.com/golang/groupcache)) = v0.0.0_20210331224755_41bb18bfe9da -Provides: bundled(golang(github.com/golang/protobuf)) = v1.5.2 -Provides: bundled(golang(github.com/google/go_cmp)) = v0.5.9 -Provides: bundled(golang(github.com/google/go_containerregistry)) = v0.12.1 -Provides: bundled(golang(github.com/google/go_intervals)) = v0.0.2 -Provides: bundled(golang(github.com/google/uuid)) = v1.3.0 -Provides: bundled(golang(github.com/gorilla/mux)) = v1.8.0 -Provides: bundled(golang(github.com/hashicorp/errwrap)) = v1.1.0 -Provides: bundled(golang(github.com/hashicorp/go_multierror)) = v1.1.1 -Provides: bundled(golang(github.com/imdario/mergo)) = v0.3.13 -Provides: bundled(golang(github.com/inconshreveable/mousetrap)) = v1.0.1 -Provides: bundled(golang(github.com/jinzhu/copier)) = v0.3.5 -Provides: bundled(golang(github.com/josharian/intern)) = v1.0.0 -Provides: bundled(golang(github.com/json_iterator/go)) = v1.1.12 -Provides: bundled(golang(github.com/klauspost/compress)) = v1.15.15 -Provides: bundled(golang(github.com/klauspost/pgzip)) = v1.2.6_0.20220930104621_17e8dac29df8 -Provides: bundled(golang(github.com/letsencrypt/boulder)) = v0.0.0_20221109233200_85aa52084eaf -Provides: bundled(golang(github.com/mailru/easyjson)) = v0.7.7 -Provides: bundled(golang(github.com/manifoldco/promptui)) = v0.9.0 -Provides: bundled(golang(github.com/mattn/go_runewidth)) = v0.0.14 -Provides: bundled(golang(github.com/mattn/go_shellwords)) = v1.0.12 -Provides: bundled(golang(github.com/miekg/pkcs11)) = v1.1.1 -Provides: bundled(golang(github.com/mistifyio/go_zfs/v3)) = v3.0.0 -Provides: bundled(golang(github.com/mitchellh/mapstructure)) = v1.5.0 -Provides: bundled(golang(github.com/moby/sys/mount)) = v0.3.3 -Provides: bundled(golang(github.com/moby/sys/mountinfo)) = v0.6.2 -Provides: bundled(golang(github.com/moby/term)) = v0.0.0_20210619224110_3f7ff695adc6 -Provides: bundled(golang(github.com/modern_go/concurrent)) = v0.0.0_20180306012644_bacd9c7ef1dd -Provides: bundled(golang(github.com/modern_go/reflect2)) = v1.0.2 -Provides: bundled(golang(github.com/morikuni/aec)) = v1.0.0 -Provides: bundled(golang(github.com/nxadm/tail)) = v1.4.8 -Provides: bundled(golang(github.com/oklog/ulid)) = v1.3.1 -Provides: bundled(golang(github.com/onsi/ginkgo)) = v1.16.5 -Provides: bundled(golang(github.com/onsi/gomega)) = v1.26.0 -Provides: bundled(golang(github.com/opencontainers/go_digest)) = v1.0.0 -Provides: bundled(golang(github.com/opencontainers/image_spec)) = v1.1.0_rc2 -Provides: bundled(golang(github.com/opencontainers/runc)) = v1.1.4 -Provides: bundled(golang(github.com/opencontainers/runtime_spec)) = v1.0.3_0.20220825212826_86290f6a00fb -Provides: bundled(golang(github.com/opencontainers/runtime_tools)) = v0.9.1_0.20221014010322_58c91d646d86 -Provides: bundled(golang(github.com/opencontainers/selinux)) = v1.10.2 -Provides: bundled(golang(github.com/openshift/imagebuilder)) = v1.2.4_0.20220711175835_4151e43600df -Provides: bundled(golang(github.com/ostreedev/ostree_go)) = v0.0.0_20210805093236_719684c64e4f -Provides: bundled(golang(github.com/pkg/errors)) = v0.9.1 -Provides: bundled(golang(github.com/pmezard/go_difflib)) = v1.0.0 -Provides: bundled(golang(github.com/proglottis/gpgme)) = v0.1.3 -Provides: bundled(golang(github.com/rivo/uniseg)) = v0.4.3 -Provides: bundled(golang(github.com/seccomp/libseccomp_golang)) = v0.10.0 -Provides: bundled(golang(github.com/sigstore/fulcio)) = v1.0.0 -Provides: bundled(golang(github.com/sigstore/rekor)) = v1.0.1 -Provides: bundled(golang(github.com/sigstore/sigstore)) = v1.5.1 -Provides: bundled(golang(github.com/sirupsen/logrus)) = v1.9.0 -Provides: bundled(golang(github.com/spf13/cobra)) = v1.6.1 -Provides: bundled(golang(github.com/spf13/pflag)) = v1.0.5 -Provides: bundled(golang(github.com/stefanberger/go_pkcs11uri)) = v0.0.0_20201008174630_78d3cae3a980 -Provides: bundled(golang(github.com/stretchr/testify)) = v1.8.1 -Provides: bundled(golang(github.com/sylabs/sif/v2)) = v2.9.0 -Provides: bundled(golang(github.com/syndtr/gocapability)) = v0.0.0_20200815063812_42c35b437635 -Provides: bundled(golang(github.com/tchap/go_patricia)) = v2.3.0+incompatible -Provides: bundled(golang(github.com/theupdateframework/go_tuf)) = v0.5.2_0.20221207161717_9cb61d6e65f5 -Provides: bundled(golang(github.com/titanous/rocacheck)) = v0.0.0_20171023193734_afe73141d399 -Provides: bundled(golang(github.com/ulikunitz/xz)) = v0.5.11 -Provides: bundled(golang(github.com/vbatts/tar_split)) = v0.11.2 -Provides: bundled(golang(github.com/vbauerster/mpb/v7)) = v7.5.3 -Provides: bundled(golang(github.com/vishvananda/netlink)) = v1.2.1_beta.2 -Provides: bundled(golang(github.com/vishvananda/netns)) = v0.0.0_20210104183010_2eb08e3e575f -Provides: bundled(golang(github.com/xeipuuv/gojsonpointer)) = v0.0.0_20190905194746_02993c407bfb -Provides: bundled(golang(github.com/xeipuuv/gojsonreference)) = v0.0.0_20180127040603_bd5ef7bd5415 -Provides: bundled(golang(github.com/xeipuuv/gojsonschema)) = v1.2.0 -Provides: bundled(golang(k8s.io/klog)) = v1.0.0 -Provides: bundled(golang(sigs.k8s.io/yaml)) = v1.3.0 +%if %{defined sequoia} +Requires: podman-sequoia +%endif %description The %{name} package provides a command line tool which can be used to @@ -176,11 +85,17 @@ or * save container's root file system layer to create a new image * delete a working container or an image +# This subpackage is only intended for CI testing. +# Not meant for end user/customer usage. %package tests Summary: Tests for %{name} -Requires: %{name} = %{version}-%{release} +Requires: %{name} = %{epoch}:%{version}-%{release} +%if %{defined bats_epel} Requires: bats +%else +Recommends: bats +%endif Requires: bzip2 Requires: podman Requires: golang @@ -196,10 +111,12 @@ Requires: git-daemon This package contains system tests for %{name} %prep -%autosetup -Sgit -n %{name}-%{built_tag_strip} +%autosetup -Sgit -n %{name}-%{version} %build %set_build_flags +export CGO_CFLAGS=$CFLAGS + # These extra flags present in $CFLAGS have been skipped for now as they break the build CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-flto=auto//g') CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-Wp,D_GLIBCXX_ASSERTIONS//g') @@ -209,44 +126,57 @@ CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-specs=\/usr\/lib\/rpm\/redhat\/redhat-an export CGO_CFLAGS+=" -m64 -mtune=generic -fcf-protection=full" %endif -export GOPATH=$(pwd)/_build:$(pwd) -export CGO_CFLAGS=$CFLAGS - -mkdir _build -cd _build -mkdir -p src/%{provider}.%{provider_tld}/%{project} -ln -s ../../../../ src/%{import_path} -cd .. - -mv vendor src - export CNI_VERSION=`grep '^# github.com/containernetworking/cni ' src/modules.txt | sed 's,.* ,,'` export LDFLAGS="-X main.buildInfo=`date +%s` -X main.cniVersion=${CNI_VERSION}" -export BUILDTAGS='seccomp exclude_graphdriver_devicemapper' -export BUILDTAGS+=' libsubid selinux' -%gobuild -o bin/%{name} %{import_path}/cmd/%{name} -%gobuild -o bin/imgtype %{import_path}/tests/imgtype -%gobuild -o bin/copy %{import_path}/tests/copy -%gobuild -o bin/tutorial %{import_path}/tests/tutorial -GOMD2MAN=go-md2man %{__make} -C docs +export BUILDTAGS="seccomp $(hack/systemd_tag.sh) $(hack/libsubid_tag.sh) libsqlite3" +%if !%{defined build_with_btrfs} +export BUILDTAGS+=" exclude_graphdriver_btrfs" +%endif + +%if %{defined fips} +export BUILDTAGS+=" libtrust_openssl" +%endif + +%if %{defined sequoia} +export BUILDTAGS+=" containers_image_sequoia" +%endif + +%gobuild -o bin/%{name} ./cmd/%{name} +%gobuild -o bin/imgtype ./tests/imgtype +%gobuild -o bin/copy ./tests/copy +%gobuild -o bin/tutorial ./tests/tutorial +%gobuild -o bin/inet ./tests/inet +%gobuild -o bin/dumpspec ./tests/dumpspec +%gobuild -o bin/passwd ./tests/passwd +%gobuild -o bin/crash ./tests/crash +%gobuild -o bin/wait ./tests/wait +%{__make} docs %install -export GOPATH=$(pwd)/_build:$(pwd) make DESTDIR=%{buildroot} PREFIX=%{_prefix} install install.completions -make DESTDIR=%{buildroot} PREFIX=%{_prefix} -C docs install install -d -p %{buildroot}/%{_datadir}/%{name}/test/system cp -pav tests/. %{buildroot}/%{_datadir}/%{name}/test/system cp bin/imgtype %{buildroot}/%{_bindir}/%{name}-imgtype cp bin/copy %{buildroot}/%{_bindir}/%{name}-copy cp bin/tutorial %{buildroot}/%{_bindir}/%{name}-tutorial +cp bin/inet %{buildroot}/%{_bindir}/%{name}-inet +cp bin/dumpspec %{buildroot}/%{_bindir}/%{name}-dumpspec +cp bin/passwd %{buildroot}/%{_bindir}/%{name}-passwd +cp bin/crash %{buildroot}/%{_bindir}/%{name}-crash +cp bin/wait %{buildroot}/%{_bindir}/%{name}-wait + +rm %{buildroot}%{_datadir}/%{name}/test/system/tools/build/* #define license tag if not already defined %{!?_licensedir:%global license %doc} +# Include check to silence rpmlint. +%check + %files -%license LICENSE +%license LICENSE vendor/modules.txt %doc README.md %{_bindir}/%{name} %{_mandir}/man1/%{name}* @@ -259,6 +189,11 @@ cp bin/tutorial %{buildroot}/%{_bindir}/%{name}-tutorial %{_bindir}/%{name}-imgtype %{_bindir}/%{name}-copy %{_bindir}/%{name}-tutorial +%{_bindir}/%{name}-inet +%{_bindir}/%{name}-dumpspec +%{_bindir}/%{name}-passwd +%{_bindir}/%{name}-crash +%{_bindir}/%{name}-wait %{_datadir}/%{name}/test %changelog diff --git a/gating.yaml b/gating.yaml index c8a218f..1fb3172 100644 --- a/gating.yaml +++ b/gating.yaml @@ -1,14 +1,16 @@ --- !Policy product_versions: - fedora-* -decision_context: bodhi_update_push_stable +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: - - fedora-* -decision_context: bodhi_update_push_testing -subject_type: koji_build + - rhel-* +decision_context: osci_compose_gate rules: - - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} + - !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/sources b/sources index 941b455..c210586 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v1.29.0.tar.gz) = 9d5dfe46007aeb9b7ae80a804b20c45b149156ec5edeb181ec00c021a0b6499394d676a7189389e51c2968fc60680c6d8438c11f46f5b7d523fba00d7cf17894 +SHA512 (v1.42.2.tar.gz) = adb1de700db9b589639f6fd02cad95d9bedacb9d0363838315f33c978a8c900570d55af95073992ff69cff4f2a9d18776c5d786af294aaa1604144580c957414 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..eb6b766 --- /dev/null +++ b/tests/tmt/system.fmf @@ -0,0 +1,24 @@ +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 + DUMPSPEC_BINARY: /usr/bin/buildah-dumpspec + PASSWD_BINARY: /usr/bin/buildah-passwd + TMPDIR: /var/tmp + +adjust: + - when: initiator != "packit" + environment+: + RELEASE_TESTING: true + +/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