#12 Sync tests with master, fix tests
Merged 3 years ago by martinpitt. Opened 3 years ago by martinpitt.
rpms/ martinpitt/cockpit-podman f32  into  f32

file modified
+13 -2
@@ -10,7 +10,7 @@ 

  

  # install browser; on RHEL, use chromium from epel

  if ! rpm -q chromium-headless; then

-     if grep -q 'ID=rhel' /etc/os-release; 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
@@ -29,6 +29,10 @@ 

  # 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"

  
@@ -40,6 +44,13 @@ 

  podman pull docker.io/alpine

  podman pull docker.io/registry:2

  

+ # HACK: https://github.com/cockpit-project/cockpit/issues/14133

+ mkdir -p /usr/share/cockpit/packagekit/

+ 

+ # 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
@@ -49,7 +60,7 @@ 

  EOF

  loginctl disable-linger $(id -u admin)

  

- systemctl enable --now cockpit.socket io.podman.socket

+ systemctl enable --now cockpit.socket podman.socket

  

  # Run tests as unprivileged user

  su - -c "env SOURCE=$SOURCE LOGS=$LOGS $TESTS/run-test.sh" runtest

@@ -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/*"]

file modified
+5 -6
@@ -7,19 +7,18 @@ 

  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 tests don't recognize rhel-8-3 yet

- if [ "$TEST_OS" = "rhel-8-3" ]; then

-     export TEST_OS=rhel-8-2

- fi

- 

  export TEST_AUDIT_NO_SELINUX=1

  

+ # FIXME: These cause "RuntimeError: RangeError: Maximum call stack size exceeded" in b.key_press(["\r"])

+ EXCLUDES="--exclude TestApplication.testRunImageSystem --exclude TestApplication.testRunImageUser"

+ 

  RC=0

- test/check-application -tv --machine 127.0.0.1:22 --browser 127.0.0.1:9090 TestApplication.testBasicSystem || RC=$?

+ 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

file modified
+3 -20
@@ -1,23 +1,6 @@ 

  ---

  - hosts: localhost

-   roles:

-   - role: standard-test-source

-     tags:

-     - always

- 

-   - role: standard-test-basic

-     tags:

+   tags:

      - classic

-     required_packages:

-     - cockpit-podman

-     - cockpit-ws

-     - git

-     - libvirt-python3

-     - make

-     - npm

-     - python3

-     tests:

-     - browser:

-         dir: .

-         run: ./browser.sh

-         save-files: ["logs/*"]

+   roles:

+     - test