From 2b8b8e54968d068599d5800f88869efcadd316ac Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sat, 28 Nov 2015 07:37:32 -0500 Subject: profile cleanup, addinghexchat profile --- test/evince.exp | 2 +- test/fbreader.exp | 2 +- test/hexchat.exp | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ test/test.sh | 35 +++++++++++++++++++++++++++ test/vlc.exp | 2 +- test/weechat.exp | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ test/wine.exp | 30 +++++++++++++++++++++++ test/xchat.exp | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 281 insertions(+), 3 deletions(-) create mode 100755 test/hexchat.exp create mode 100755 test/weechat.exp create mode 100755 test/wine.exp create mode 100755 test/xchat.exp (limited to 'test') diff --git a/test/evince.exp b/test/evince.exp index 7b115144c..ba6ca1b6d 100755 --- a/test/evince.exp +++ b/test/evince.exp @@ -13,7 +13,7 @@ expect { timeout {puts "TESTING ERROR 1\n";exit} "Child process initialized" } -sleep 10 +sleep 3 spawn $env(SHELL) send -- "firejail --list\r" diff --git a/test/fbreader.exp b/test/fbreader.exp index 546710b97..a4df50932 100755 --- a/test/fbreader.exp +++ b/test/fbreader.exp @@ -13,7 +13,7 @@ expect { timeout {puts "TESTING ERROR 1\n";exit} "Child process initialized" } -sleep 10 +sleep 3 spawn $env(SHELL) send -- "firejail --list\r" diff --git a/test/hexchat.exp b/test/hexchat.exp new file mode 100755 index 000000000..0653bcb13 --- /dev/null +++ b/test/hexchat.exp @@ -0,0 +1,71 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail hexchat\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/hexchat.profile" +} +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 3 + +spawn $env(SHELL) +send -- "firejail --list\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + ":firejail" +} +expect { + timeout {puts "TESTING ERROR 3.1\n";exit} + "hexchat" +} +sleep 1 +send -- "firejail --name=blablabla\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Child process initialized" +} +sleep 2 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "hexchat" +} +expect { + timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} + "Seccomp: 2" +} +expect { + timeout {puts "TESTING ERROR 5.1\n";exit} + "name=blablabla" +} +sleep 1 +send -- "firemon --caps\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "hexchat" +} +expect { + timeout {puts "TESTING ERROR 6.1\n";exit} + "CapBnd:" +} +expect { + timeout {puts "TESTING ERROR 6.2\n";exit} + "0000000000000000" +} +expect { + timeout {puts "TESTING ERROR 6.3\n";exit} + "name=blablabla" +} +sleep 1 + +puts "\n" + diff --git a/test/test.sh b/test/test.sh index fdb1f8ed7..aaae2a981 100755 --- a/test/test.sh +++ b/test/test.sh @@ -260,6 +260,41 @@ else echo "TESTING: gnome-mplayer not found" fi +which xchat +if [ "$?" -eq 0 ]; +then + echo "TESTING: xchat" + ./xchat.exp +else + echo "TESTING: xchat not found" +fi + +which hexchat +if [ "$?" -eq 0 ]; +then + echo "TESTING: hexchat" + ./hexchat.exp +else + echo "TESTING: hexchat not found" +fi + +which weechat-curses +if [ "$?" -eq 0 ]; +then + echo "TESTING: weechat" + ./weechat.exp +else + echo "TESTING: weechat not found" +fi + +#which wine +#if [ "$?" -eq 0 ]; +#then +# echo "TESTING: wine" +# ./wine.exp +#else +# echo "TESTING: wine not found" +#fi diff --git a/test/vlc.exp b/test/vlc.exp index 8ab5aa2ce..53d25c9dd 100755 --- a/test/vlc.exp +++ b/test/vlc.exp @@ -13,7 +13,7 @@ expect { timeout {puts "TESTING ERROR 1\n";exit} "Child process initialized" } -sleep 10 +sleep 3 spawn $env(SHELL) send -- "firejail --list\r" diff --git a/test/weechat.exp b/test/weechat.exp new file mode 100755 index 000000000..ac2430280 --- /dev/null +++ b/test/weechat.exp @@ -0,0 +1,71 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail weechat-curses\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/weechat.profile" +} +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 3 + +spawn $env(SHELL) +send -- "firejail --list\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + ":firejail" +} +expect { + timeout {puts "TESTING ERROR 3.1\n";exit} + "weechat-curses" +} +sleep 1 +send -- "firejail --name=blablabla\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Child process initialized" +} +sleep 2 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "weechat-curses" +} +expect { + timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} + "Seccomp: 2" +} +expect { + timeout {puts "TESTING ERROR 5.1\n";exit} + "name=blablabla" +} +sleep 1 +send -- "firemon --caps\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "weechat-curses" +} +expect { + timeout {puts "TESTING ERROR 6.1\n";exit} + "CapBnd:" +} +expect { + timeout {puts "TESTING ERROR 6.2\n";exit} + "0000000000000000" +} +expect { + timeout {puts "TESTING ERROR 6.3\n";exit} + "name=blablabla" +} +sleep 1 + +puts "\n" + diff --git a/test/wine.exp b/test/wine.exp new file mode 100755 index 000000000..d87c1f205 --- /dev/null +++ b/test/wine.exp @@ -0,0 +1,30 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail wine --help\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/wine.profile" +} +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Usage: wine PROGRAM" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "wine --version" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "parent is shutting down, bye..." +} + +puts "\nall done\n" + diff --git a/test/xchat.exp b/test/xchat.exp new file mode 100755 index 000000000..babbcf87d --- /dev/null +++ b/test/xchat.exp @@ -0,0 +1,71 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail xchat\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/xchat.profile" +} +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 3 + +spawn $env(SHELL) +send -- "firejail --list\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + ":firejail" +} +expect { + timeout {puts "TESTING ERROR 3.1\n";exit} + "xchat" +} +sleep 1 +send -- "firejail --name=blablabla\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Child process initialized" +} +sleep 2 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + " xchat" +} +expect { + timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} + "Seccomp: 2" +} +expect { + timeout {puts "TESTING ERROR 5.1\n";exit} + "name=blablabla" +} +sleep 1 +send -- "firemon --caps\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + " xchat" +} +expect { + timeout {puts "TESTING ERROR 6.1\n";exit} + "CapBnd:" +} +expect { + timeout {puts "TESTING ERROR 6.2\n";exit} + "0000000000000000" +} +expect { + timeout {puts "TESTING ERROR 6.3\n";exit} + "name=blablabla" +} +sleep 1 + +puts "\n" + -- cgit v1.2.3-70-g09d2