sync tests with upstream
Resolves: RHEL-69441 Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
This commit is contained in:
		
							parent
							
								
									4270056ea6
								
							
						
					
					
						commit
						f187d567c5
					
				| @ -2,17 +2,23 @@ discover: | |||||||
|     how: fmf |     how: fmf | ||||||
| execute: | execute: | ||||||
|     how: tmt |     how: tmt | ||||||
| prepare: |  | ||||||
|     how: shell |  | ||||||
|     script: cp -f $TMT_TREE/test/tag-repository.repo /etc/yum.repos.d/. |  | ||||||
| adjust: | adjust: | ||||||
|     - when: initiator == packit |     - when: initiator == packit | ||||||
|       because: "We need to test with updated packages from rhcontainerbot/podman-next copr" |       because: "We need to test with updated packages from rhcontainerbot/podman-next copr" | ||||||
|       prepare+: |       prepare+: | ||||||
|         how: shell |         how: shell | ||||||
|         script: sed -i -n '/^priority=/!p;$apriority=5' /etc/yum.repos.d/*:rhcontainerbot:podman-next.repo |         script: | | ||||||
|     - when: distro == centos-stream or distro == rhel |             sed -i -n '/^priority=/!p;$apriority=1' /etc/yum.repos.d/*podman-next*.repo | ||||||
|       because: "bats package is present in epel" |             dnf -y upgrade --allowerasing | ||||||
|  |     # FIXME: Use epel10 once bats is available there | ||||||
|  |     - when: distro == centos-stream-10 or distro == rhel-10 | ||||||
|  |       because: "bats isn't yet available on epel10" | ||||||
|  |       prepare+: | ||||||
|  |         how: install | ||||||
|  |         copr: rhcontainerbot/bats-el10 | ||||||
|  |         package: bats | ||||||
|  |     - when: distro == centos-stream-9 or distro == rhel-9 | ||||||
|  |       because: "bats is present on EPEL on rhel9 / c9s" | ||||||
|       prepare+: |       prepare+: | ||||||
|         how: feature |         how: feature | ||||||
|         epel: enabled |         epel: enabled | ||||||
| @ -22,13 +28,13 @@ adjust: | |||||||
|     discover+: |     discover+: | ||||||
|         filter: tag:upstream |         filter: tag:upstream | ||||||
|     adjust+: |     adjust+: | ||||||
|         - when: initiator is not defined or initiator != packit |         - enabled: false | ||||||
|           enabled: false |           when: initiator is not defined or initiator != packit | ||||||
| 
 | 
 | ||||||
| /downstream: | /downstream: | ||||||
|     summary: Run SELinux specific Podman tests on bodhi / errata and dist-git PRs |     summary: Run SELinux specific Podman tests on bodhi / errata and dist-git PRs | ||||||
|     discover+: |     discover+: | ||||||
|         filter: tag:downstream |         filter: tag:downstream | ||||||
|     adjust+: |     adjust+: | ||||||
|         - when: initiator == packit |         - enabled: false | ||||||
|           enabled: false |           when: initiator == packit | ||||||
|  | |||||||
| @ -1,11 +1,11 @@ | |||||||
| # Only common dependencies that are NOT required to run podman-tests.sh are |  | ||||||
| # specified here. Everything else is in podman-tests.sh. |  | ||||||
| require: | require: | ||||||
|     - bats |     - bats | ||||||
|     - container-selinux |     - container-selinux | ||||||
|     - cpio |     - cpio | ||||||
|     - golang |     - golang | ||||||
|     - make |     - make | ||||||
|  |     - podman | ||||||
|  |     - podman-tests | ||||||
|     - policycoreutils |     - policycoreutils | ||||||
| 
 | 
 | ||||||
| /basic_check: | /basic_check: | ||||||
| @ -13,11 +13,6 @@ require: | |||||||
|     summary: Run basic checks |     summary: Run basic checks | ||||||
|     test: make basic_check |     test: make basic_check | ||||||
| 
 | 
 | ||||||
| /podman_e2e_test: |  | ||||||
|     tag: [ upstream, downstream ] |  | ||||||
|     summary: Run SELinux specific Podman e2e tests |  | ||||||
|     test: make podman_e2e_test |  | ||||||
| 
 |  | ||||||
| /podman_system_test: | /podman_system_test: | ||||||
|     tag: [ upstream, downstream ] |     tag: [ upstream, downstream ] | ||||||
|     summary: Run SELinux specific Podman system tests |     summary: Run SELinux specific Podman system tests | ||||||
|  | |||||||
| @ -9,64 +9,8 @@ if [[ "$(id -u)" -ne 0 ]];then | |||||||
|     exit 1 |     exit 1 | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [[ -z "$1" ]]; then |  | ||||||
|     echo -e "Usage: $(basename ${BASH_SOURCE[0]}) TEST_TYPE\nTEST_TYPE can be 'e2e' or 'system'\n" |  | ||||||
|     exit 1 |  | ||||||
| fi |  | ||||||
| 
 |  | ||||||
| TEST_TYPE=$1 |  | ||||||
| 
 |  | ||||||
| # Fetch and extract latest podman source from the highest priority dnf repo |  | ||||||
| # NOTE: On upstream pull-requests, the srpm will be fetched from the |  | ||||||
| # podman-next copr while on bodhi updates, it will be fetched from Fedora's |  | ||||||
| # official repos. |  | ||||||
| PODMAN_DIR=$(mktemp -d) |  | ||||||
| pushd $PODMAN_DIR |  | ||||||
| 
 |  | ||||||
| # Download podman and podman-tests rpms, along with podman srpm |  | ||||||
| dnf download podman podman-tests |  | ||||||
| # Download srpm, srpm opts differ between dnf and dnf5 |  | ||||||
| rpm -q dnf5 && dnf download --srpm podman || dnf download --source podman |  | ||||||
| 
 |  | ||||||
| # Ensure podman-tests RPM and podman SRPM version-release match |  | ||||||
| # NOTE: podman RPM and podman-tests RPM matching is ensured by podman.spec so |  | ||||||
| # matching podman-tests and podman srpm is sufficient here. |  | ||||||
| PODMAN_TESTS_VERSION=$(ls podman-tests* | sed -e "s/.$(uname -m).rpm//" -e "s/podman-tests-//") |  | ||||||
| PODMAN_SRPM_VERSION=$(ls podman*.src.rpm | sed -e "s/.src.rpm//" -e "s/podman-//") |  | ||||||
| if [[ "$PODMAN_TESTS_VERSION" != "$PODMAN_SRPM_VERSION" ]]; then |  | ||||||
|     echo "podman-tests and podman srpm version-release don't match" |  | ||||||
|     exit 1 |  | ||||||
| fi |  | ||||||
| 
 |  | ||||||
| # Install downloaded podman and podman-tests rpms |  | ||||||
| dnf -y install ./podman*.$(uname -m).rpm |  | ||||||
| 
 |  | ||||||
| # Extract and untar podman source from srpm |  | ||||||
| rpm2cpio $(ls podman*.src.rpm) | cpio -di |  | ||||||
| # podman.spec on CentOS Stream fetches multiple source tarballs |  | ||||||
| for file in *.tar.gz; do tar -zxf "$file"; done |  | ||||||
| 
 |  | ||||||
| popd |  | ||||||
| 
 |  | ||||||
| # Print versions of distro and installed packages | # Print versions of distro and installed packages | ||||||
| rpm -q bats container-selinux golang podman podman-tests selinux-policy | rpm -q bats container-selinux golang podman podman-tests selinux-policy | ||||||
| 
 | 
 | ||||||
| if [[ "$TEST_TYPE" == "e2e" ]]; then | # Run podman system tests | ||||||
|     # /tmp is often unsufficient | bats /usr/share/podman/test/system/410-selinux.bats | ||||||
|     export TMPDIR=/var/tmp |  | ||||||
| 
 |  | ||||||
|     # dnf5 contains breaking changes |  | ||||||
|     # Either of `dnf` OR `dnf5` will be installed, never both. |  | ||||||
|     # To fetch srpm, dnf uses `--source`, dnf5 uses `--srpm`. |  | ||||||
|     #rpm -q dnf5 && SRPM_OPTS="--srpm" || SRPM_OPTS="--source" |  | ||||||
| 
 |  | ||||||
|     # Run podman e2e tests |  | ||||||
|     pushd $PODMAN_DIR/podman-*/test/e2e |  | ||||||
|     PODMAN_BINARY=/usr/bin/podman go test -v config.go config_amd64.go common_test.go libpod_suite_test.go run_selinux_test.go |  | ||||||
|     popd |  | ||||||
| fi |  | ||||||
| 
 |  | ||||||
| if [[ "$TEST_TYPE" == "system" ]]; then |  | ||||||
|     # Run podman system tests |  | ||||||
|     bats /usr/share/podman/test/system/410-selinux.bats |  | ||||||
| fi |  | ||||||
|  | |||||||
| @ -1,10 +0,0 @@ | |||||||
| [testing-farm-tag-repository] |  | ||||||
| name=Tag repository for c9s-build |  | ||||||
| baseurl=https://kojihub.stream.centos.org/kojifiles/repos/c9s-build/latest/$basearch/ |  | ||||||
| gpgcheck=0 |  | ||||||
| enabled=1 |  | ||||||
| priority=9 |  | ||||||
| skip_if_unavailable=True |  | ||||||
| # See TFT-847 - glibc32* |  | ||||||
| # See TFT-1284 - beakerlib |  | ||||||
| exclude=glibc32* beakerlib |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user