From 096c99664fb2a84c13e2ae72738bbfd9beadcdcb Mon Sep 17 00:00:00 2001 From: netblue30 Date: Fri, 16 Jan 2026 08:28:49 -0500 Subject: [PATCH] testing --- Makefile | 41 +------- test/apps-x11-xorg/apps-x11-xorg.sh | 40 -------- test/apps-x11-xorg/firefox.exp | 90 ----------------- test/apps-x11-xorg/thunderbird.exp | 85 ---------------- test/apps-x11-xorg/transmission-gtk.exp | 85 ---------------- test/apps-x11-xorg/transmission-qt.exp | 85 ---------------- test/apps-x11/apps-x11.sh | 78 --------------- test/apps-x11/chromium.exp | 85 ---------------- test/apps-x11/firefox.exp | 90 ----------------- test/apps-x11/thunderbird.exp | 85 ---------------- test/apps-x11/transmission-gtk.exp | 85 ---------------- test/apps-x11/xterm-xpra.exp | 97 ------------------- test/apps/apps.sh | 8 +- test/apps/chromium.exp | 83 ---------------- test/apps/deluge.exp | 83 ---------------- test/apps/fbreader.exp | 83 ---------------- test/apps/filezilla.exp | 83 ---------------- .../firefox-xephyr.exp} | 45 ++++----- test/apps/firefox-xorg.exp | 45 +++++++++ test/apps/firefox.exp | 80 +++------------ test/apps/galculator.exp | 45 +++++++++ test/apps/gnome-mplayer.exp | 83 ---------------- test/apps/gthumb.exp | 83 ---------------- test/apps/hexchat.exp | 83 ---------------- test/apps/kcalc.exp | 83 ---------------- test/apps/ktorrent.exp | 83 ---------------- test/apps/{wine.exp => lowriter.exp} | 23 ++++- test/apps/midori.exp | 84 ---------------- test/apps/opera.exp | 83 ---------------- test/apps/qbittorrent.exp | 56 ++--------- test/apps/thunderbird.exp | 83 ---------------- test/apps/transmission-qt.exp | 83 ---------------- test/apps/uget-gtk.exp | 83 ---------------- test/apps/vlc.exp | 83 ---------------- test/{apps-x11 => apps}/x11-none.exp | 2 +- test/apps/xchat.exp | 83 ---------------- test/{apps-x11 => apps}/xterm-xephyr.exp | 35 ++----- test/{apps-x11 => apps}/xterm-xorg.exp | 33 +------ 38 files changed, 166 insertions(+), 2481 deletions(-) delete mode 100755 test/apps-x11-xorg/apps-x11-xorg.sh delete mode 100755 test/apps-x11-xorg/firefox.exp delete mode 100755 test/apps-x11-xorg/thunderbird.exp delete mode 100755 test/apps-x11-xorg/transmission-gtk.exp delete mode 100755 test/apps-x11-xorg/transmission-qt.exp delete mode 100755 test/apps-x11/apps-x11.sh delete mode 100755 test/apps-x11/chromium.exp delete mode 100755 test/apps-x11/firefox.exp delete mode 100755 test/apps-x11/thunderbird.exp delete mode 100755 test/apps-x11/transmission-gtk.exp delete mode 100755 test/apps-x11/xterm-xpra.exp delete mode 100755 test/apps/chromium.exp delete mode 100755 test/apps/deluge.exp delete mode 100755 test/apps/fbreader.exp delete mode 100755 test/apps/filezilla.exp rename test/{apps-x11/x11-xephyr.exp => apps/firefox-xephyr.exp} (55%) create mode 100755 test/apps/firefox-xorg.exp create mode 100755 test/apps/galculator.exp delete mode 100755 test/apps/gnome-mplayer.exp delete mode 100755 test/apps/gthumb.exp delete mode 100755 test/apps/hexchat.exp delete mode 100755 test/apps/kcalc.exp delete mode 100755 test/apps/ktorrent.exp rename test/apps/{wine.exp => lowriter.exp} (62%) delete mode 100755 test/apps/midori.exp delete mode 100755 test/apps/opera.exp delete mode 100755 test/apps/thunderbird.exp delete mode 100755 test/apps/transmission-qt.exp delete mode 100755 test/apps/uget-gtk.exp delete mode 100755 test/apps/vlc.exp rename test/{apps-x11 => apps}/x11-none.exp (95%) delete mode 100755 test/apps/xchat.exp rename test/{apps-x11 => apps}/xterm-xephyr.exp (60%) rename test/{apps-x11 => apps}/xterm-xorg.exp (63%) diff --git a/Makefile b/Makefile index 84935b283..c0a6ab18c 100644 --- a/Makefile +++ b/Makefile @@ -335,8 +335,6 @@ DISTFILES = \ DISTFILES_TEST = \ test/Makefile \ test/apps \ - test/apps-x11 \ - test/apps-x11-xorg \ test/capabilities \ test/compile \ test/environment \ @@ -420,7 +418,7 @@ sort-profiles: $(PROFILES_INC) $(PROFILES_PRO) # make test # -TESTS=profiles capabilities apps apps-x11 apps-x11-xorg sysutils utils environment filters fs fcopy fnettrace fnetfilter private-etc seccomp-extra +TESTS=profiles capabilities apps sysutils utils environment filters fs fcopy fnettrace fnetfilter private-etc seccomp-extra TEST_TARGETS=$(patsubst %,test-%,$(TESTS)) $(TEST_TARGETS): @@ -435,42 +433,5 @@ lab-setup:; uname -r; ldd --version | grep GLIBC; pwd; whoami; ip addr show; cat test: lab-setup test-profiles test-fcopy test-fnettrace test-fnetfilter test-fs test-private-etc test-utils test-sysutils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-seccomp-extra echo "TEST COMPLETE" -# not included in "make dist" and "make test" -.PHONY: test-appimage -test-appimage: - $(MAKE) -C test $(subst test-,,$@) -# using sudo; not included in "make dist" and "make test" -.PHONY: test-chroot -test-chroot: - $(MAKE) -C test $(subst test-,,$@) -# using sudo; not included in "make dist" and "make test" -.PHONY: test-network -test-network: - $(MAKE) -C test $(subst test-,,$@) - -# using sudo; not included in "make dist" and "make test" -.PHONY: test-apparmor -test-apparmor: - $(MAKE) -C test $(subst test-,,$@) - -# using sudo; not included in "make dist" and "make test" -.PHONY: test-firecfg -test-firecfg: - $(MAKE) -C test $(subst test-,,$@) - -########################################## -# Individual tests, some of them require root access -# The tests are very intrusive, by the time you are done -# with them you will need to restart your computer. -########################################## -# private-lib is disabled by default in /etc/firejail/firejail.config -.PHONY: test-private-lib -test-private-lib: - $(MAKE) -C test $(subst test-,,$@) - -# Root access, network devices are created before the test -# restart your computer to get rid of these devices - -# For testing hidepid system, the command to set it up is "mount -o remount,rw,hidepid=2 /proc" diff --git a/test/apps-x11-xorg/apps-x11-xorg.sh b/test/apps-x11-xorg/apps-x11-xorg.sh deleted file mode 100755 index c7a434588..000000000 --- a/test/apps-x11-xorg/apps-x11-xorg.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -export MALLOC_CHECK_=3 -export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) -export LC_ALL=C - -if command -v firefox -then - echo "TESTING: firefox x11 xorg" - ./firefox.exp -else - echo "TESTING SKIP: firefox not found" -fi - -if command -v transmission-gtk -then - echo "TESTING: transmission-gtk x11 xorg" - ./transmission-gtk.exp -else - echo "TESTING SKIP: transmission-gtk not found" -fi - -if command -v transmission-qt -then - echo "TESTING: transmission-qt x11 xorg" - ./transmission-qt.exp -else - echo "TESTING SKIP: transmission-qt not found" -fi - -if command -v thunderbird -then - echo "TESTING: thunderbird x11 xorg" - ./thunderbird.exp -else - echo "TESTING SKIP: thunderbird not found" -fi diff --git a/test/apps-x11-xorg/firefox.exp b/test/apps-x11-xorg/firefox.exp deleted file mode 100755 index e01264310..000000000 --- a/test/apps-x11-xorg/firefox.exp +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 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 firefox -no-remote www.gentoo.org\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} - "firefox" {puts "firefox detected\n";} - "iceweasel" {puts "iceweasel detected\n";} -} -expect { - timeout {puts "TESTING ERROR 3.2\n";exit} - "no-remote" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - " firefox" {puts "firefox detected\n";} - " iceweasel" {puts "iceweasel detected\n";} -} -expect { - timeout {puts "TESTING ERROR 5.0\n";exit} - "no-remote" -} -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} - " firefox" {puts "firefox detected\n";} - " iceweasel" {puts "iceweasel detected\n";} -} -expect { - timeout {puts "TESTING ERROR 6.0\n";exit} - "no-remote" -} -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" diff --git a/test/apps-x11-xorg/thunderbird.exp b/test/apps-x11-xorg/thunderbird.exp deleted file mode 100755 index d4935f6f1..000000000 --- a/test/apps-x11-xorg/thunderbird.exp +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 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 thunderbird\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} - "thunderbird" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - "thunderbird" -} -expect { - timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} - "Seccomp: 2" -} -expect { - timeout {puts "TESTING ERROR 5.1\n";exit} - "name=blablabla" -} -sleep 2 -send -- "firemon --caps --wrap\r" -expect { - timeout {puts "TESTING ERROR 6\n";exit} - ":firejail" -} -expect { - timeout {puts "TESTING ERROR 6.0\n";exit} - "thunderbird" -} -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" diff --git a/test/apps-x11-xorg/transmission-gtk.exp b/test/apps-x11-xorg/transmission-gtk.exp deleted file mode 100755 index 666e00a8b..000000000 --- a/test/apps-x11-xorg/transmission-gtk.exp +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 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-gtk\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-gtk" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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-gtk" -} -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-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" -} -sleep 1 -send -- "firejail --shutdown=test\r" -sleep 3 - -puts "\nall done\n" diff --git a/test/apps-x11-xorg/transmission-qt.exp b/test/apps-x11-xorg/transmission-qt.exp deleted file mode 100755 index 1b8b79496..000000000 --- a/test/apps-x11-xorg/transmission-qt.exp +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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" diff --git a/test/apps-x11/apps-x11.sh b/test/apps-x11/apps-x11.sh deleted file mode 100755 index 0fb8c91d1..000000000 --- a/test/apps-x11/apps-x11.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -export MALLOC_CHECK_=3 -export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) -export LC_ALL=C - -echo "TESTING: no x11 (test/apps-x11/x11-none.exp)" -./x11-none.exp - -if command -v xterm -then - echo "TESTING: xterm x11 xorg" - ./xterm-xorg.exp - - if command -v xpra - then - echo "TESTING: xterm x11 xpra" - ./xterm-xpra.exp - fi - - if command -v Xephyr - then - echo "TESTING: xterm x11 xephyr" - ./xterm-xephyr.exp - fi -else - echo "TESTING SKIP: xterm not found" -fi - -# check xpra/xephyr -if command -v xpra -then - echo "xpra found" -else - echo "xpra not found" - if command -v Xephyr - then - echo "Xephyr found" - else - echo "TESTING SKIP: xpra and/or Xephyr not found" - exit - fi -fi - -if command -v firefox -then - echo "TESTING: firefox x11" - ./firefox.exp -else - echo "TESTING SKIP: firefox not found" -fi - -if command -v chromium -then - echo "TESTING: chromium x11" - ./chromium.exp -else - echo "TESTING SKIP: chromium not found" -fi - -if command -v transmission-gtk -then - echo "TESTING: transmission-gtk x11" - ./transmission-gtk.exp -else - echo "TESTING SKIP: transmission-gtk not found" -fi - -if command -v thunderbird -then - echo "TESTING: thunderbird x11" - ./thunderbird.exp -else - echo "TESTING SKIP: thunderbird not found" -fi diff --git a/test/apps-x11/chromium.exp b/test/apps-x11/chromium.exp deleted file mode 100755 index 20a8304a8..000000000 --- a/test/apps-x11/chromium.exp +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --name=test --x11 chromium www.gentoo.org\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} - "chromium" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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" -} -expect { - timeout {puts "TESTING ERROR 5.0\n";exit} - "chromium" -} -expect { - timeout {puts "TESTING ERROR 5.1\n";exit} - "Seccomp: 0" -} -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" -} -expect { - timeout {puts "TESTING ERROR 6.0\n";exit} - "chromium" -} -expect { - timeout {puts "TESTING ERROR 6.1\n";exit} - "CapBnd:" -} -expect { - timeout {puts "TESTING ERROR 6.2\n";exit} - "00240000" -} -expect { - timeout {puts "TESTING ERROR 6.3\n";exit} - "name=blablabla" -} -sleep 1 -send -- "firejail --shutdown=test\r" -sleep 3 - - -puts "\nall done\n" diff --git a/test/apps-x11/firefox.exp b/test/apps-x11/firefox.exp deleted file mode 100755 index 19c5d0103..000000000 --- a/test/apps-x11/firefox.exp +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --name=test --x11 firefox -no-remote www.gentoo.org\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} - "firefox" {puts "firefox detected\n";} - "iceweasel" {puts "iceweasel detected\n";} -} -expect { - timeout {puts "TESTING ERROR 3.2\n";exit} - "no-remote" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - " firefox" {puts "firefox detected\n";} - " iceweasel" {puts "iceweasel detected\n";} -} -expect { - timeout {puts "TESTING ERROR 5.0\n";exit} - "no-remote" -} -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} - " firefox" {puts "firefox detected\n";} - " iceweasel" {puts "iceweasel detected\n";} -} -expect { - timeout {puts "TESTING ERROR 6.0\n";exit} - "no-remote" -} -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" diff --git a/test/apps-x11/thunderbird.exp b/test/apps-x11/thunderbird.exp deleted file mode 100755 index 1ef34d4db..000000000 --- a/test/apps-x11/thunderbird.exp +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --name=test --x11 thunderbird\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} - "thunderbird" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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" -} -expect { - timeout {puts "TESTING ERROR 5.0\n";exit} - "thunderbird" -} -expect { - timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} - "Seccomp: 2" -} -expect { - timeout {puts "TESTING ERROR 5.1\n";exit} - "name=blablabla" -} -sleep 2 -send -- "firemon --caps\r" -expect { - timeout {puts "TESTING ERROR 6\n";exit} - ":firejail" -} -expect { - timeout {puts "TESTING ERROR 6.0\n";exit} - "thunderbird" -} -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" diff --git a/test/apps-x11/transmission-gtk.exp b/test/apps-x11/transmission-gtk.exp deleted file mode 100755 index 0b1a49f0a..000000000 --- a/test/apps-x11/transmission-gtk.exp +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --name=test --x11 transmission-gtk\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-gtk" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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" -} -expect { - timeout {puts "TESTING ERROR 5.0\n";exit} - "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" -} -sleep 1 -send -- "firemon --caps\r" -expect { - timeout {puts "TESTING ERROR 6\n";exit} - ":firejail" -} -expect { - timeout {puts "TESTING ERROR 6.0\n";exit} - "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" -} -sleep 1 -send -- "firejail --shutdown=test\r" -sleep 3 - -puts "\nall done\n" diff --git a/test/apps-x11/xterm-xpra.exp b/test/apps-x11/xterm-xpra.exp deleted file mode 100755 index fc7e44a7b..000000000 --- a/test/apps-x11/xterm-xpra.exp +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --name=test --x11=xpra xterm\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} - "xterm" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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" -} -expect { - timeout {puts "TESTING ERROR 5.0\n";exit} - "xterm" -} -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" -} -expect { - timeout {puts "TESTING ERROR 6.0\n";exit} - "xterm" -} -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 -- "firemon --x11\r" -expect { - timeout {puts "TESTING ERROR 7\n";exit} - "name=test xterm" -} -expect { - timeout {puts "TESTING ERROR 7.1\n";exit} - "DISPLAY" -} -sleep 1 - -send -- "firejail --shutdown=test\r" -sleep 3 - -puts "\nall done\n" diff --git a/test/apps/apps.sh b/test/apps/apps.sh index 96551b565..4fb39fd9f 100755 --- a/test/apps/apps.sh +++ b/test/apps/apps.sh @@ -7,14 +7,16 @@ export MALLOC_CHECK_=3 export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) export LC_ALL=C -apps=(firefox midori chromium opera transmission-qt qbittorrent uget-gtk filezilla gthumb thunderbird vlc fbreader deluge gnome-mplayer xchat wine kcalc ktorrent hexchat) +apps=(dsdfasdf firefox qbittorrent firefox-xephyr galculator lowriter firefox-xorg \ + x11-none xterm-xorg xterm-xephyr) for app in "${apps[@]}"; do - if command -v "$app" + if file -v "$app".exp then echo "TESTING: $app" - ./$app.exp + ./"$app".exp else echo "TESTING SKIP: $app not found" fi + sleep 1 done diff --git a/test/apps/chromium.exp b/test/apps/chromium.exp deleted file mode 100755 index 1c67f2fe5..000000000 --- a/test/apps/chromium.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail chromium www.gentoo.org\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Reading profile /etc/firejail/chromium.profile" -} -expect { - timeout {puts "TESTING ERROR 1\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - "chromium" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 chromium" -} -expect { - timeout {puts "TESTING ERROR 5.1\n";exit} - "Seccomp: 0" -} -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 chromium" -} -expect { - timeout {puts "TESTING ERROR 6.1\n";exit} - "CapBnd:" -} -expect { - timeout {puts "TESTING ERROR 6.2\n";exit} - "00240000" -} -expect { - timeout {puts "TESTING ERROR 6.3\n";exit} - "name=blablabla" -} -after 100 - -puts "\n" diff --git a/test/apps/deluge.exp b/test/apps/deluge.exp deleted file mode 100755 index cc072c7b7..000000000 --- a/test/apps/deluge.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 deluge" -} -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 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" -} -after 100 - -puts "\n" diff --git a/test/apps/fbreader.exp b/test/apps/fbreader.exp deleted file mode 100755 index a3ee6c519..000000000 --- a/test/apps/fbreader.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail fbreader\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Reading profile /etc/firejail/fbreader.profile" -} -expect { - timeout {puts "TESTING ERROR 1\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - "fbreader" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 fbreader" -} -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 fbreader" -} -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/filezilla.exp b/test/apps/filezilla.exp deleted file mode 100755 index 4eb60167e..000000000 --- a/test/apps/filezilla.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail filezilla\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Reading profile /etc/firejail/filezilla.profile" -} -expect { - timeout {puts "TESTING ERROR 1\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - "filezilla" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 filezilla" -} -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 filezilla" -} -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-x11/x11-xephyr.exp b/test/apps/firefox-xephyr.exp similarity index 55% rename from test/apps-x11/x11-xephyr.exp rename to test/apps/firefox-xephyr.exp index d53af11cb..3235581b2 100755 --- a/test/apps-x11/x11-xephyr.exp +++ b/test/apps/firefox-xephyr.exp @@ -7,52 +7,43 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -send -- "firejail --name=test --x11=xephyr xterm\r" -expect { - timeout {puts "TESTING ERROR 1\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} - -exit - - -sleep 5 - - +send -- "firejail --name=firefox-test --xephyr-screen=1024x768 --private --x11 firefox --no-remote www.debian.org\r" expect { timeout {puts "TESTING ERROR 0\n";exit} - "use network namespace in firejail" + "Reading profile /etc/firejail/firefox.profile" } -sleep 1 - -send -- "firejail --name=test --net=none --x11=none\r" expect { timeout {puts "TESTING ERROR 1\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } -sleep 1 +sleep 5 -send -- "ls -al /tmp/.X11-unix\r" +spawn $env(SHELL) +send -- "firejail --list\r" expect { timeout {puts "TESTING ERROR 2\n";exit} - "cannot open directory" + "firejail" } -after 100 - -send -- "xterm\r" expect { timeout {puts "TESTING ERROR 3\n";exit} - "DISPLAY is not set" + "firefox" } after 100 -send -- "export DISPLAY=:0.0\r" -after 100 -send -- "xterm\r" +spawn $env(SHELL) +send -- "firemon --seccomp\r" expect { timeout {puts "TESTING ERROR 4\n";exit} - "Xt error" + "firefox" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" } after 100 +send -- "firejail --shutdown=firefox-test\r" +sleep 3 + + puts "\nall done\n" diff --git a/test/apps/firefox-xorg.exp b/test/apps/firefox-xorg.exp new file mode 100755 index 000000000..d80f5b0a6 --- /dev/null +++ b/test/apps/firefox-xorg.exp @@ -0,0 +1,45 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2026 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --private --x11=xorg firefox --no-remote www.debian.org\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/firefox.profile" +} +expect { + timeout {puts "TESTING ERROR 1\n";exit} + -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" +} +sleep 5 + +spawn $env(SHELL) +send -- "firejail --list\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "firejail" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "firefox" +} +after 100 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "firefox" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" +} +after 100 + +puts "\nall done\n" diff --git a/test/apps/firefox.exp b/test/apps/firefox.exp index 77cbeae47..e2eefa256 100755 --- a/test/apps/firefox.exp +++ b/test/apps/firefox.exp @@ -7,7 +7,7 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -send -- "firejail firefox -no-remote www.gentoo.org\r" +send -- "firejail --private firefox --no-remote www.debian.org\r" expect { timeout {puts "TESTING ERROR 0\n";exit} "Reading profile /etc/firejail/firefox.profile" @@ -16,84 +16,30 @@ expect { timeout {puts "TESTING ERROR 1\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } -sleep 10 +sleep 3 spawn $env(SHELL) send -- "firejail --list\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "firejail" +} expect { timeout {puts "TESTING ERROR 3\n";exit} - ":firejail" -} -expect { - timeout {puts "TESTING ERROR 3.1\n";exit} - "firefox" {puts "firefox detected\n";} - "iceweasel" {puts "iceweasel detected\n";} -} -expect { - timeout {puts "TESTING ERROR 3.2\n";exit} - "no-remote" + "firefox" } 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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -sleep 2 - spawn $env(SHELL) send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "firefox" +} expect { timeout {puts "TESTING ERROR 5\n";exit} - "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} - " firefox" {puts "firefox detected\n";} - " iceweasel" {puts "iceweasel detected\n";} -} -expect { - timeout {puts "TESTING ERROR 5.0\n";exit} - "no-remote" -} -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} - " firefox" {puts "firefox detected\n";} - " iceweasel" {puts "iceweasel detected\n";} -} -expect { - timeout {puts "TESTING ERROR 6.0\n";exit} - "no-remote" -} -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 +sleep 1 -puts "\n" +puts "\nall done\n" diff --git a/test/apps/galculator.exp b/test/apps/galculator.exp new file mode 100755 index 000000000..5dfe4bfa5 --- /dev/null +++ b/test/apps/galculator.exp @@ -0,0 +1,45 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2026 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --private galculator\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/galculator.profile" +} +expect { + timeout {puts "TESTING ERROR 1\n";exit} + -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" +} +sleep 5 + +spawn $env(SHELL) +send -- "firejail --list\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "firejail" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "galculator" +} +after 100 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "galculator" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" +} +after 100 + +puts "\nall done\n" diff --git a/test/apps/gnome-mplayer.exp b/test/apps/gnome-mplayer.exp deleted file mode 100755 index 39a616762..000000000 --- a/test/apps/gnome-mplayer.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - "gnome-mplayer" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 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" -} -after 100 -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" -} -after 100 - -puts "\nall done\n" diff --git a/test/apps/gthumb.exp b/test/apps/gthumb.exp deleted file mode 100755 index 197afb29c..000000000 --- a/test/apps/gthumb.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail gthumb\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Reading profile /etc/firejail/gthumb.profile" -} -expect { - timeout {puts "TESTING ERROR 1\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - "gthumb" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 gthumb" -} -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 gthumb" -} -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 40043a265..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-2026 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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 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} - ":firejail 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 "\nall done\n" diff --git a/test/apps/kcalc.exp b/test/apps/kcalc.exp deleted file mode 100755 index 72e772da8..000000000 --- a/test/apps/kcalc.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 deleted file mode 100755 index a209fd0ad..000000000 --- a/test/apps/ktorrent.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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/wine.exp b/test/apps/lowriter.exp similarity index 62% rename from test/apps/wine.exp rename to test/apps/lowriter.exp index 9e480c53f..8cc34e34a 100755 --- a/test/apps/wine.exp +++ b/test/apps/lowriter.exp @@ -7,26 +7,39 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -send -- "firejail wine --help\r" +send -- "firejail lowriter\r" expect { timeout {puts "TESTING ERROR 0\n";exit} - "Reading profile /etc/firejail/wine.profile" + "Reading profile /etc/firejail/lowriter.profile" } expect { timeout {puts "TESTING ERROR 1\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } +sleep 5 + +spawn $env(SHELL) +send -- "firejail --list\r" expect { timeout {puts "TESTING ERROR 2\n";exit} - "Usage: wine PROGRAM" + "firejail" } expect { timeout {puts "TESTING ERROR 3\n";exit} - "wine --version" + "lowriter" } +after 100 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" expect { timeout {puts "TESTING ERROR 4\n";exit} - "Parent is shutting down, bye..." + "lowriter" } +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" +} +after 100 puts "\nall done\n" diff --git a/test/apps/midori.exp b/test/apps/midori.exp deleted file mode 100755 index 1231e179d..000000000 --- a/test/apps/midori.exp +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail midori www.gentoo.org\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Reading profile /etc/firejail/midori.profile" -} -expect { - timeout {puts "TESTING ERROR 1\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - "midori" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 midori" -} -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 midori" -} -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.3n";exit} - "name=blablabla" -} -after 100 - - -puts "\n" diff --git a/test/apps/opera.exp b/test/apps/opera.exp deleted file mode 100755 index afb9dc0a1..000000000 --- a/test/apps/opera.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail opera www.gentoo.org\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Reading profile /etc/firejail/opera.profile" -} -expect { - timeout {puts "TESTING ERROR 1\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - "opera" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 opera" -} -expect { - timeout {puts "TESTING ERROR 5.1\n";exit} - "Seccomp: 0" -} -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 opera" -} -expect { - timeout {puts "TESTING ERROR 6.1\n";exit} - "CapBnd:" -} -expect { - timeout {puts "TESTING ERROR 6.2\n";exit} - "fffffffff" -} -expect { - timeout {puts "TESTING ERROR 6.3\n";exit} - "name=blablabla" -} -after 100 - -puts "\n" diff --git a/test/apps/qbittorrent.exp b/test/apps/qbittorrent.exp index 03d0de960..52953179c 100755 --- a/test/apps/qbittorrent.exp +++ b/test/apps/qbittorrent.exp @@ -7,7 +7,7 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -send -- "firejail qbittorrent\r" +send -- "firejail --private qbittorrent\r" expect { timeout {puts "TESTING ERROR 0\n";exit} "Reading profile /etc/firejail/qbittorrent.profile" @@ -16,68 +16,30 @@ expect { timeout {puts "TESTING ERROR 1\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } -sleep 3 +sleep 5 spawn $env(SHELL) send -- "firejail --list\r" expect { - timeout {puts "TESTING ERROR 3\n";exit} - ":firejail" + timeout {puts "TESTING ERROR 2\n";exit} + "firejail" } expect { - timeout {puts "TESTING ERROR 3.1\n";exit} + timeout {puts "TESTING ERROR 3\n";exit} "qbittorrent" } 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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -sleep 2 - spawn $env(SHELL) send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "qbittorrent" +} expect { timeout {puts "TESTING ERROR 5\n";exit} - "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} - ":firejail qbittorrent" -} -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 qbittorrent" -} -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/thunderbird.exp b/test/apps/thunderbird.exp deleted file mode 100755 index 981b6925a..000000000 --- a/test/apps/thunderbird.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail thunderbird\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Reading profile /etc/firejail/thunderbird.profile" -} -expect { - timeout {puts "TESTING ERROR 1\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - "thunderbird" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 thunderbird" -} -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 thunderbird" -} -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-qt.exp b/test/apps/transmission-qt.exp deleted file mode 100755 index 1b828cd2f..000000000 --- a/test/apps/transmission-qt.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --ignore=quiet transmission-qt\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Reading profile /etc/firejail/transmission-qt.profile" -} -expect { - timeout {puts "TESTING ERROR 1\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - "transmission-qt" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 --ignore=quiet 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" -} -after 100 -send -- "firemon --caps\r" -expect { - timeout {puts "TESTING ERROR 6\n";exit} - ":firejail --ignore=quiet 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" -} -after 100 - -puts "\nall done\n" diff --git a/test/apps/uget-gtk.exp b/test/apps/uget-gtk.exp deleted file mode 100755 index 839393eef..000000000 --- a/test/apps/uget-gtk.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail uget-gtk\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Reading profile /etc/firejail/uget-gtk.profile" -} -expect { - timeout {puts "TESTING ERROR 1\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - "uget-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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 uget-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 uget-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" diff --git a/test/apps/vlc.exp b/test/apps/vlc.exp deleted file mode 100755 index 1a55f8944..000000000 --- a/test/apps/vlc.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail vlc\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Reading profile /etc/firejail/vlc.profile" -} -expect { - timeout {puts "TESTING ERROR 1\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - "vlc" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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 vlc" -} -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 vlc" -} -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-x11/x11-none.exp b/test/apps/x11-none.exp similarity index 95% rename from test/apps-x11/x11-none.exp rename to test/apps/x11-none.exp index 585e2bbe3..6f3f6897b 100755 --- a/test/apps-x11/x11-none.exp +++ b/test/apps/x11-none.exp @@ -10,7 +10,7 @@ match_max 100000 send -- "firejail --name=test --x11=none\r" expect { timeout {puts "TESTING ERROR 0\n";exit} - "use network namespace in firejail" + "Additional setup required" } sleep 1 diff --git a/test/apps/xchat.exp b/test/apps/xchat.exp deleted file mode 100755 index 20d7c3abc..000000000 --- a/test/apps/xchat.exp +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2026 Firejail Authors -# License GPL v2 - -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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" -} -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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -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} - " xchat" -} -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} - " 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" -} -after 100 - -puts "\n" diff --git a/test/apps-x11/xterm-xephyr.exp b/test/apps/xterm-xephyr.exp similarity index 60% rename from test/apps-x11/xterm-xephyr.exp rename to test/apps/xterm-xephyr.exp index 64552c4e9..cef050a75 100755 --- a/test/apps-x11/xterm-xephyr.exp +++ b/test/apps/xterm-xephyr.exp @@ -7,8 +7,8 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -send -- "firejail --name=test --x11=xephyr xterm\r" -sleep 10 +send -- "firejail --name=test --x11 xterm\r" +sleep 5 spawn $env(SHELL) send -- "firejail --list\r" @@ -20,24 +20,8 @@ expect { timeout {puts "TESTING ERROR 3.1\n";exit} "xterm" } -sleep 1 +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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -sleep 2 - -spawn $env(SHELL) send -- "firemon --seccomp\r" expect { timeout {puts "TESTING ERROR 5\n";exit} @@ -52,11 +36,8 @@ 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 +after 100 + send -- "firemon --caps\r" expect { timeout {puts "TESTING ERROR 6\n";exit} @@ -74,12 +55,8 @@ 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 +after 100 puts "\nall done\n" diff --git a/test/apps-x11/xterm-xorg.exp b/test/apps/xterm-xorg.exp similarity index 63% rename from test/apps-x11/xterm-xorg.exp rename to test/apps/xterm-xorg.exp index 730f9c75d..9bad37177 100755 --- a/test/apps-x11/xterm-xorg.exp +++ b/test/apps/xterm-xorg.exp @@ -8,7 +8,7 @@ spawn $env(SHELL) match_max 100000 send -- "firejail --name=test --x11=xorg xterm\r" -sleep 10 +sleep 5 spawn $env(SHELL) send -- "firejail --list\r" @@ -20,24 +20,8 @@ expect { timeout {puts "TESTING ERROR 3.1\n";exit} "xterm" } -sleep 1 +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} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -sleep 2 - -spawn $env(SHELL) send -- "firemon --seccomp\r" expect { timeout {puts "TESTING ERROR 5\n";exit} @@ -52,11 +36,8 @@ 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 +after 100 + send -- "firemon --caps\r" expect { timeout {puts "TESTING ERROR 6\n";exit} @@ -74,12 +55,8 @@ 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 +after 100 puts "\nall done\n"