From 97853040fb6af73c2f73a98d7e93dae0e20bfc57 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Fri, 3 Mar 2017 12:29:47 -0500 Subject: testing --- test/environment/output.exp | 22 +++++++++++++++++++ test/root/git.exp | 51 +++++++++++++++++++++++++++++++++++++++++++++ test/root/root.sh | 3 +++ 3 files changed, 76 insertions(+) create mode 100755 test/root/git.exp (limited to 'test') diff --git a/test/environment/output.exp b/test/environment/output.exp index 10c325832..d175ddae2 100755 --- a/test/environment/output.exp +++ b/test/environment/output.exp @@ -61,5 +61,27 @@ expect { } after 100 send -- "rm -f logfile*\r" + + +send -- "firejail --output=../logfile -- ./output.sh\r" +expect { + timeout {puts "TESTING ERROR 8\n";exit} + "invalid output file" +} +after 100 + +send -- "firejail --output=/etc -- ./output.sh\r" +expect { + timeout {puts "TESTING ERROR 9\n";exit} + "invalid output file" +} +after 100 + +send -- "firejail --output=/etc/firejail/zoom.profile -- ./output.sh\r" +expect { + timeout {puts "TESTING ERROR 10\n";exit} + "the output file needs to be owned by the current user" +} + after 100 puts "\nall done\n" diff --git a/test/root/git.exp b/test/root/git.exp new file mode 100755 index 000000000..c5ddeee89 --- /dev/null +++ b/test/root/git.exp @@ -0,0 +1,51 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + + + +send -- "firejail --version\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "git install support is disabled" { puts "TESTING: git support not available in current build\n"; exit} + "git install support is enabled" { puts "git support available\n"} +} + +set timeout 120 +send -- "firejail --git-install\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Cloning into" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "Configuration options" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "src/fseccomp/fseccomp default seccomp" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Mainline git Firejail version was installed in" +} +after 100 + +send -- "firejail --git-uninstall\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "Cloning into" +} +expect { + timeout {puts "TESTING ERROR 7\n";exit} + "Configuration options" +} +expect { + timeout {puts "TESTING ERROR 8\n";exit} + "Firejail mainline git version uninstalled from" +} +after 100 + +puts "\nall done\n" diff --git a/test/root/root.sh b/test/root/root.sh index 9764b3804..29c618772 100755 --- a/test/root/root.sh +++ b/test/root/root.sh @@ -62,6 +62,9 @@ echo "TESTING: fs whitelist mnt, opt, media (test/root/whitelist-mnt.exp)" echo "TESTING: join (test/root/join.exp)" ./join.exp +echo "TESTING: git-install (test/root/git.exp)" +./git.exp + #******************************** # seccomp #******************************** -- cgit v1.2.3-70-g09d2