From a3bf167404043700ec3b561c3c9b1f7a10f35632 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Mon, 5 Oct 2020 11:20:43 -0400 Subject: testing --- test/apps-x11-xorg/apps-x11-xorg.sh | 9 ++++ test/apps-x11-xorg/firefox.exp | 4 +- test/apps-x11-xorg/thunderbird.exp | 4 +- test/apps-x11-xorg/transmission-gtk.exp | 4 +- test/apps-x11-xorg/transmission-qt.exp | 85 +++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+), 6 deletions(-) create mode 100755 test/apps-x11-xorg/transmission-qt.exp (limited to 'test/apps-x11-xorg') diff --git a/test/apps-x11-xorg/apps-x11-xorg.sh b/test/apps-x11-xorg/apps-x11-xorg.sh index 843fdc50b..568dee85d 100755 --- a/test/apps-x11-xorg/apps-x11-xorg.sh +++ b/test/apps-x11-xorg/apps-x11-xorg.sh @@ -25,6 +25,15 @@ else echo "TESTING SKIP: transmission-gtk not found" fi +which transmission-qt 2>/dev/null +if [ "$?" -eq 0 ]; +then + echo "TESTING: transmission-qt x11 xorg" + ./transmission-qt.exp +else + echo "TESTING SKIP: transmission-qt not found" +fi + which thunderbird 2>/dev/null if [ "$?" -eq 0 ]; then diff --git a/test/apps-x11-xorg/firefox.exp b/test/apps-x11-xorg/firefox.exp index 0a43db568..8322e2d0e 100755 --- a/test/apps-x11-xorg/firefox.exp +++ b/test/apps-x11-xorg/firefox.exp @@ -41,7 +41,7 @@ expect { sleep 2 spawn $env(SHELL) -send -- "firemon --seccomp --nowrap\r" +send -- "firemon --seccomp --wrap\r" expect { timeout {puts "TESTING ERROR 5\n";exit} "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} @@ -61,7 +61,7 @@ expect { "name=blablabla" } sleep 1 -send -- "firemon --caps --nowrap\r" +send -- "firemon --caps --wrap\r" expect { timeout {puts "TESTING ERROR 6\n";exit} " firefox" {puts "firefox detected\n";} diff --git a/test/apps-x11-xorg/thunderbird.exp b/test/apps-x11-xorg/thunderbird.exp index 8cf0ac244..24549e6c8 100755 --- a/test/apps-x11-xorg/thunderbird.exp +++ b/test/apps-x11-xorg/thunderbird.exp @@ -38,7 +38,7 @@ expect { sleep 2 spawn $env(SHELL) -send -- "firemon --seccomp --nowrap\r" +send -- "firemon --seccomp --wrap\r" expect { timeout {puts "TESTING ERROR 5\n";exit} "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} @@ -57,7 +57,7 @@ expect { "name=blablabla" } sleep 2 -send -- "firemon --caps --nowrap\r" +send -- "firemon --caps --wrap\r" expect { timeout {puts "TESTING ERROR 6\n";exit} ":firejail" diff --git a/test/apps-x11-xorg/transmission-gtk.exp b/test/apps-x11-xorg/transmission-gtk.exp index fdbf388e9..b688bc619 100755 --- a/test/apps-x11-xorg/transmission-gtk.exp +++ b/test/apps-x11-xorg/transmission-gtk.exp @@ -38,7 +38,7 @@ expect { sleep 2 spawn $env(SHELL) -send -- "firemon --seccomp --nowrap\r" +send -- "firemon --seccomp --wrap\r" expect { timeout {puts "TESTING ERROR 5\n";exit} "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} @@ -57,7 +57,7 @@ expect { "name=blablabla" } sleep 1 -send -- "firemon --caps --nowrap\r" +send -- "firemon --caps --wrap\r" expect { timeout {puts "TESTING ERROR 6\n";exit} ":firejail" diff --git a/test/apps-x11-xorg/transmission-qt.exp b/test/apps-x11-xorg/transmission-qt.exp new file mode 100755 index 000000000..5864bb845 --- /dev/null +++ b/test/apps-x11-xorg/transmission-qt.exp @@ -0,0 +1,85 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2020 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --name=test --x11=xorg --ignore=net --ignore=netfilter --ignore=iprange transmission-qt\r" +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} + "transmission-qt" +} +sleep 1 + +# 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 --wrap\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} + ":firejail" +} +expect { + timeout {puts "TESTING ERROR 5.0\n";exit} + "transmission-qt" +} +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 --wrap\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + ":firejail" +} +expect { + timeout {puts "TESTING ERROR 6.0\n";exit} + "transmission-qt" +} +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 +send -- "firejail --shutdown=test\r" +sleep 3 + +puts "\nall done\n" -- cgit v1.2.3-54-g00ecf