aboutsummaryrefslogtreecommitdiffstats
path: root/test/private-etc/profile.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/private-etc/profile.exp')
-rwxr-xr-xtest/private-etc/profile.exp90
1 files changed, 90 insertions, 0 deletions
diff --git a/test/private-etc/profile.exp b/test/private-etc/profile.exp
new file mode 100755
index 000000000..d5713fe95
--- /dev/null
+++ b/test/private-etc/profile.exp
@@ -0,0 +1,90 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2022 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --profile=p1.profile\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 1
16
17send -- "LC_ALL=C ls -al /etc\r"
18expect {
19 timeout {puts "TESTING ERROR 3\n";exit}
20 "X11"
21}
22expect {
23 timeout {puts "TESTING ERROR 4\n";exit}
24 "group"
25}
26expect {
27 timeout {puts "TESTING ERROR 5\n";exit}
28 "passwd"
29}
30expect {
31 timeout {puts "TESTING ERROR 6\n";exit}
32 "resolv.conf"
33}
34
35
36send -- "file /etc/shadow\r"
37expect {
38 timeout {puts "TESTING ERROR 7\n";exit}
39 "No such file or directory"
40}
41after 100
42send -- "exit\r"
43sleep 1
44
45send -- "firejail --profile=p2.profile\r"
46expect {
47 timeout {puts "TESTING ERROR 11\n";exit}
48 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
49}
50sleep 1
51
52send -- "LC_ALL=C ls -al /etc\r"
53expect {
54 timeout {puts "TESTING ERROR 13\n";exit}
55 "X11"
56}
57expect {
58 timeout {puts "TESTING ERROR 14\n";exit}
59 "group"
60}
61expect {
62 timeout {puts "TESTING ERROR 15\n";exit}
63 "passwd"
64}
65expect {
66 timeout {puts "TESTING ERROR 16\n";exit}
67 "resolv.conf"
68}
69
70
71send -- "file /etc/shadow\r"
72expect {
73 timeout {puts "TESTING ERROR 17\n";exit}
74 "No such file or directory"
75}
76after 100
77send -- "exit\r"
78sleep 1
79
80
81
82
83
84
85
86
87
88
89after 100
90puts "\nall done\n"