From 3fe1b06a36cefc497e957b603d1a5231ba7fbc02 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Fri, 20 Apr 2018 09:28:42 -0400 Subject: cleanup --- test/appimage/appimage-args.exp | 4 ++-- test/appimage/appimage-v1.exp | 4 ++-- test/environment/csh.exp | 34 ++++++++-------------------------- test/environment/zsh.exp | 30 ++++++------------------------ test/root/private.exp | 37 +++++++++++++++++++++++++++++-------- 5 files changed, 47 insertions(+), 62 deletions(-) (limited to 'test') diff --git a/test/appimage/appimage-args.exp b/test/appimage/appimage-args.exp index dcf16452f..0ec07c1ad 100755 --- a/test/appimage/appimage-args.exp +++ b/test/appimage/appimage-args.exp @@ -56,7 +56,7 @@ expect { sleep 2 spawn $env(SHELL) -send -- "firemon --seccomp\r" +send -- "firemon --seccomp --nowrap\r" expect { timeout {puts "TESTING ERROR 8\n";exit} "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} @@ -71,7 +71,7 @@ expect { "name=blablabla" } after 100 -send -- "firemon --caps\r" +send -- "firemon --caps --nowrap\r" expect { timeout {puts "TESTING ERROR 11\n";exit} "appimage Leafpad" diff --git a/test/appimage/appimage-v1.exp b/test/appimage/appimage-v1.exp index 073c32dab..90b13b9ff 100755 --- a/test/appimage/appimage-v1.exp +++ b/test/appimage/appimage-v1.exp @@ -44,7 +44,7 @@ expect { sleep 2 spawn $env(SHELL) -send -- "firemon --seccomp\r" +send -- "firemon --seccomp --nowrap\r" expect { timeout {puts "TESTING ERROR 5\n";exit} "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} @@ -59,7 +59,7 @@ expect { "name=blablabla" } after 100 -send -- "firemon --caps\r" +send -- "firemon --caps --nowrap\r" expect { timeout {puts "TESTING ERROR 6\n";exit} "appimage Leafpad" diff --git a/test/environment/csh.exp b/test/environment/csh.exp index 10a278ebc..7b5ab9b33 100755 --- a/test/environment/csh.exp +++ b/test/environment/csh.exp @@ -1,49 +1,31 @@ #!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2018 Firejail Authors -# License GPL v2 set timeout 10 +cd /home spawn $env(SHELL) match_max 100000 -send -- "firejail --private --tracelog --csh\r" +send -- "firejail --private --shell=/bin/csh\r" expect { timeout {puts "TESTING ERROR 0\n";exit} "Child process initialized" } sleep 1 -send -- "find ~\r" +send -- "env | grep SHELL;pwd\r" expect { timeout {puts "TESTING ERROR 1\n";exit} - ".cshrc" -} - -send -- "env | grep SHELL\r" -expect { - timeout {puts "TESTING ERROR 2\n";exit} - "SHELL" + "SHELL" } expect { - timeout {puts "TESTING ERROR 2.1\n";exit} + timeout {puts "TESTING ERROR 2\n";exit} "/bin/csh" } -send -- "exit\r" -sleep 1 - -send -- "firejail --shell=none --csh\r" expect { timeout {puts "TESTING ERROR 3\n";exit} - "shell=none was already specified" -} -after 100 - -send -- "firejail --csh --shell=none\r" -expect { - timeout {puts "TESTING ERROR 4\n";exit} - "a shell was already specified" + "home" } +send -- "exit\r" after 100 -puts "\n" +puts "\nall done\n" diff --git a/test/environment/zsh.exp b/test/environment/zsh.exp index e7f610e98..a1b94a326 100755 --- a/test/environment/zsh.exp +++ b/test/environment/zsh.exp @@ -1,49 +1,31 @@ #!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2018 Firejail Authors -# License GPL v2 set timeout 10 +cd /home spawn $env(SHELL) match_max 100000 -send -- "firejail --private --tracelog --zsh\r" +send -- "firejail --private --shell=/bin/zsh\r" expect { timeout {puts "TESTING ERROR 0\n";exit} "Child process initialized" } sleep 1 -send -- "find ~\r" -expect { - timeout {puts "TESTING ERROR 1\n";exit} - ".zshrc" -} - send -- "env | grep SHELL;pwd\r" expect { - timeout {puts "TESTING ERROR 2\n";exit} + timeout {puts "TESTING ERROR 1\n";exit} "SHELL" } expect { - timeout {puts "TESTING ERROR 2.1\n";exit} + timeout {puts "TESTING ERROR 2\n";exit} "/bin/zsh" } -send -- "exit\r" -sleep 1 - -send -- "firejail --shell=none --zsh\r" expect { timeout {puts "TESTING ERROR 3\n";exit} - "shell=none was already specified" -} -after 100 - -send -- "firejail --zsh --shell=none\r" -expect { - timeout {puts "TESTING ERROR 4\n";exit} - "a shell was already specified" + "home" } +send -- "exit\r" after 100 puts "\nall done\n" diff --git a/test/root/private.exp b/test/root/private.exp index 784761fc8..e3d3245ae 100755 --- a/test/root/private.exp +++ b/test/root/private.exp @@ -54,6 +54,21 @@ expect { after 100 send -- "exit\r" sleep 1 +send -- "firejail --whitelist=/opt/firejail-test-file --whitelist=/opt/firejail-test-dir --debug\r" +expect { + timeout {puts "TESTING ERROR 3.1\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "find /opt | wc -l\r" +expect { + timeout {puts "TESTING ERROR 4.1\n";exit} + "4" +} +after 100 +send -- "exit\r" +sleep 1 send -- "touch /srv/firejail-test-file\r" @@ -77,14 +92,20 @@ expect { after 100 send -- "exit\r" sleep 1 +send -- "firejail --whitelist=/srv/firejail-test-file --whitelist=/srv/firejail-test-dir --debug\r" +expect { + timeout {puts "TESTING ERROR 5.1\n";exit} + "Child process initialized" +} +sleep 1 - - - - - - - - +send -- "find /srv | wc -l\r" +expect { + timeout {puts "TESTING ERROR 6.1\n";exit} + "4" +} +after 100 +send -- "exit\r" +sleep 1 puts "\nall done\n" -- cgit v1.2.3-54-g00ecf