diff --git a/test/apps/apps.sh b/test/apps/apps.sh index 23c38d80c..b6257c8ad 100755 --- a/test/apps/apps.sh +++ b/test/apps/apps.sh @@ -25,7 +25,7 @@ for app in "${apps[@]}"; do done rm -f index.html rm wget-log* -sudo ls +sudo true # testing seccomp @clock group echo "TESTING: seccomp @clock group (test/apps/seccomp-clock.exp)" @@ -36,19 +36,17 @@ echo "TESTING: pid 1 functionality (test/apps/pid1.exp)" # X11 apps x11apps=(firefox qbittorrent firefox-xephyr galculator libreoffice firefox-xorg \ - lowriter gimp inkscape firefox-neteth emacs okular kdiff3 gpicview audacity \ - pauvcontrol mpv dosbox gnome-screenshot \ + lowriter gimp inkscape firefox-neteth emacs okular kdiff3 \ + gpicview audacity meld vlc warzone2100 audacious \ + pauvcontrol mpv dosbox gnome-screenshot brave \ + flameshot ghb kdenlive krita meld \ + vlc warzone2100 \ xterm x11-none xterm-xorg xterm-xephyr xterm-xpra firefox-xpra) for app in "${x11apps[@]}"; do - sudo ls - if file -v "$app".exp - then - echo "TESTING: $app (test/apps/$app.exp)" - ./"$app".exp - else - echo "TESTING SKIP: $app not found" - fi + sudo true + echo "TESTING: $app (test/apps/$app.exp)" + ./"$app".exp sleep 1 done diff --git a/test/apps/audacious.exp b/test/apps/audacious.exp new file mode 100755 index 000000000..61bced6bc --- /dev/null +++ b/test/apps/audacious.exp @@ -0,0 +1,53 @@ +#!/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 + +if {![file exists /usr/bin/audacious]} { + puts "TESTING: audacious not installed, skipping...\n" + after 100 + exit +} + + + +send -- "firejail --private audacious\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/audacious.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} + "audacious" +} +after 100 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "audacious" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" +} +after 100 + +puts "\n" diff --git a/test/apps/brave.exp b/test/apps/brave.exp new file mode 100755 index 000000000..950ecab5e --- /dev/null +++ b/test/apps/brave.exp @@ -0,0 +1,41 @@ +#!/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 + +if {![file exists /usr/bin/brave]} { + puts "TESTING: brave not installed, skipping...\n" + after 100 + exit +} + + + +send -- "firejail --private --ignore=quiet brave\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/brave.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} + "brave" +} +after 100 + +puts "\n" diff --git a/test/apps/firefox-xephyr.exp b/test/apps/firefox-xephyr.exp index c338f2138..df4b7ecf0 100755 --- a/test/apps/firefox-xephyr.exp +++ b/test/apps/firefox-xephyr.exp @@ -7,9 +7,7 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -if {[file exists /usr/bin/Xephyr]} { - puts "TESTING: Xephyr available\n" -} else { +if {![file exists /usr/bin/Xephyr]} { puts "TESTING: xpra not installed, skipping...\n" after 100 exit diff --git a/test/apps/firefox-xpra.exp b/test/apps/firefox-xpra.exp index 447b5055c..be14817c1 100755 --- a/test/apps/firefox-xpra.exp +++ b/test/apps/firefox-xpra.exp @@ -7,9 +7,7 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -if {[file exists /usr/bin/xpra]} { - puts "TESTING: xpra available\n" -} else { +if {![file exists /usr/bin/xpra]} { puts "TESTING: xpra not installed, skipping...\n" after 100 exit diff --git a/test/apps/flameshot.exp b/test/apps/flameshot.exp new file mode 100755 index 000000000..3de31004a --- /dev/null +++ b/test/apps/flameshot.exp @@ -0,0 +1,53 @@ +#!/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 + +if {![file exists /usr/bin/flameshot]} { + puts "TESTING: flameshot not installed, skipping...\n" + after 100 + exit +} + + + +send -- "firejail --private --ignore=quiet flameshot\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/flameshot.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} + "flameshot" +} +after 100 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "flameshot" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" +} +after 100 + +puts "\n" diff --git a/test/apps/ghb.exp b/test/apps/ghb.exp new file mode 100755 index 000000000..7f0fc9871 --- /dev/null +++ b/test/apps/ghb.exp @@ -0,0 +1,53 @@ +#!/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 + +if {![file exists /usr/bin/ghb]} { + puts "TESTING: ghb (handbrake) not installed, skipping...\n" + after 100 + exit +} + + + +send -- "firejail --private --ignore=quiet ghb\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/ghb.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} + "ghb" +} +after 100 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "ghb" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" +} +after 100 + +puts "\n" diff --git a/test/apps/kdenlive.exp b/test/apps/kdenlive.exp new file mode 100755 index 000000000..2da33c2ee --- /dev/null +++ b/test/apps/kdenlive.exp @@ -0,0 +1,53 @@ +#!/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 + +if {![file exists /usr/bin/kdenlive]} { + puts "TESTING: kdenlive not installed, skipping...\n" + after 100 + exit +} + + + +send -- "firejail --private --ignore=quiet kdenlive\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/kdenlive.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} + "kdenlive" +} +after 100 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "kdenlive" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" +} +after 100 + +puts "\n" diff --git a/test/apps/kdiff3.exp b/test/apps/kdiff3.exp index cd32af2eb..a7dcf7966 100755 --- a/test/apps/kdiff3.exp +++ b/test/apps/kdiff3.exp @@ -7,6 +7,12 @@ set timeout 10 spawn $env(SHELL) match_max 100000 +if {![file exists /usr/bin/kdiff3]} { + puts "TESTING: kdiff3 not installed, skipping...\n" + after 100 + exit +} + send -- "firejail --private kdiff3\r" expect { timeout {puts "TESTING ERROR 0\n";exit} diff --git a/test/apps/krita.exp b/test/apps/krita.exp new file mode 100755 index 000000000..8eb94277e --- /dev/null +++ b/test/apps/krita.exp @@ -0,0 +1,53 @@ +#!/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 + +if {![file exists /usr/bin/krita]} { + puts "TESTING: krita not installed, skipping...\n" + after 100 + exit +} + + + +send -- "firejail --private --ignore=quiet krita\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/krita.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} + "krita" +} +after 100 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "krita" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" +} +after 100 + +puts "\n" diff --git a/test/apps/meld.exp b/test/apps/meld.exp new file mode 100755 index 000000000..780ead68b --- /dev/null +++ b/test/apps/meld.exp @@ -0,0 +1,51 @@ +#!/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 + +if {![file exists /usr/bin/meld]} { + puts "TESTING: medl not installed, skipping...\n" + after 100 + exit +} + +send -- "firejail --private meld\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/meld.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} + "meld" +} +after 100 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "meld" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" +} +after 100 + +puts "alldone \n" diff --git a/test/apps/qbittorrent.exp b/test/apps/qbittorrent.exp index df0df6229..1f4d9965c 100755 --- a/test/apps/qbittorrent.exp +++ b/test/apps/qbittorrent.exp @@ -7,6 +7,14 @@ set timeout 10 spawn $env(SHELL) match_max 100000 +if {![file exists /usr/bin/qbittorrent]} { + puts "TESTING: qbittorrent not installed, skipping...\n" + after 100 + exit +} + + + send -- "firejail --private qbittorrent\r" expect { timeout {puts "TESTING ERROR 0\n";exit} diff --git a/test/apps/template.exp b/test/apps/template.exp new file mode 100755 index 000000000..4738f48d2 --- /dev/null +++ b/test/apps/template.exp @@ -0,0 +1,53 @@ +#!/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 + +if {![file exists /usr/bin/template]} { + puts "TESTING: TEMPLATE not installed, skipping...\n" + after 100 + exit +} + + + +send -- "firejail --private --ignore=quiet template\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/template.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} + "template" +} +after 100 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "template" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" +} +after 100 + +puts "\n" diff --git a/test/apps/vlc.exp b/test/apps/vlc.exp new file mode 100755 index 000000000..9bc7de0c9 --- /dev/null +++ b/test/apps/vlc.exp @@ -0,0 +1,53 @@ +#!/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 + +if {![file exists /usr/bin/vlc]} { + puts "TESTING: vlc not installed, skipping...\n" + after 100 + exit +} + + + +send -- "firejail --private 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 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} + "vlc" +} +after 100 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "vlc" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" +} +after 100 + +puts "alldone \n" diff --git a/test/apps/warzone2100.exp b/test/apps/warzone2100.exp new file mode 100755 index 000000000..8e6447f5d --- /dev/null +++ b/test/apps/warzone2100.exp @@ -0,0 +1,52 @@ +#!/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 -- "which -a warzone2100\r" +expect { + timeout {puts "TESTING: warzone2100 not installed\n"; exit} + "/warzone2100" +} +after 100 + +send -- "firejail --private warzone2100\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Reading profile /etc/firejail/warzone2100.profile" +} +expect { + timeout {puts "TESTING ERROR 1\n";exit} + -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" +} +sleep 8 + +spawn $env(SHELL) +send -- "firejail --list\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "firejail" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "warzone" +} +after 100 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "warzone" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Seccomp: 2" +} +after 100 + +puts "all done \n" diff --git a/test/apps/xterm-xephyr.exp b/test/apps/xterm-xephyr.exp index 75e01cb39..6220b6c31 100755 --- a/test/apps/xterm-xephyr.exp +++ b/test/apps/xterm-xephyr.exp @@ -7,9 +7,7 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -if {[file exists /usr/bin/Xephyr]} { - puts "TESTING: Xephyr available\n" -} else { +if {![file exists /usr/bin/Xephyr]} { puts "TESTING: xpra not installed, skipping...\n" after 100 exit diff --git a/test/apps/xterm-xpra.exp b/test/apps/xterm-xpra.exp index a0fb99ab2..f40f03b11 100755 --- a/test/apps/xterm-xpra.exp +++ b/test/apps/xterm-xpra.exp @@ -7,9 +7,7 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -if {[file exists /usr/bin/xpra]} { - puts "TESTING: xpra available\n" -} else { +if {![file exists /usr/bin/xpra]} { puts "TESTING: xpra not installed, skipping...\n" after 100 exit