From ab29174701697c6ea844bb81d48d0965fcee352d Mon Sep 17 00:00:00 2001 From: netblue30 Date: Fri, 16 Oct 2015 09:38:18 -0400 Subject: testing --- test/deluge.exp | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ test/gnome-mplayer.exp | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ test/test.sh | 21 ++++++++++++++- 3 files changed, 164 insertions(+), 1 deletion(-) create mode 100755 test/deluge.exp create mode 100755 test/gnome-mplayer.exp diff --git a/test/deluge.exp b/test/deluge.exp new file mode 100755 index 000000000..49266813e --- /dev/null +++ b/test/deluge.exp @@ -0,0 +1,72 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail deluge\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/deluge.profile" +} +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 10 + +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} + "deluge" +} +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} + ":firejail deluge" +} +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} + ":firejail deluge" +} +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/gnome-mplayer.exp b/test/gnome-mplayer.exp new file mode 100755 index 000000000..e8acc295c --- /dev/null +++ b/test/gnome-mplayer.exp @@ -0,0 +1,72 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail gnome-mplayer\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/gnome-mplayer.profile" +} +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 10 + +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} + "gnome-mplayer" +} +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} + ":firejail gnome-mplayer" +} +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} + ":firejail gnome-mplayer" +} +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 bca7c41e9..80aa7f3e8 100755 --- a/test/test.sh +++ b/test/test.sh @@ -228,11 +228,30 @@ which fbreader if [ "$?" -eq 0 ]; then echo "TESTING: fbreader" - ./vlc.exp + ./fbreader.exp else echo "TESTING: fbreader not found" fi +which deluge +if [ "$?" -eq 0 ]; +then + echo "TESTING: deluge" + ./deluge.exp +else + echo "TESTING: deluge not found" +fi + +which gnome-mplayer +if [ "$?" -eq 0 ]; +then + echo "TESTING: gnome-mplayer" + ./gnome-mplayer.exp +else + echo "TESTING: gnome-mplayer not found" +fi + + -- cgit v1.2.3-54-g00ecf