From 888c6321df15d117a36942df832948e973efee15 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Thu, 27 Oct 2022 14:40:13 +0200 Subject: [PATCH] Do not compile systemd if running as systemd test as non-root. --- tests/systemd-tokens-test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/systemd-tokens-test b/tests/systemd-tokens-test index cc1cf5f3..01aa9108 100755 --- a/tests/systemd-tokens-test +++ b/tests/systemd-tokens-test @@ -50,6 +50,8 @@ function skip() exit 77 } +[ $(id -u) != 0 ] && skip "WARNING: You must be root to run this test, test skipped." + # Prevent downloading and compiling systemd by default [ -z "$RUN_SYSTEMD_PLUGIN_TEST" ] && skip "WARNING: Variable RUN_SYSTEMD_PLUGIN_TEST must be defined, test skipped." @@ -78,7 +80,6 @@ CRYPTENROLL_LD_PRELOAD="" CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup [ ! -x "$CRYPTSETUP" ] && skip "Cannot find $CRYPTSETUP, test skipped." -[ $(id -u) != 0 ] && skip "WARNING: You must be root to run this test, test skipped." bin_check git bin_check swtpm bin_check swtpm_ioctl