From 270f0d95e3f27445057981b26a2aa6474769f3f2 Mon Sep 17 00:00:00 2001 From: a1346054 <36859588+a1346054@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:01:07 +0000 Subject: tests: stop mixing tabs and spaces --- test/apps-x11/apps-x11.sh | 17 +++++------ test/chroot/chroot.sh | 2 -- test/compile/compile.sh | 45 ++++++++++++++-------------- test/environment/environment.sh | 15 +++++----- test/features/test.sh | 35 ++++++++++------------ test/filters/filters.sh | 52 ++++++++++++++++---------------- test/fs/fs.sh | 22 +++++++------- test/overlay/overlay.sh | 9 +++--- test/root/root.sh | 8 ++--- test/utils/catchsignal.sh | 26 ++++++++-------- test/utils/catchsignal2.sh | 66 ++++++++++++++++++++--------------------- test/utils/utils.sh | 12 ++++---- 12 files changed, 150 insertions(+), 159 deletions(-) (limited to 'test') diff --git a/test/apps-x11/apps-x11.sh b/test/apps-x11/apps-x11.sh index 9f8102738..b2722eed3 100755 --- a/test/apps-x11/apps-x11.sh +++ b/test/apps-x11/apps-x11.sh @@ -10,7 +10,6 @@ export LC_ALL=C echo "TESTING: no x11 (test/apps-x11/x11-none.exp)" ./x11-none.exp - if command -v xterm then echo "TESTING: xterm x11 xorg" @@ -18,14 +17,14 @@ then if command -v xpra then - echo "TESTING: xterm x11 xpra" - ./xterm-xpra.exp + echo "TESTING: xterm x11 xpra" + ./xterm-xpra.exp fi if command -v Xephyr then - echo "TESTING: xterm x11 xephyr" - ./xterm-xephyr.exp + echo "TESTING: xterm x11 xephyr" + ./xterm-xephyr.exp fi else echo "TESTING SKIP: xterm not found" @@ -34,14 +33,14 @@ fi # check xpra/xephyr if command -v xpra then - echo "xpra found" + echo "xpra found" else - echo "xpra not found" + echo "xpra not found" if command -v Xephyr then - echo "Xephyr found" + echo "Xephyr found" else - echo "TESTING SKIP: xpra and/or Xephyr not found" + echo "TESTING SKIP: xpra and/or Xephyr not found" exit fi fi diff --git a/test/chroot/chroot.sh b/test/chroot/chroot.sh index 3c3e7311b..f5ccf3549 100755 --- a/test/chroot/chroot.sh +++ b/test/chroot/chroot.sh @@ -17,6 +17,4 @@ echo "TESTING: chroot (test/chroot/fs_chroot.exp)" echo "TESTING: unchroot as root (test/chroot/unchroot-as-root.exp)" sudo ./unchroot-as-root.exp - - rm -f unchroot diff --git a/test/compile/compile.sh b/test/compile/compile.sh index 96a14d0cb..48c8dd2c4 100755 --- a/test/compile/compile.sh +++ b/test/compile/compile.sh @@ -53,17 +53,17 @@ print_title() { DIST="$1" while [ $# -gt 0 ]; do # Until you run out of parameters . . . - case "$1" in - --clean) - cleanup - exit - ;; - --help) - echo "./compile.sh [--clean|--help]" - exit - ;; - esac - shift # Check next set of parameters. + case "$1" in + --clean) + cleanup + exit + ;; + --help) + echo "./compile.sh [--clean|--help]" + exit + ;; + esac + shift # Check next set of parameters. done cleanup @@ -89,7 +89,6 @@ cp output-configure oc1 cp output-make om1 rm output-configure output-make - #***************************************************************** # TEST 2 #***************************************************************** @@ -98,7 +97,7 @@ rm output-configure output-make print_title "${arr[2]}" cd firejail make distclean -./configure --prefix=/usr --disable-dbusproxy --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --disable-dbusproxy --enable-fatal-warnings 2>&1 | tee ../output-configure make -j4 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test2 @@ -115,7 +114,7 @@ rm output-configure output-make print_title "${arr[3]}" cd firejail make distclean -./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure make -j4 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test3 @@ -132,7 +131,7 @@ rm output-configure output-make print_title "${arr[4]}" cd firejail make distclean -./configure --prefix=/usr --disable-firetunnel --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --disable-firetunnel --enable-fatal-warnings 2>&1 | tee ../output-configure make -j4 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test4 @@ -149,7 +148,7 @@ rm output-configure output-make print_title "${arr[5]}" cd firejail make distclean -./configure --prefix=/usr --disable-userns --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --disable-userns --enable-fatal-warnings 2>&1 | tee ../output-configure make -j4 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test5 @@ -167,7 +166,7 @@ rm output-configure output-make print_title "${arr[6]}" cd firejail make distclean -./configure --prefix=/usr --disable-network --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --disable-network --enable-fatal-warnings 2>&1 | tee ../output-configure make -j4 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test6 @@ -184,7 +183,7 @@ rm output-configure output-make print_title "${arr[7]}" cd firejail make distclean -./configure --prefix=/usr --disable-x11 --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --disable-x11 --enable-fatal-warnings 2>&1 | tee ../output-configure make -j4 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test7 @@ -218,7 +217,7 @@ rm output-configure output-make print_title "${arr[9]}" cd firejail make distclean -./configure --prefix=/usr --disable-file-transfer --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --disable-file-transfer --enable-fatal-warnings 2>&1 | tee ../output-configure make -j4 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test9 @@ -235,7 +234,7 @@ rm output-configure output-make print_title "${arr[10]}" cd firejail make distclean -./configure --prefix=/usr --disable-whitelist --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --disable-whitelist --enable-fatal-warnings 2>&1 | tee ../output-configure make -j4 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test10 @@ -252,7 +251,7 @@ rm output-configure output-make print_title "${arr[11]}" cd firejail make distclean -./configure --prefix=/usr --disable-globalcfg --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --disable-globalcfg --enable-fatal-warnings 2>&1 | tee ../output-configure make -j4 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test11 @@ -269,7 +268,7 @@ rm output-configure output-make print_title "${arr[12]}" cd firejail make distclean -./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure make -j4 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test12 @@ -354,7 +353,7 @@ rm output-configure output-make print_title "${arr[17]}" cd firejail make distclean -./configure --prefix=/usr --disable-usertmpfs --enable-fatal-warnings 2>&1 | tee ../output-configure +./configure --prefix=/usr --disable-usertmpfs --enable-fatal-warnings 2>&1 | tee ../output-configure make -j4 2>&1 | tee ../output-make cd .. grep Warning output-configure output-make > ./report-test17 diff --git a/test/environment/environment.sh b/test/environment/environment.sh index f6acada73..ddc9a80a9 100755 --- a/test/environment/environment.sh +++ b/test/environment/environment.sh @@ -7,7 +7,6 @@ export MALLOC_CHECK_=3 export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) export LC_ALL=C - echo "TESTING: timeout (test/environment/timeout.exp)" ./timeout.exp @@ -41,10 +40,10 @@ echo "TESTING: firejail in firejail - single sandbox (test/environment/firejail- if command -v aplay && [ "$(aplay -l | grep -c "List of PLAYBACK")" -gt 0 ]; then - echo "TESTING: sound (test/environment/sound.exp)" - ./sound.exp + echo "TESTING: sound (test/environment/sound.exp)" + ./sound.exp else - echo "TESTING SKIP: no aplay or sound card found" + echo "TESTING SKIP: no aplay or sound card found" fi echo "TESTING: nice (test/environment/nice.exp)" @@ -55,10 +54,10 @@ echo "TESTING: quiet (test/environment/quiet.exp)" if command -v strace then - echo "TESTING: --allow-debuggers (test/environment/allow-debuggers.exp)" - ./allow-debuggers.exp + echo "TESTING: --allow-debuggers (test/environment/allow-debuggers.exp)" + ./allow-debuggers.exp else - echo "TESTING SKIP: strace not found" + echo "TESTING SKIP: strace not found" fi # to install ibus: @@ -70,7 +69,7 @@ then echo "TESTING: ibus (test/environment/ibus.exp)" ./ibus.exp else - echo "TESTING SKIP: ibus not configured" + echo "TESTING SKIP: ibus not configured" fi echo "TESTING: rlimit (test/environment/rlimit.exp)" diff --git a/test/features/test.sh b/test/features/test.sh index 64cb78c21..aaf5fd089 100755 --- a/test/features/test.sh +++ b/test/features/test.sh @@ -9,27 +9,24 @@ CHROOT="chroot" NETWORK="network" while [ $# -gt 0 ]; do # Until you run out of parameters . . . - case "$1" in - --nooverlay) - OVERLAY="none" - ;; - --nochroot) - CHROOT="none" - ;; - --nonetwork) - NETWORK="none" - ;; - --help) - echo "./test.sh [--nooverlay|--nochroot|--nonetwork|--help] | grep TESTING" - exit - ;; - esac - shift # Check next set of parameters. + case "$1" in + --nooverlay) + OVERLAY="none" + ;; + --nochroot) + CHROOT="none" + ;; + --nonetwork) + NETWORK="none" + ;; + --help) + echo "./test.sh [--nooverlay|--nochroot|--nonetwork|--help] | grep TESTING" + exit + ;; + esac + shift # Check next set of parameters. done - - - # # Feature testing # diff --git a/test/filters/filters.sh b/test/filters/filters.sh index 1c6b812ff..918f05adc 100755 --- a/test/filters/filters.sh +++ b/test/filters/filters.sh @@ -21,23 +21,23 @@ else fi if [ "$(uname -m)" = "x86_64" ]; then - echo "TESTING: memory-deny-write-execute (test/filters/memwrexe.exp)" - ./memwrexe.exp + echo "TESTING: memory-deny-write-execute (test/filters/memwrexe.exp)" + ./memwrexe.exp elif [ "$(uname -m)" = "i686" ]; then - echo "TESTING: memory-deny-write-execute (test/filters/memwrexe-32.exp)" - ./memwrexe-32.exp + echo "TESTING: memory-deny-write-execute (test/filters/memwrexe-32.exp)" + ./memwrexe-32.exp else - echo "TESTING SKIP: memwrexe binary only running on x86_64 and i686." + echo "TESTING SKIP: memwrexe binary only running on x86_64 and i686." fi echo "TESTING: debug options (test/filters/debug.exp)" ./debug.exp if [ "$(uname -m)" = "x86_64" ]; then - echo "TESTING: seccomp run files (test/filters/seccomp-run-files.exp)" - ./seccomp-run-files.exp + echo "TESTING: seccomp run files (test/filters/seccomp-run-files.exp)" + ./seccomp-run-files.exp else - echo "TESTING SKIP: seccomp-run-files test implemented only for x86_64." + echo "TESTING SKIP: seccomp-run-files test implemented only for x86_64." fi echo "TESTING: seccomp postexec (test/filters/seccomp-postexec.exp)" @@ -62,32 +62,32 @@ echo "TESTING: capabilities join (test/filters/caps-join.exp)" rm -f seccomp-test-file if [ "$(uname -m)" = "x86_64" ]; then - echo "TESTING: fseccomp (test/filters/fseccomp.exp)" - ./fseccomp.exp + echo "TESTING: fseccomp (test/filters/fseccomp.exp)" + ./fseccomp.exp else - echo "TESTING SKIP: fseccomp test implemented only for x86_64" + echo "TESTING SKIP: fseccomp test implemented only for x86_64" fi rm -f seccomp-test-file if [ "$(uname -m)" = "x86_64" ]; then - echo "TESTING: protocol (test/filters/protocol.exp)" - ./protocol.exp + echo "TESTING: protocol (test/filters/protocol.exp)" + ./protocol.exp else - echo "TESTING SKIP: protocol, running only on x86_64" + echo "TESTING SKIP: protocol, running only on x86_64" fi echo "TESTING: seccomp bad empty (test/filters/seccomp-bad-empty.exp)" ./seccomp-bad-empty.exp if [ "$(uname -m)" = "x86_64" ]; then - echo "TESTING: seccomp debug (test/filters/seccomp-debug.exp)" + echo "TESTING: seccomp debug (test/filters/seccomp-debug.exp)" ./seccomp-debug.exp elif [ "$(uname -m)" = "i686" ]; then - echo "TESTING: seccomp debug (test/filters/seccomp-debug-32.exp)" + echo "TESTING: seccomp debug (test/filters/seccomp-debug-32.exp)" ./seccomp-debug-32.exp else - echo "TESTING SKIP: protocol, running only on x86_64 and i686" + echo "TESTING SKIP: protocol, running only on x86_64 and i686" fi echo "TESTING: seccomp errno (test/filters/seccomp-errno.exp)" @@ -97,10 +97,10 @@ echo "TESTING: seccomp su (test/filters/seccomp-su.exp)" ./seccomp-su.exp if command -v strace; then - echo "TESTING: seccomp ptrace (test/filters/seccomp-ptrace.exp)" - ./seccomp-ptrace.exp + echo "TESTING: seccomp ptrace (test/filters/seccomp-ptrace.exp)" + ./seccomp-ptrace.exp else - echo "TESTING SKIP: ptrace, strace not found" + echo "TESTING SKIP: ptrace, strace not found" fi echo "TESTING: seccomp chmod - seccomp lists (test/filters/seccomp-chmod.exp)" @@ -115,15 +115,15 @@ echo "TESTING: seccomp empty (test/filters/seccomp-empty.exp)" ./seccomp-empty.exp if [ "$(uname -m)" = "x86_64" ]; then - echo "TESTING: seccomp numeric (test/filters/seccomp-numeric.exp)" - ./seccomp-numeric.exp + echo "TESTING: seccomp numeric (test/filters/seccomp-numeric.exp)" + ./seccomp-numeric.exp else - echo "TESTING SKIP: seccomp numeric test implemented only for x86_64" + echo "TESTING SKIP: seccomp numeric test implemented only for x86_64" fi if [ "$(uname -m)" = "x86_64" ]; then - echo "TESTING: seccomp join (test/filters/seccomp-join.exp)" - ./seccomp-join.exp + echo "TESTING: seccomp join (test/filters/seccomp-join.exp)" + ./seccomp-join.exp else - echo "TESTING SKIP: seccomp join test implemented only for x86_64" + echo "TESTING SKIP: seccomp join test implemented only for x86_64" fi diff --git a/test/fs/fs.sh b/test/fs/fs.sh index 36ff30934..07d33bee6 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh @@ -46,14 +46,14 @@ echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)" rm -f /var/tmp/_firejail_test_file if [ "$(uname -m)" = "x86_64" ]; then - fjconfig=/etc/firejail/firejail.config - printf 'private-lib yes\n' | sudo tee -a "$fjconfig" >/dev/null - echo "TESTING: private-lib (test/fs/private-lib.exp)" - ./private-lib.exp - printf '%s\n' "$(sed '/^private-lib yes$/d' "$fjconfig")" | - sudo tee "$fjconfig" >/dev/null + fjconfig=/etc/firejail/firejail.config + printf 'private-lib yes\n' | sudo tee -a "$fjconfig" >/dev/null + echo "TESTING: private-lib (test/fs/private-lib.exp)" + ./private-lib.exp + printf '%s\n' "$(sed '/^private-lib yes$/d' "$fjconfig")" | + sudo tee "$fjconfig" >/dev/null else - echo "TESTING SKIP: private-lib test implemented only for x86_64." + echo "TESTING SKIP: private-lib test implemented only for x86_64." fi echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" @@ -61,11 +61,11 @@ echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" rm -f /var/lock/_firejail_test_file if [ -w /dev/shm ]; then - echo "TESTING: read/write /dev/shm (test/fs/fs_dev_shm.exp)" - ./fs_dev_shm.exp - rm -f /dev/shm/_firejail_test_file + echo "TESTING: read/write /dev/shm (test/fs/fs_dev_shm.exp)" + ./fs_dev_shm.exp + rm -f /dev/shm/_firejail_test_file else - echo "TESTING SKIP: /dev/shm not writable" + echo "TESTING SKIP: /dev/shm not writable" fi echo "TESTING: private (test/fs/private.exp)" diff --git a/test/overlay/overlay.sh b/test/overlay/overlay.sh index 9bc458f50..a0519d1ad 100755 --- a/test/overlay/overlay.sh +++ b/test/overlay/overlay.sh @@ -38,18 +38,17 @@ else echo "TESTING SKIP: firefox not found" fi - # check xpra/xephyr if command -v xpra then - echo "xpra found" + echo "xpra found" else - echo "xpra not found" + echo "xpra not found" if command -v Xephyr then - echo "Xephyr found" + echo "Xephyr found" else - echo "TESTING SKIP: xpra and/or Xephyr not found" + echo "TESTING SKIP: xpra and/or Xephyr not found" exit fi fi diff --git a/test/root/root.sh b/test/root/root.sh index e3b48d15b..15c4bbd13 100755 --- a/test/root/root.sh +++ b/test/root/root.sh @@ -29,7 +29,7 @@ then echo "TESTING: snmpd (test/root/snmpd.exp)" ./snmpd.exp else - echo "TESTING SKIP: snmpd not found" + echo "TESTING SKIP: snmpd not found" fi @@ -38,7 +38,7 @@ then echo "TESTING: apache2 (test/root/apache2.exp)" ./apache2.exp else - echo "TESTING SKIP: apache2 not found" + echo "TESTING SKIP: apache2 not found" fi if [ -f /etc/init.d/isc-dhcp-server ] @@ -54,7 +54,7 @@ then echo "TESTING: unbound (test/root/unbound.exp)" ./unbound.exp else - echo "TESTING SKIP: unbound not found" + echo "TESTING SKIP: unbound not found" fi if [ -f /etc/init.d/nginx ] @@ -62,7 +62,7 @@ then echo "TESTING: nginx (test/root/nginx.exp)" ./nginx.exp else - echo "TESTING SKIP: nginx not found" + echo "TESTING SKIP: nginx not found" fi #******************************** diff --git a/test/utils/catchsignal.sh b/test/utils/catchsignal.sh index 117179143..cef00b2a5 100755 --- a/test/utils/catchsignal.sh +++ b/test/utils/catchsignal.sh @@ -4,20 +4,20 @@ # License GPL v2 _term() { - echo "Caught Signal" - echo 1 - sleep 1 - echo 2 - sleep 1 - echo 3 - sleep 1 - echo 4 - sleep 1 - echo 5 - sleep 1 + echo "Caught Signal" + echo 1 + sleep 1 + echo 2 + sleep 1 + echo 3 + sleep 1 + echo 4 + sleep 1 + echo 5 + sleep 1 - kill $pid - exit + kill $pid + exit } trap _term SIGTERM diff --git a/test/utils/catchsignal2.sh b/test/utils/catchsignal2.sh index 1bd7852cd..21f299430 100755 --- a/test/utils/catchsignal2.sh +++ b/test/utils/catchsignal2.sh @@ -4,42 +4,42 @@ # License GPL v2 _term() { - echo "Caught Signal" - echo 1 - sleep 1 - echo 2 - sleep 1 - echo 3 - sleep 1 - echo 4 - sleep 1 - echo 5 - sleep 1 + echo "Caught Signal" + echo 1 + sleep 1 + echo 2 + sleep 1 + echo 3 + sleep 1 + echo 4 + sleep 1 + echo 5 + sleep 1 - echo 10 - sleep 1 - echo 20 - sleep 1 - echo 30 - sleep 1 - echo 40 - sleep 1 - echo 50 - sleep 1 + echo 10 + sleep 1 + echo 20 + sleep 1 + echo 30 + sleep 1 + echo 40 + sleep 1 + echo 50 + sleep 1 - echo 100 - sleep 1 - echo 200 - sleep 1 - echo 300 - sleep 1 - echo 400 - sleep 1 - echo 500 - sleep 1 + echo 100 + sleep 1 + echo 200 + sleep 1 + echo 300 + sleep 1 + echo 400 + sleep 1 + echo 500 + sleep 1 - kill $pid - exit + kill $pid + exit } trap _term SIGTERM diff --git a/test/utils/utils.sh b/test/utils/utils.sh index ad36d7053..d1d006f4f 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh @@ -35,10 +35,10 @@ echo "TESTING: help (test/utils/help.exp)" if command -v man then - echo "TESTING: man (test/utils/man.exp)" - ./man.exp + echo "TESTING: man (test/utils/man.exp)" + ./man.exp else - echo "TESTING SKIP: man not found" + echo "TESTING SKIP: man not found" fi echo "TESTING: list (test/utils/list.exp)" @@ -49,10 +49,10 @@ echo "TESTING: tree (test/utils/tree.exp)" if [ $(grep -c ^processor /proc/cpuinfo) -gt 1 ]; then - echo "TESTING: cpu.print (test/utils/cpu-print.exp)" - ./cpu-print.exp + echo "TESTING: cpu.print (test/utils/cpu-print.exp)" + ./cpu-print.exp else - echo "TESTING SKIP: cpu.print, not enough CPUs" + echo "TESTING SKIP: cpu.print, not enough CPUs" fi echo "TESTING: fs.print (test/utils/fs-print.exp)" -- cgit v1.2.3-54-g00ecf