From 933c526a948fa4b4b2ee8e645c736fd037d54e45 Mon Sep 17 00:00:00 2001 From: Tony Garcia Date: Tue, 19 Jul 2022 18:06:15 -0500 Subject: [PATCH] Use sudo in tests to avoid iotop limitations --- .github/workflows/test_distros.yml | 30 ++++++++++++++++-------------- tests/run_recap.sh | 6 ++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test_distros.yml b/.github/workflows/test_distros.yml index 81175a7..8f61aea 100644 --- a/.github/workflows/test_distros.yml +++ b/.github/workflows/test_distros.yml @@ -32,6 +32,7 @@ jobs: - name: Run container run: > + sudo podman run --pull always --detach @@ -45,23 +46,24 @@ jobs: - name: Install in container run: > + sudo podman exec ${{ matrix.name }} bash -c '/recap/tests/install_deps.sh ${{ matrix.name }} && /recap/tests/test_install_recap.sh' - name: Run Tests in container run: | - podman exec ${{ matrix.name }} bash -c 'recap --version' - podman exec ${{ matrix.name }} bash -c 'recaplog --version' - podman exec ${{ matrix.name }} /recap/tests/run_recap.sh - podman exec ${{ matrix.name }} bash -c 'ls -tr /var/log/recap/*log | xargs tail -v -n+0' - podman exec ${{ matrix.name }} /recap/tests/run_recaplog.sh - podman exec ${{ matrix.name }} bash -c 'tail -v -n+0 /var/log/recap/recaplog.log' - podman exec ${{ matrix.name }} bash -c 'recap -p list' - podman exec ${{ matrix.name }} bash -c 'recap -p list enabled' - podman exec ${{ matrix.name }} bash -c 'recap -p enable all' - podman exec ${{ matrix.name }} bash -c 'recap -p list enabled' - podman exec ${{ matrix.name }} bash -c 'recap -p list disabled' - podman exec ${{ matrix.name }} bash -c 'recap -p disable all' - podman exec ${{ matrix.name }} bash -c 'recap -p list disabled' - podman exec ${{ matrix.name }} bash -c 'recap -p list enabled' + sudo podman exec ${{ matrix.name }} bash -c 'recap --version' + sudo podman exec ${{ matrix.name }} bash -c 'recaplog --version' + sudo podman exec ${{ matrix.name }} /recap/tests/run_recap.sh + sudo podman exec ${{ matrix.name }} bash -c 'ls -tr /var/log/recap/*log | xargs tail -v -n+0' + sudo podman exec ${{ matrix.name }} /recap/tests/run_recaplog.sh + sudo podman exec ${{ matrix.name }} bash -c 'tail -v -n+0 /var/log/recap/recaplog.log' + sudo podman exec ${{ matrix.name }} bash -c 'recap -p list' + sudo podman exec ${{ matrix.name }} bash -c 'recap -p list enabled' + sudo podman exec ${{ matrix.name }} bash -c 'recap -p enable all' + sudo podman exec ${{ matrix.name }} bash -c 'recap -p list enabled' + sudo podman exec ${{ matrix.name }} bash -c 'recap -p list disabled' + sudo podman exec ${{ matrix.name }} bash -c 'recap -p disable all' + sudo podman exec ${{ matrix.name }} bash -c 'recap -p list disabled' + sudo podman exec ${{ matrix.name }} bash -c 'recap -p list enabled' diff --git a/tests/run_recap.sh b/tests/run_recap.sh index bbeb584..6bb7f28 100755 --- a/tests/run_recap.sh +++ b/tests/run_recap.sh @@ -3,11 +3,9 @@ # Get full path to recap recap_path=$(type -p recap) -# Insert 'set -e' on line 2 of recap to exit after any failure -sed -i "2iset -e" "${recap_path}"; - # Save debugging info and record the status of the recap run -debug_info=$(bash -x "${recap_path}" 2>&1) +# exiting on any failure +debug_info=$(bash -xe "${recap_path}" 2>&1) stat=$? # Save the debugging info that occurred right before the cleanup operation