diff options
Diffstat (limited to 'test/apparmor/apparmor-run.exp')
-rwxr-xr-x | test/apparmor/apparmor-run.exp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/apparmor/apparmor-run.exp b/test/apparmor/apparmor-run.exp new file mode 100755 index 000000000..c11b50151 --- /dev/null +++ b/test/apparmor/apparmor-run.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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # start a bash session | ||
11 | send -- "firejail --apparmor=test-profile\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
15 | } | ||
16 | sleep 1 | ||
17 | |||
18 | # ... and try to run a local program | ||
19 | send -- "./a.out --help\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | "denied" {puts "TESTING ERROR 2\n";exit} | ||
23 | "Usage: ./a.out" | ||
24 | } | ||
25 | after 500 | ||
26 | puts "\nall done\n" | ||