diff --git a/.gitignore b/.gitignore index e69de29..9104b02 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,25 @@ +/cockpit-podman-1.tar.gz +/cockpit-podman-2.tar.gz +/cockpit-podman-3.tar.gz +/cockpit-podman-4.tar.gz +/cockpit-podman-5.tar.gz +/cockpit-podman-6.tar.gz +/cockpit-podman-7.tar.gz +/cockpit-podman-8.tar.gz +/cockpit-podman-9.tar.gz +/cockpit-podman-10.tar.gz +/cockpit-podman-11.tar.gz +/cockpit-podman-12.tar.gz +/cockpit-podman-13.tar.gz +/cockpit-podman-14.tar.gz +/cockpit-podman-15.tar.gz +/cockpit-podman-16.tar.gz +/cockpit-podman-17.tar.gz +/cockpit-podman-18.tar.gz +/cockpit-podman-19.tar.gz +/cockpit-podman-20.tar.gz +/cockpit-podman-21.tar.gz +/cockpit-podman-22.tar.gz +/cockpit-podman-23.tar.gz +/cockpit-podman-24.tar.gz +/cockpit-podman-25.tar.gz diff --git a/README.md b/README.md new file mode 100644 index 0000000..1bc634a --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# cockpit-podman + +The cockpit-podman package \ No newline at end of file diff --git a/cockpit-podman.spec b/cockpit-podman.spec new file mode 100644 index 0000000..5aa7895 --- /dev/null +++ b/cockpit-podman.spec @@ -0,0 +1,185 @@ +# This spec file has been automatically updated +Version: 25 +Release: 1%{?dist} +# +# Copyright (C) 2017-2020 Red Hat, Inc. +# +# Cockpit is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# Cockpit is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Cockpit; If not, see . +# + +Name: cockpit-podman +Summary: Cockpit component for Podman containers +License: LGPLv2+ +URL: https://github.com/cockpit-project/cockpit-podman + +Source0: https://github.com/cockpit-project/cockpit-podman/releases/download/%{version}/cockpit-podman-%{version}.tar.gz +BuildArch: noarch +BuildRequires: libappstream-glib + +Requires: cockpit-bridge >= 138 +Requires: cockpit-shell >= 138 +Requires: podman >= 2.0.4 + +%description +The Cockpit user interface for Podman containers. + +%prep +%setup -q -n cockpit-podman + +%build +# Nothing to build + +%install +%make_install +appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/* + +%files +%doc README.md +%license LICENSE +%{_datadir}/cockpit/* +%{_datadir}/metainfo/* + +%changelog +* Wed Oct 14 2020 Sanne Raymaekers - 25-1 + +- Listen for image build event + +* Wed Sep 30 2020 Marius Vollmer - 24-1 + +- Use sentence case in the UI + +* Wed Sep 02 2020 Martin Pitt - 23-1 + +- Translation updates + +* Wed Aug 19 2020 Marius Vollmer - 22-1 + +- Support for pod group deletion + +* Wed Aug 05 2020 Matej Marusak - 21-1 + +- Support for pod groups +- Support checkpoint and restore +- Registry selection in "download image" dialog +- Selected tag removal during deletion + +* Mon Jul 27 2020 Fedora Release Engineering - 20-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 22 2020 Katerina Koukiou - 20-1 + +- Show networking information for containers +- Enable filtering images and containers by owner +- Optionally show intermediate images +- Enable setting up SELinux label when mounting volumes + +* Wed Jul 15 2020 Matej Marusak - 19-1 + +- Switch to the new Podman REST API +- Improve displaying on small screens + +* Mon Jun 15 2020 Matej Marusak - 18-1 + +- Bump NPM dependencies to their latest versions +- Stop importing cockpit's deprecated base1/patternfly.css +- Synchronize style with the newest Cockpit + +* Thu May 14 2020 Matej Marusak - 17-1 + +- Translation updates +- Adjust tests to changed Services page in Cockpit 218 + +* Wed Apr 29 2020 Martin Pitt - 16-1 + +- Restyle buttons and dropdowns to be consistent with Cockpit +- Disable button and show a spinner while delete operation is in progress +- Translation updates + +* Thu Apr 16 2020 Martin Pitt - 15-3 + +- Drop obsolete functionality for Fedora Atomic +- Localize dates and times +- Make tests non-destructive, to support Fedora gating + +* Wed Mar 04 2020 Martin Pitt - 14-1 + +- Fix crash on filtering anonymous images +- Translation updates + +* Wed Feb 05 2020 sanne raymaekers - 13-1 + +- Show historical logs + +* Tue Jan 28 2020 Fedora Release Engineering - 12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jan 08 2020 Katerina Koukiou - 12-1 + +- Configure CPU share for system containers + +* Wed Nov 27 2019 Martin Pitt - 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 Oct 30 2019 Sanne Raymaekers - 10-1 + +- Support for user containers + +* Wed Oct 02 2019 Martin Pitt - 9-1 + +- Minimize CSS in production builds +- Bump NPM dependencies to latest versions + +* Wed Sep 04 2019 Martin Pitt - 8-1 + +- Show list of containers that use given image +- Show placeholder while loading containers and images +- Fix setting memory limit + +* Wed Jul 31 2019 Martin Pitt - 7-1 + +- Fix AppStream ID +- Adjust tests to changed Cockpit Services page + +* Wed Jul 24 2019 Fedora Release Engineering - 6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Jul 19 2019 Martin Pitt - 6-1 + +- Fix various UI regressions from Cockpit's PatternFly 4 switch +- Add packit configuration (https://packit.dev/) + +* Wed Jul 10 2019 Martin Pitt - 5-1 + +- Add container Terminal + +* Wed Jun 26 2019 Katerina Koukiou - 4-1 + +- Fix regression in container commit + +* 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 + +* Fri May 24 2019 Cockpit Project - 2-1 +- Update to upstream 2 release + +* 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..c2182c7 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} diff --git a/sources b/sources new file mode 100644 index 0000000..c10c3ee --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (cockpit-podman-25.tar.gz) = b64eae2a03c2d17425514175ed813bae42e1f5f7bdc34adc9c715737e026e8afdb309e240b5db7022da6cd3714b531ead22768052773382a25363eb8acbf91b9 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..bd04aea --- /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 +if ! rpm -q chromium-headless; 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-headless +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 + +# 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 + +# pull images for system podman tests +podman pull docker.io/busybox +podman pull docker.io/alpine +podman pull docker.io/registry:2 + +# HACK: avoid leftover user podman processes between login sessions: https://github.com/containers/podman/issues/7021 +mkdir -p /etc/systemd/user/podman.service.d +printf '[Service]\nKillMode=\n' > /etc/systemd/user/podman.service.d/cleanup.conf + +# pull images for user podman tests; podman insists on user session +loginctl enable-linger $(id -u admin) +sudo -i -u admin bash << EOF +podman pull docker.io/busybox +podman pull docker.io/alpine +podman pull docker.io/registry:2 +EOF +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..9976d7d --- /dev/null +++ b/tests/roles/test/tasks/main.yml @@ -0,0 +1,27 @@ +--- +- 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 + - git + - libvirt-python3 + - make + - npm + - python3 + tests: + - cockpit-podman: + dir: . + run: "{{ test_script_dir | default('.') }}/browser.sh" + save-files: ["logs/*"] diff --git a/tests/run-test.sh b/tests/run-test.sh new file mode 100755 index 0000000..30352e4 --- /dev/null +++ b/tests/run-test.sh @@ -0,0 +1,26 @@ +#!/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/./-}" +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 --trace --verbose --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