Browse Source

Fix no-command-error igr test if cgroup cannot be determined

Davin McCall 1 year ago
parent
commit
987999970a
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/igr-tests/no-command-error/run-test.sh

+ 8 - 1
src/igr-tests/no-command-error/run-test.sh

@@ -5,7 +5,14 @@
 
 rm -f dinit-run.log
 
-../../dinit -d sd -u -p socket -q \
+# If cgroups support, supply cgroup base path to avoid potential "unable to determine
+# cgroup" message
+CGROUPS_BASE=""
+if ../../dinit --version | grep -q " cgroups"; then
+    CGROUPS_BASE="-b \"\""
+fi
+
+../../dinit -d sd -u -p socket -q $CGROUPS_BASE \
 	no-command -l dinit-run.log
 
 STATUS=FAIL