aboutsummaryrefslogtreecommitdiffstats
path: root/test/apparmor/apparmor-norun.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/apparmor/apparmor-norun.exp')
-rwxr-xr-xtest/apparmor/apparmor-norun.exp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/apparmor/apparmor-norun.exp b/test/apparmor/apparmor-norun.exp
new file mode 100755
index 000000000..625d4b4e0
--- /dev/null
+++ b/test/apparmor/apparmor-norun.exp
@@ -0,0 +1,26 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10# start a bash session
11send -- "firejail --apparmor\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
15}
16sleep 1
17
18# ... and try to run a local program
19send -- "./a.out --help\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "Usage: ./a.out" {puts "TESTING ERROR 2\n";exit}
23 "denied"
24}
25after 500
26puts "\nall done\n"