From 912ec614b6c059c9cbc1028ddd56b13beb7ad393 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 5 Sep 2017 19:15:39 -0400 Subject: testing --- test/root/checkcfg.exp | 14 +++++++------- test/root/firecfg.exp | 40 ++++++++++++++++++++++++++++++++-------- test/root/seccomp-chown.exp | 17 ++++++++--------- 3 files changed, 47 insertions(+), 24 deletions(-) (limited to 'test') diff --git a/test/root/checkcfg.exp b/test/root/checkcfg.exp index 205ef1e0c..e17e9cda2 100755 --- a/test/root/checkcfg.exp +++ b/test/root/checkcfg.exp @@ -88,6 +88,7 @@ expect { timeout {puts "TESTING ERROR 9\n";exit} "noroot feature is disabled in Firejail configuration file\r" } +sleep 1 # netfilter-default send -- "echo \"netfilter-default blablabla\" > /etc/firejail/firejail.config\r" @@ -97,6 +98,7 @@ expect { timeout {puts "TESTING ERROR 10\n";exit} "netfilter-default file blablabla not available\r" } +after 100 # strings send -- "echo \"xephyr-screen 800x600\" > /etc/firejail/firejail.config\r" @@ -104,17 +106,15 @@ after 100 send -- "echo \"xvfb-screen 800x600x24\" >> /etc/firejail/firejail.config\r" after 100 send -- "echo \"xvfb-extra-params blablabla\" >> /etc/firejail/firejail.config\r" -after 100 -send -- "firejail --noprofile\r" +sleep 1 +send -- "firejail --noprofile echo done\r" expect { timeout {puts "TESTING ERROR 11\n";exit} - "Child process initialized\r" + "done\r" } -after 100 -send -- "exit\r" -after 100 +sleep 1 -# error exit +after 100 send -- "echo \"join no\" > /etc/firejail/firejail.config\r" after 100 send -- "echo \"cache-tmpfs no\" >> /etc/firejail/firejail.config\r" diff --git a/test/root/firecfg.exp b/test/root/firecfg.exp index 8961aed60..8210496bb 100755 --- a/test/root/firecfg.exp +++ b/test/root/firecfg.exp @@ -15,40 +15,64 @@ expect { timeout {puts "TESTING ERROR 0\n";exit} "/usr/local/bin/firefox removed" } -after 100 +sleep 1 + send -- "file /usr/local/bin/firefox; echo done\r" expect { timeout {puts "TESTING ERROR 1\n";exit} "symbolic link to /usr/bin/firejail" {puts "TESTING ERROR 2\n";exit} "done" } -after 100 +sleep 1 send -- "firecfg\r" expect { timeout {puts "TESTING ERROR 3\n";exit} - "/usr/local/bin/firefox created" + "firefox created" } -after 100 +sleep 1 + send -- "file /usr/local/bin/firefox\r" expect { timeout {puts "TESTING ERROR 4\n";exit} "symbolic link to /usr/bin/firejail" } -after 100 +sleep 1 send -- "firecfg --list\r" expect { timeout {puts "TESTING ERROR 5\n";exit} "/usr/local/bin/firefox" } -after 100 +sleep 1 send -- "firecfg --fix\r" expect { - timeout {puts "TESTING ERROR 5\n";exit} + timeout {puts "TESTING ERROR 6\n";exit} "this option is not supported for root user" } +sleep 1 + +send -- "firecfg --fix-sound\r" +expect { + timeout {puts "TESTING ERROR 7\n";exit} + "PulseAudio configured, please logout and login back again" +} +sleep 1 + +send -- "firecfg --version\r" +expect { + timeout {puts "TESTING ERROR 8\n";exit} + "firecfg version" +} +sleep 1 + +send -- "firecfg --blablabla\r" +expect { + timeout {puts "TESTING ERROR 9\n";exit} + "invalid command line option" +} +sleep 1 + -after 100 puts "\nall done\n" diff --git a/test/root/seccomp-chown.exp b/test/root/seccomp-chown.exp index 7d9da5e5a..174a35ffe 100755 --- a/test/root/seccomp-chown.exp +++ b/test/root/seccomp-chown.exp @@ -14,33 +14,32 @@ expect { } sleep 2 -send -- "touch testfile;pwd\r" +send -- "touch testfile; echo done\r" expect { timeout {puts "TESTING ERROR 1\n";exit} - "/root" {puts "running as root"} - "/home" + "done" } +after 100 -send -- "ls -l testfile;pwd\r" +send -- "ls -l testfile; echo done\r" expect { timeout {puts "TESTING ERROR 2\n";exit} "testfile" } expect { timeout {puts "TESTING ERROR 3\n";exit} - "/root" {puts "running as root"} - "/home" + "done" } +after 100 -send -- "chown netblue:netblue testfile;pwd\r" +send -- "chown netblue:netblue testfile; echo done\r" expect { timeout {puts "TESTING ERROR 2\n";exit} "Bad system call" } expect { timeout {puts "TESTING ERROR 3\n";exit} - "/root" {puts "running as root"} - "/home" + "done" } -- cgit v1.2.3-54-g00ecf