From 75e7ec8557f069bcae4dfd5c027b1cbe10228890 Mon Sep 17 00:00:00 2001 From: Ethan Dye Date: Wed, 4 Dec 2024 18:56:20 -0700 Subject: [PATCH] Fix log uploads in GitHub Actions Signed-off-by: Ethan Dye --- .github/workflows/test-action.yml | 1 + tests/image.bash | 2 +- tests/run.exp | 4 +++- uninstall.bash | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index db69c04..afedbeb 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -52,4 +52,5 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: + name: logs.tar.gz path: logs.tar.gz diff --git a/tests/image.bash b/tests/image.bash index 00c3670..3384bd3 100755 --- a/tests/image.bash +++ b/tests/image.bash @@ -42,7 +42,7 @@ if [[ $1 == "setup" ]]; then imageFile "umount" "$3" elif [[ $1 == "copy-logs" ]]; then imageFile "mount" "$2" - cp tests/fs/opt/zram/logs.tar.gz . + cp tests/fs/opt/zram/logs.tar.gz logs.tar.gz imageFile "umount" "$2" fi diff --git a/tests/run.exp b/tests/run.exp index 7f1622c..45a3065 100755 --- a/tests/run.exp +++ b/tests/run.exp @@ -50,10 +50,12 @@ expect { exp_continue } "pi@raspberrypi:~$ " { - send "sudo /opt/zram/uninstall.bash\r" + send "touch /var/log/test.txt\r" } } expect "pi@raspberrypi:~$ " +send "sudo /opt/zram/uninstall.bash\r" +expect "pi@raspberrypi:~$ " send "/opt/zram/tests/test-zram-devices.bash removal\r" expect { -re "Test failed:.*$" { diff --git a/uninstall.bash b/uninstall.bash index 16eb9f5..7363ed8 100755 --- a/uninstall.bash +++ b/uninstall.bash @@ -36,6 +36,7 @@ fi rm -f /etc/logrotate.d/zram-config rm -f /etc/ztab rm -rf /usr/local/lib/zram-config +cat /usr/local/share/zram-config/log/zram-config.log rm -rf /usr/local/share/zram-config rm -f /var/log/zram-config