From bab9aa46a90a6be42fabdec8b22f3294c1ad4949 Mon Sep 17 00:00:00 2001 From: nzbr Date: Fri, 25 Nov 2022 19:17:05 +0100 Subject: Add CI Tests (#161) * use systemd-run instead of machinectl * fix systemd user sessions by launching through runuser * skip mounting binfmt_misc if the kernel lacks support for it * link syschdemd/installer to static location * make check happy * test tests * add a simple installer test * add second test for exit codes * make tests responsible for checking exit code * fix: add which to path * overhaul actions workflow * move checks out of flake.nix * use GUID for image name * Split flake checks into matrix job * Check for side-effects * reformat powershell scripts * extend basic test * use pester for tests * "fix" (purposefully) failing test * rename lib -> init * Add test for systemd --user * Add test for docker-native * move release to separate workflow * change downstream workflow path * switch to a class * Test running with different user shells * Add lib implementation for Windows * Add documentation for the tests * readme: docker permissions * remove empty files --- scripts/syschdemd.nix | 1 + scripts/syschdemd.sh | 2 +- scripts/wrapper.sh | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/syschdemd.nix b/scripts/syschdemd.nix index b7b42fd..ab3d9fe 100644 --- a/scripts/syschdemd.nix +++ b/scripts/syschdemd.nix @@ -31,6 +31,7 @@ let src = ./wrapper.sh; path = lib.makeSearchPath "" [ "/run/wrappers/bin" # mount + "${gnugrep}/bin" # grep "${systemd}/lib/systemd" # systemd ]; }; diff --git a/scripts/syschdemd.sh b/scripts/syschdemd.sh index 73adb40..a28ffcc 100644 --- a/scripts/syschdemd.sh +++ b/scripts/syschdemd.sh @@ -101,7 +101,7 @@ main() { start_systemd fi - if [ $# -gt 0 ]; then + if [ $# -gt 1 ]; then # Ignore just -c without a command # wsl seems to prefix with "-c" shift command="$*" diff --git a/scripts/wrapper.sh b/scripts/wrapper.sh index 6f4dd5a..15b24be 100644 --- a/scripts/wrapper.sh +++ b/scripts/wrapper.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -euxo pipefail -mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc +if grep -q binfmt_misc /proc/filesystems; then + mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc +fi exec systemd -- cgit v1.2.3