From 6136e5397c182bfede2db5cd7cb1e50262a247ff Mon Sep 17 00:00:00 2001 From: netblue30 Date: Wed, 11 Oct 2017 09:27:12 -0400 Subject: testing --- test/apps/apps.sh | 183 +++-------------------------------------- test/apps/evince.exp | 83 ------------------- test/apps/hexchat.exp | 83 ------------------- test/apps/kcalc.exp | 83 +++++++++++++++++++ test/apps/ktorrent.exp | 83 +++++++++++++++++++ test/apps/transmission-gtk.exp | 78 ------------------ 6 files changed, 179 insertions(+), 414 deletions(-) delete mode 100755 test/apps/evince.exp delete mode 100755 test/apps/hexchat.exp create mode 100755 test/apps/kcalc.exp create mode 100755 test/apps/ktorrent.exp delete mode 100755 test/apps/transmission-gtk.exp (limited to 'test/apps') diff --git a/test/apps/apps.sh b/test/apps/apps.sh index 86b7f636e..efdc48cd1 100755 --- a/test/apps/apps.sh +++ b/test/apps/apps.sh @@ -6,174 +6,17 @@ export MALLOC_CHECK_=3 export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) -which firefox -if [ "$?" -eq 0 ]; -then - echo "TESTING: firefox" - ./firefox.exp -else - echo "TESTING SKIP: firefox not found" -fi +LIST="firefox midori chromium opera transmission-qt qbittorrent uget-gtk filezilla gthumb thunderbird " +LIST+="vlc fbreader deluge gnome-mplayer xchat wine" + +for app in $LIST; do + which $app + if [ "$?" -eq 0 ]; + then + echo "TESTING: $app" + ./$app.exp + else + echo "TESTING SKIP: $app not found" + fi +done -which midori -if [ "$?" -eq 0 ]; -then - echo "TESTING: midori" - ./midori.exp -else - echo "TESTING SKIP: midori not found" -fi - -which chromium -if [ "$?" -eq 0 ]; -then - echo "TESTING: chromium" - ./chromium.exp -else - echo "TESTING SKIP: chromium not found" -fi - -which opera -if [ "$?" -eq 0 ]; -then - echo "TESTING: opera" - ./opera.exp -else - echo "TESTING SKIP: opera not found" -fi - -which transmission-gtk -if [ "$?" -eq 0 ]; -then - echo "TESTING: transmission-gtk" - ./transmission-gtk.exp -else - echo "TESTING SKIP: transmission-gtk not found" -fi - -which transmission-qt -if [ "$?" -eq 0 ]; -then - echo "TESTING: transmission-qt" - ./transmission-qt.exp -else - echo "TESTING SKIP: transmission-qt not found" -fi - -which qbittorrent -if [ "$?" -eq 0 ]; -then - echo "TESTING: qbittorrent" - ./qbittorrent.exp -else - echo "TESTING SKIP: qbittorrent not found" -fi - -which uget-gtk -if [ "$?" -eq 0 ]; -then - echo "TESTING: uget" - ./uget-gtk.exp -else - echo "TESTING SKIP: uget-gtk not found" -fi - -which filezilla -if [ "$?" -eq 0 ]; -then - echo "TESTING: filezilla" - ./filezilla.exp -else - echo "TESTING SKIP: filezilla not found" -fi - -which evince -if [ "$?" -eq 0 ]; -then - echo "TESTING: evince" - ./evince.exp -else - echo "TESTING SKIP: evince not found" -fi - - -which gthumb -if [ "$?" -eq 0 ]; -then - echo "TESTING: gthumb" - ./gthumb.exp -else - echo "TESTING SKIP: gthumb not found" -fi - -which thunderbird -if [ "$?" -eq 0 ]; -then - echo "TESTING: thunderbird" - ./thunderbird.exp -else - echo "TESTING SKIP: thunderbird not found" -fi - -which vlc -if [ "$?" -eq 0 ]; -then - echo "TESTING: vlc" - ./vlc.exp -else - echo "TESTING SKIP: vlc not found" -fi - -which fbreader -if [ "$?" -eq 0 ]; -then - echo "TESTING: fbreader" - ./fbreader.exp -else - echo "TESTING SKIP: fbreader not found" -fi - -which deluge -if [ "$?" -eq 0 ]; -then - echo "TESTING: deluge" - ./deluge.exp -else - echo "TESTING SKIP: deluge not found" -fi - -which gnome-mplayer -if [ "$?" -eq 0 ]; -then - echo "TESTING: gnome-mplayer" - ./gnome-mplayer.exp -else - echo "TESTING SKIP: gnome-mplayer not found" -fi - -which xchat -if [ "$?" -eq 0 ]; -then - echo "TESTING: xchat" - ./xchat.exp -else - echo "TESTING SKIP: xchat not found" -fi - -which hexchat -if [ "$?" -eq 0 ]; -then - echo "TESTING: hexchat" - ./hexchat.exp -else - echo "TESTING SKIP: hexchat not found" -fi - -which wine -if [ "$?" -eq 0 ]; -then - echo "TESTING: wine" - ./wine.exp -else - echo "TESTING SKIP: wine not found" -fi diff --git a/test/apps/evince.exp b/test/apps/evince.exp deleted file mode 100755 index 5eada5fdf..000000000 --- a/test/apps/evince.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2017 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail evince\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Reading profile /etc/firejail/evince.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} - "evince" -} -after 100 - -# grsecurity exit -send -- "file /proc/sys/kernel/grsecurity\r" -expect { - timeout {puts "TESTING ERROR - grsecurity detection\n";exit} - "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} - "cannot open" {puts "grsecurity not present\n"} -} - -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} - "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} - ":firejail evince" -} -expect { - timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} - "Seccomp: 2" -} -expect { - timeout {puts "TESTING ERROR 5.1\n";exit} - "name=blablabla" -} -after 100 -send -- "firemon --caps\r" -expect { - timeout {puts "TESTING ERROR 6\n";exit} - ":firejail evince" -} -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" -} -after 100 - -puts "\nall done\n" diff --git a/test/apps/hexchat.exp b/test/apps/hexchat.exp deleted file mode 100755 index 9d78a9676..000000000 --- a/test/apps/hexchat.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2017 Firejail Authors -# License GPL v2 - -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" -} -after 100 - -# grsecurity exit -send -- "file /proc/sys/kernel/grsecurity\r" -expect { - timeout {puts "TESTING ERROR - grsecurity detection\n";exit} - "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} - "cannot open" {puts "grsecurity not present\n"} -} - -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} - "need to be root" {puts "/proc mounted as hidepid, exiting...\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" -} -after 100 -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" -} -after 100 - -puts "\n" diff --git a/test/apps/kcalc.exp b/test/apps/kcalc.exp new file mode 100755 index 000000000..8158625b4 --- /dev/null +++ b/test/apps/kcalc.exp @@ -0,0 +1,83 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2017 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail kcalc\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/kcalc.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} + "kcalc" +} +after 100 + +# grsecurity exit +send -- "file /proc/sys/kernel/grsecurity\r" +expect { + timeout {puts "TESTING ERROR - grsecurity detection\n";exit} + "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} + "cannot open" {puts "grsecurity not present\n"} +} + +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} + "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} + ":firejail kcalc" +} +expect { + timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} + "Seccomp: 2" +} +expect { + timeout {puts "TESTING ERROR 5.1\n";exit} + "name=blablabla" +} +after 100 +send -- "firemon --caps\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + ":firejail kcalc" +} +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" +} +after 100 + +puts "\nall done\n" diff --git a/test/apps/ktorrent.exp b/test/apps/ktorrent.exp new file mode 100755 index 000000000..cbad352ca --- /dev/null +++ b/test/apps/ktorrent.exp @@ -0,0 +1,83 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2017 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail ktorrent\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/ktorrent.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} + "ktorrent" +} +after 100 + +# grsecurity exit +send -- "file /proc/sys/kernel/grsecurity\r" +expect { + timeout {puts "TESTING ERROR - grsecurity detection\n";exit} + "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} + "cannot open" {puts "grsecurity not present\n"} +} + +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} + "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} + ":firejail ktorrent" +} +expect { + timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} + "Seccomp: 2" +} +expect { + timeout {puts "TESTING ERROR 5.1\n";exit} + "name=blablabla" +} +after 100 +send -- "firemon --caps\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + ":firejail ktorrent" +} +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" +} +after 100 + +puts "\nall done\n" diff --git a/test/apps/transmission-gtk.exp b/test/apps/transmission-gtk.exp deleted file mode 100755 index 4df1f7892..000000000 --- a/test/apps/transmission-gtk.exp +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2017 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail transmission-gtk\r" -expect { - timeout {puts "TESTING ERROR 1\n";exit} - "Child process initialized" -} -sleep 5 - -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} - "transmission-gtk" -} -after 100 - -# grsecurity exit -send -- "file /proc/sys/kernel/grsecurity\r" -expect { - timeout {puts "TESTING ERROR - grsecurity detection\n";exit} - "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} - "cannot open" {puts "grsecurity not present\n"} -} -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} - "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} - ":firejail transmission-gtk" -} -expect { - timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} - "Seccomp: 2" -} -expect { - timeout {puts "TESTING ERROR 5.1\n";exit} - "name=blablabla" -} -after 100 -send -- "firemon --caps\r" -expect { - timeout {puts "TESTING ERROR 6\n";exit} - ":firejail transmission-gtk" -} -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" -} -after 100 - -puts "\nall done\n" -- cgit v1.2.3-54-g00ecf