Skip to content

Commit

Permalink
[skip-ci] [IGNORE] tmt for downstream gating sync
Browse files Browse the repository at this point in the history
Signed-off-by: Lokesh Mandvekar <[email protected]>
  • Loading branch information
lsm5 committed Nov 27, 2024
1 parent ceee7cb commit 1276d46
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 13 deletions.
66 changes: 60 additions & 6 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@
downstream_package_name: podman
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
- src: .fmf/
dest: .fmf/
delete: true
- .packit.yaml

packages:
podman-fedora:
pkg_tool: fedpkg
Expand All @@ -31,18 +47,18 @@ jobs:
failure_comment:
message: "Ephemeral COPR build failed. @containers/packit-build please check."
enable_net: true
targets:
targets: &fedora_copr_targets
- fedora-development-x86_64
- fedora-development-aarch64
- fedora-latest-x86_64
- fedora-latest-aarch64
- fedora-latest-stable-x86_64
- fedora-latest-stable-aarch64
#- fedora-latest-stable-x86_64
#- fedora-latest-stable-aarch64
- fedora-40-x86_64
- fedora-40-aarch64

- job: copr_build
trigger: pull_request
trigger: ignore
packages: [podman-eln]
notifications: *packit_build_failure_notification
enable_net: true
Expand All @@ -59,7 +75,7 @@ jobs:
packages: [podman-centos]
notifications: *packit_build_failure_notification
enable_net: true
targets:
targets: &centos_copr_targets
- centos-stream-9-x86_64
- centos-stream-9-aarch64
- centos-stream-10-x86_64
Expand All @@ -78,9 +94,47 @@ jobs:
enable_net: true

- job: tests
identifier: cockpit-revdeps
trigger: pull_request
packages: [podman-fedora]
targets: *fedora_copr_targets
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

- job: tests
trigger: pull_request
packages: [podman-fedora]
targets: *fedora_copr_targets
require:
label:
present:
- release

- job: tests
trigger: pull_request
packages: [podman-centos]
targets: *centos_copr_targets
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

- job: tests
trigger: pull_request
packages: [podman-centos]
targets: *centos_copr_targets
require:
label:
present:
- release

- job: tests
identifier: cockpit-revdeps
trigger: ignore
packages: [podman-fedora]
notifications:
failure_comment:
message: "Cockpit tests failed for commit {commit_sha}. @martinpitt, @jelly, @mvollmer please check."
Expand Down
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ SED=sed
GREP=grep
MAN_L= man -l
endif
PODMAN ?= $(CURDIR)/bin/podman
PODMAN_REMOTE ?= $(CURDIR)/bin/podman-remote
QUADLET ?= $(CURDIR)/bin/quadlet

# This isn't what we actually build; it's a superset, used for target
# dependencies. Basically: all *.go and *.c files, except *_test.go,
Expand Down Expand Up @@ -706,8 +709,8 @@ localmachine:
localsystem:
# Wipe existing config, database, and cache: start with clean slate.
$(RM) -rf ${HOME}/.local/share/containers ${HOME}/.config/containers
PODMAN=$(CURDIR)/bin/podman QUADLET=$(CURDIR)/bin/quadlet bats -T --filter-tags '!ci:parallel' test/system/
PODMAN=$(CURDIR)/bin/podman QUADLET=$(CURDIR)/bin/quadlet bats -T --filter-tags ci:parallel -j $$(nproc) test/system/
PODMAN=$(PODMAN) QUADLET=$(QUADLET) bats -T --filter-tags '!ci:parallel' test/system/
PODMAN=$(PODMAN) QUADLET=$(QUADLET) bats -T --filter-tags ci:parallel -j $$(nproc) test/system/

.PHONY: remotesystem
remotesystem:
Expand All @@ -724,20 +727,20 @@ remotesystem:
echo "Error: podman system service (not ours) is already running" >&2;\
exit 1;\
fi;\
./bin/podman system service --timeout=0 > $(if $(PODMAN_SERVER_LOG),$(PODMAN_SERVER_LOG),/dev/null) 2>&1 & \
$(PODMAN) system service --timeout=0 > $(if $(PODMAN_SERVER_LOG),$(PODMAN_SERVER_LOG),/dev/null) 2>&1 & \
retry=5;\
while [ $$retry -ge 0 ]; do\
echo Waiting for server...;\
sleep 1;\
./bin/podman-remote info >/dev/null 2>&1 && break;\
$(PODMAN_REMOTE) info >/dev/null 2>&1 && break;\
retry=$$(expr $$retry - 1);\
done;\
if [ $$retry -lt 0 ]; then\
echo "Error: ./bin/podman system service did not come up" >&2;\
echo "Error: $(PODMAN) system service did not come up" >&2;\
exit 1;\
fi;\
env PODMAN="$(CURDIR)/bin/podman-remote" bats -T --filter-tags '!ci:parallel' test/system/ ;\
env PODMAN="$(CURDIR)/bin/podman-remote" bats -T --filter-tags ci:parallel -j $$(nproc) test/system/ ;\
env PODMAN="$(PODMAN_REMOTE)" bats -T --filter-tags '!ci:parallel' test/system/ ;\
env PODMAN="$(PODMAN_REMOTE)" bats -T --filter-tags ci:parallel -j $$(nproc) test/system/ ;\
rc=$$?;\
kill %1;\
else \
Expand Down
31 changes: 31 additions & 0 deletions plans/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
discover:
how: fmf
execute:
how: tmt
prepare:
- how: feature
epel: enabled
- how: shell
script:
useradd rootlessu
loginctl enable-linger rootlessu
chown -R rootlessu:rootlessu /var

/upstream:
summary: Run tests on upstream PRs
discover+:
filter: tag:upstream
adjust+:
enabled: false
when: initiator is not defined or initiator != packit

/downstream:
summary: Run tests on bodhi / errata and dist-git PRs
discover+:
filter: tag:downstream
dist-git-install-builddeps: true
dist-git-source: true
dist-git-remove-fmf-root: true
adjust+:
enabled: false
when: initiator == packit
37 changes: 37 additions & 0 deletions test/system/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
require:
- bats
- golang
- httpd-tools
- make
- slirp4netns
- socat

environment:
PODMAN: /usr/bin/podman
PODMAN_REMOTE: /usr/bin/podman-remote
PODMAN_TESTING: /usr/bin/podman-testing
QUADLET: /usr/libexec/podman/quadlet

/local-root:
tag: [ downstream, upstream, centos, fedora, local, rootful ]
summary: rootful test
test: make -C ../.. localsystem
duration: 60m

/local-rootless:
tag: [ downstream, upstream, centos, fedora, local, rootless ]
summary: rootless test
test: runuser fedora -c 'make -C ../.. localsystem'
duration: 60m

/remote-root:
tag: [ downstream, upstream, centos, fedora, remote, rootful ]
summary: remote rootful test
test: make -C ../.. remotesystem
duration: 60m

/remote-rootless:
tag: [ downstream, upstream, centos, fedora, remote, rootless ]
summary: remote rootless test
test: runuser fedora -c 'make -C ../.. remotesystem'
duration: 60m
6 changes: 6 additions & 0 deletions test/tmt/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tag: [centos]
summary: Make sure that container provision works
require:
- tmt+provision-container
test:
tmt run --verbose --remove provision --how container --image fedora login --command 'cat /etc/os-release' finish

0 comments on commit 1276d46

Please sign in to comment.