From 6c5549e7e70411dff5e7788da6d5dd2aeb02dc9a Mon Sep 17 00:00:00 2001 From: James Antill Date: Mon, 20 Feb 2023 01:57:15 -0500 Subject: [PATCH] Import rpm: 708a8b988d519fee8866a122b39b0e8bc3c51bc0 --- .gitignore | 1 + cockpit-podman.spec | 264 ++++++++++++++++++++++++++++++++ gating.yaml | 6 + sources | 1 + tests/.gitignore | 3 + tests/browser.sh | 66 ++++++++ tests/roles/test/tasks/main.yml | 30 ++++ tests/run-test.sh | 31 ++++ tests/tests.yml | 6 + 9 files changed, 408 insertions(+) create mode 100644 .gitignore create mode 100644 cockpit-podman.spec create mode 100644 gating.yaml create mode 100644 sources create mode 100644 tests/.gitignore create mode 100755 tests/browser.sh create mode 100644 tests/roles/test/tasks/main.yml create mode 100755 tests/run-test.sh create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7bfcb8f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/cockpit-podman-46.tar.xz diff --git a/cockpit-podman.spec b/cockpit-podman.spec new file mode 100644 index 0000000..e01257a --- /dev/null +++ b/cockpit-podman.spec @@ -0,0 +1,264 @@ + +Name: cockpit-podman +Version: 46 +Release: 1%{?dist} +Summary: Cockpit component for Podman containers +License: LGPLv2+ +URL: https://github.com/cockpit-project/cockpit-podman + +Source0: https://github.com/cockpit-project/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz +BuildArch: noarch +BuildRequires: libappstream-glib +BuildRequires: make +BuildRequires: gettext +%if 0%{?rhel} && 0%{?rhel} <= 8 +BuildRequires: libappstream-glib-devel +%endif + +Requires: cockpit-bridge >= 138 +Requires: podman >= 2.0.4 + +%description +The Cockpit user interface for Podman containers. + +%prep +%setup -q -n %{name} + +%build +# Nothing to build + +%install +%make_install +appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/* + +%files +%doc README.md +%license LICENSE dist/index.js.LICENSE.txt.gz +%{_datadir}/cockpit/* +%{_datadir}/metainfo/* + +%changelog +* Mon Apr 25 2022 Jindrich Novy - 46-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/46 +- Related: #2061390 + +* Fri Mar 25 2022 Jindrich Novy - 44-3 +- use spec file from the upstream source +- Related: #2061390 + +* Thu Mar 24 2022 Jindrich Novy - 44-2 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/44 +- Related: #2061390 + +* Wed Mar 23 2022 Jindrich Novy - 44-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/44 +- Related: #2061390 + +* Mon Mar 07 2022 Jindrich Novy - 43-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/43 +- Related: #2061390 + +* Thu Feb 17 2022 Jindrich Novy - 42-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/42 +- Related: #2001445 + +* Thu Feb 03 2022 Jindrich Novy - 41-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/41 +- Related: #2001445 + +* Mon Jan 24 2022 Jindrich Novy - 40-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/40 +- Related: #2001445 + +* Wed Jan 05 2022 Jindrich Novy - 39-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/39 +- Related: #2001445 + +* Fri Dec 10 2021 Jindrich Novy - 38-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/38 +- Related: #2001445 + +* Fri Nov 26 2021 Jindrich Novy - 37-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/37 +- Related: #2001445 + +* Fri Nov 12 2021 Jindrich Novy - 36-2 +- revert the ansible change to fix gating tests +- Related: #2001445 + +* Wed Nov 10 2021 Jindrich Novy - 36-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/36 +- Related: #2001445 + +* Fri Sep 17 2021 Jindrich Novy - 35-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/35 +- Related: #2001445 + +* Fri Sep 10 2021 Jindrich Novy - 34-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/34 +- Related: #2001445 + +* Thu Aug 05 2021 Jindrich Novy - 33-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/33 +- Related: #1934415 + +* Wed Jul 21 2021 Jindrich Novy - 32-2 +- attempt to fix gating tests - thanks for Matej Marusak +- Related: #1934415 + +* Mon Jul 05 2021 Jindrich Novy - 32-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/32 +- Related: #1934415 + +* Wed May 26 2021 Jindrich Novy - 31-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/31 +- Related: #1934415 + +* Mon Apr 26 2021 Jindrich Novy - 30-1 +- fix gating test failure for cockpit-podman +- Related: #1934415 + +* Thu Mar 11 2021 Jindrich Novy - 29-3 +- fix gating test failure for cockpit-podman +- Related: #1934415 + +* Thu Mar 04 2021 Jindrich Novy - 29-2 +- gating test fix - properly install browser +- Related: #1934415 + +* Mon Feb 22 2021 Jindrich Novy - 29-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/29 +- Related: #1883490 + +* Fri Feb 12 2021 Jindrich Novy - 28.1-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/28.1 +- Related: #1883490 + +* Wed Feb 10 2021 Jindrich Novy - 28-4 +- readd cockpit-system +Related: #1914884 + +* Mon Feb 08 2021 Jindrich Novy - 28-3 +- fix gating tests for cockpit-podman - thanks for Matej Marusak +- Related: #1883490 + +* Sat Feb 06 2021 Jindrich Novy - 28-2 +- remove applied patch and cockpit-shell dependency +- Related: #1883490 + +* Sat Feb 06 2021 Jindrich Novy - 28-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/28 +- Related: #1883490 + +* Mon Jan 18 2021 Jindrich Novy - 27.1-4 +- fix "Fix gating tests of container-tools for 8.4.0" +- Related: #1883490 + +* Fri Jan 15 2021 Jindrich Novy - 27.1-3 +- another gating test fix - don't remove all containers but only admin ones + thanks to Matej Marusak +- Related: #1883490 + +* Fri Jan 08 2021 Jindrich Novy - 27.1-2 +- gating tests - always set VM password +- Related: #1883490 + +* Thu Jan 07 2021 Jindrich Novy - 27.1-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/27.1 +- Related: #1883490 + +* Thu Jan 07 2021 Jindrich Novy - 27-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/27 +- Related: #1883490 + +* Thu Dec 10 2020 Jindrich Novy - 26-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/26 +- Related: #1883490 + +* Thu Dec 03 2020 Jindrich Novy - 25-4 +- replace docker.io with quay.io for gating tests due do + docker.io new pull rate limit requirements +- Related: #1883490 + +* Sat Nov 07 2020 Jindrich Novy - 25-3 +- test: Cleanup images before pulling the ones we need - thanks to Matej Marusak +- Related: #1883490 + +* Tue Nov 03 2020 Jindrich Novy - 25-2 +- remove hack in tests +- Related: #1883490 + +* Wed Oct 21 2020 Jindrich Novy - 25-1 +- synchronize with stream-container-tools-rhel8 +- Related: #1883490 + +* Sun Jul 26 2020 Jindrich Novy - 18.1-2 +- revert back to 18.1 as this version is aimed at 8.3.0 +- Related: #1821193 + +* Wed Jul 15 2020 Jindrich Novy - 19-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/19 +- Related: #1821193 + +* Wed Jul 15 2020 Martin Pitt - 18.1-1 +- Fix AppStream metainfo (rhbz#1854673) + +* Mon Jun 15 2020 Jindrich Novy - 18-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/v18 +- Related: #1821193 + +* Fri May 15 2020 Jindrich Novy - 17-1 +- update to https://github.com/cockpit-project/cockpit-podman/releases/tag/17 +- Related: #1821193 + +* Tue May 12 2020 Jindrich Novy - 16-1 +- synchronize containter-tools 8.3.0 with 8.2.1 +- Related: #1821193 + +* Mon Apr 20 2020 Matej Marusak - 15-1 +- Drop obsolete functionality for Fedora Atomic +- Localize dates and times +- Make tests non-destructive, to support gating +- Fix crash on filtering anonymous images +- Translation updates +- Show historical logs + +* Thu Jan 09 2020 Matej Marusak - 12-1 +- Configure CPU share for system containers +- Translation updates + +* Thu Nov 28 2019 Matej Marusak - 11-1 +- Fix Alert notification in Image Search Modal +- Allow more than a single Error Notification for Container action errors +- Various Alert cleanups +- Translation updates + +* Wed Nov 13 2019 Matej Marusak - 10-1 +- Support for user containers +- Show list of containers that use given image +- Show placeholder while loading containers and images +- Fix setting memory limit rhbz#1732713 +- Add container Terminal rhbz#1703245 + +* Wed Jun 26 2019 Martin Pitt - 4-1 +- Fix regression in container commit +- Fix AppStream ID rhbz#1734809 + +* Mon Jun 17 2019 Martin Pitt - 3-1 +- Enable Commit button for running containers +- Fix race condition with container deletion +- Stop fetching all containers/images for each container/image event + +* Sun Jun 09 2019 Martin Pitt - 2-2 +- Fix podman dependency + +* Mon May 27 2019 Martin Pitt - 2-1 +- Update to upstream 2 release +- Support podman API 1.3 +- Support running commands with arguments +- Show the default command coming from image +- Implement filtering of images and containers + +* Wed Apr 17 2019 Cockpit Project - 1-2 +- Update to upstream 1 release + diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..6985029 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-8 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/sources b/sources new file mode 100644 index 0000000..b5d5aae --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA1 (cockpit-podman-46.tar.xz) = 5cf3f0ffa1d07ae2b2ce5852cb2153062ea3e988 diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..eae05e5 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,3 @@ +*.retry +artifacts/ +source/ diff --git a/tests/browser.sh b/tests/browser.sh new file mode 100755 index 0000000..2eb957f --- /dev/null +++ b/tests/browser.sh @@ -0,0 +1,66 @@ +#!/bin/sh +set -eux + +# from standard-test-source +SOURCE="$(pwd)/source" +LOGS="$(pwd)/logs" +TESTS="$(pwd)/tests" +mkdir -p "$LOGS" +chmod a+w "$LOGS" + +# install browser; on RHEL, use chromium from epel +# HACK: chromium-headless ought to be enough, but version 88 has a crash: https://bugs.chromium.org/p/chromium/issues/detail?id=1170634 +if ! rpm -q chromium; then + if grep -q 'ID=.*rhel' /etc/os-release; then + dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm + dnf config-manager --enable epel + fi + dnf install -y chromium +fi + +# create user account for logging in +if ! id admin 2>/dev/null; then + useradd -c Administrator -G wheel admin + echo admin:foobar | chpasswd +fi + +# set root's password +echo root:foobar | chpasswd + +# avoid sudo lecture during tests +su -c 'echo foobar | sudo --stdin whoami' - admin + +# create user account for running the test +if ! id runtest 2>/dev/null; then + useradd -c 'Test runner' runtest + # allow test to set up things on the machine + mkdir -p /root/.ssh + curl https://raw.githubusercontent.com/cockpit-project/bots/master/machine/identity.pub >> /root/.ssh/authorized_keys + chmod 600 /root/.ssh/authorized_keys +fi +chown -R runtest "$SOURCE" + +# disable core dumps, we rather investigate them upstream where test VMs are accessible +echo core > /proc/sys/kernel/core_pattern + +# grab a few images to play with; tests run offline, so they cannot download images +podman rmi --all +podman pull quay.io/libpod/busybox +podman pull quay.io/libpod/alpine +podman pull quay.io/cockpit/registry:2 + +# copy images for user podman tests; podman insists on user session +loginctl enable-linger $(id -u admin) +sudo -i -u admin podman rmi --all +for img in quay.io/libpod/busybox quay.io/libpod/alpine quay.io/cockpit/registry:2; do + podman save $img | sudo -i -u admin podman load +done +loginctl disable-linger $(id -u admin) + +systemctl enable --now cockpit.socket podman.socket + +# Run tests as unprivileged user +su - -c "env SOURCE=$SOURCE LOGS=$LOGS $TESTS/run-test.sh" runtest + +RC=$(cat $LOGS/exitcode) +exit ${RC:-1} diff --git a/tests/roles/test/tasks/main.yml b/tests/roles/test/tasks/main.yml new file mode 100644 index 0000000..7c81d2f --- /dev/null +++ b/tests/roles/test/tasks/main.yml @@ -0,0 +1,30 @@ +--- +- name: upgrade critical packages to the latest version + dnf: + name: + - podman + - conmon + state: latest + +- include_role: + name: standard-test-source + +- include_role: + name: standard-test-basic + vars: + required_packages: + - cockpit-podman + - cockpit-ws + - cockpit-system + - git + - libvirt-python3 + - make + - npm + - python3 + tests: + - cockpit-podman: + dir: "{{ test_script_dir | default('.') }}/source" + # directory changed after release 29: https://github.com/cockpit-project/cockpit-podman/pull/684 + # drop this after packaging 30 + run: "if [ -e test/browser/browser.sh ]; then test/browser/browser.sh; else plans/browser.sh; fi" + save-files: ["logs/*"] diff --git a/tests/run-test.sh b/tests/run-test.sh new file mode 100755 index 0000000..ea553a3 --- /dev/null +++ b/tests/run-test.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -eux + +# tests need cockpit's bots/ libraries and test infrastructure +cd $SOURCE +git init +make bots test/common + +# only install a subset to save time/space +rm -f package-lock.json # otherwise the command below installs *everything*, argh +npm install chrome-remote-interface sizzle + +. /etc/os-release +export TEST_OS="${ID}-${VERSION_ID/./-}" +# HACK: upstream does not yet know about rawhide +if [ "$TEST_OS" = "fedora-34" ]; then + export TEST_OS=fedora-33 +fi + +export TEST_AUDIT_NO_SELINUX=1 + +# FIXME: Internal Server Error: statfs /tmp/bin: no such file or directory +EXCLUDES="--exclude TestApplication.testRunImageUser" + +RC=0 +test/common/run-tests --nondestructive --machine 127.0.0.1:22 --browser 127.0.0.1:9090 $EXCLUDES || RC=$? + +echo $RC > "$LOGS/exitcode" +cp --verbose Test* "$LOGS" || true +# deliver test result via exitcode file +exit 0 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..20eb99f --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,6 @@ +--- +- hosts: localhost + tags: + - classic + roles: + - test