From 2a5337a3a96e72ee224a2f95dc2819939eb5957f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20M=C3=ADchal?= Date: Fri, 22 Oct 2021 01:58:58 +0300 Subject: [PATCH] playbooks: Fix CI for #897 & restructure it adjustmnets to the Toolbx binary that it requires presence of /run/host in both the host filesystem and the filesystem in a container. The presence of the directory is assured by systemd-tmpfiles by running it before the binary is started for the first time. This lead to the realization that the playbook structure is needlessly separated and can be unified as there is close to no benefit in keeping it separated. https://github.com/containers/toolbox/pull/898 --- .zuul.yaml | 1 + playbooks/setup-env.yaml | 33 ++++++++++++++++++++++++++------- playbooks/system-test.yaml | 23 +---------------------- playbooks/unit-test.yaml | 21 --------------------- 4 files changed, 28 insertions(+), 50 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 1ec2f5973..1543b8a04 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -7,6 +7,7 @@ nodes: - name: ci-node-33 label: cloud-fedora-33-small + pre-run: playbooks/setup-env.yaml run: playbooks/unit-test.yaml - job: diff --git a/playbooks/setup-env.yaml b/playbooks/setup-env.yaml index 7ac9b46ee..2f858bcf7 100644 --- a/playbooks/setup-env.yaml +++ b/playbooks/setup-env.yaml @@ -26,17 +26,36 @@ args: chdir: '{{ zuul.project.src_dir }}' - - name: Setup environment - become: yes - command: - cmd: systemd-tmpfiles --create - creates: /run/media - - name: Check versions of crucial packages - command: rpm -qa *kernel* *glibc* golang podman conmon containernetworking-plugins containers-common container-selinux crun runc fuse-overlayfs flatpak-session-helper + command: rpm -qa *kernel* *glibc* golang podman conmon containernetworking-plugins containers-common container-selinux crun runc fuse-overlayfs flatpak-session-helper patchelf - name: Show podman versions command: podman version - name: Show podman debug information command: podman info --debug + + - name: Set up build directory + command: meson builddir + args: + chdir: '{{ zuul.project.src_dir }}' + + - name: Build Toolbox + command: ninja -C builddir + args: + chdir: '{{ zuul.project.src_dir }}' + creates: builddir/src/toolbox + + - name: Install Toolbox + become: yes + command: ninja -C builddir install + args: + chdir: '{{ zuul.project.src_dir }}' + creates: /usr/local/bin/toolbox + + - name: Setup environment + become: yes + command: + cmd: systemd-tmpfiles --create + creates: /run/media + creates: /run/host diff --git a/playbooks/system-test.yaml b/playbooks/system-test.yaml index c2eff3f0d..5b726ba3a 100644 --- a/playbooks/system-test.yaml +++ b/playbooks/system-test.yaml @@ -1,32 +1,11 @@ --- - hosts: all - vars: - toolbox_bin: '/usr/local/bin/toolbox' - tasks: - - name: Set up build directory - command: meson builddir - args: - chdir: '{{ zuul.project.src_dir }}' - - - name: Build Toolbox - command: ninja -C builddir - args: - chdir: '{{ zuul.project.src_dir }}' - creates: builddir/src/toolbox - - - name: Install Toolbox - become: yes - command: ninja -C builddir install - args: - chdir: '{{ zuul.project.src_dir }}' - creates: '{{ toolbox_bin }}' - - name: Run system tests command: bats --timing ./test/system environment: PODMAN: '/usr/bin/podman' - TOOLBOX: '{{ toolbox_bin }}' + TOOLBOX: '/usr/local/bin/toolbox' args: chdir: '{{ zuul.project.src_dir }}' diff --git a/playbooks/unit-test.yaml b/playbooks/unit-test.yaml index 9be98e7bd..2212521c5 100644 --- a/playbooks/unit-test.yaml +++ b/playbooks/unit-test.yaml @@ -1,27 +1,6 @@ --- - hosts: all tasks: - - name: Install requirements - become: yes - package: - name: - - golang - - golang-github-cpuguy83-md2man - - ninja-build - - meson - - ShellCheck - - - name: Set up build directory - command: meson builddir - args: - chdir: '{{ zuul.project.src_dir }}' - - - name: Build Toolbox - command: ninja -C builddir - args: - chdir: '{{ zuul.project.src_dir }}' - creates: builddir/src/toolbox - - name: Test command: ninja -C builddir test args: