aboutsummaryrefslogtreecommitdiffstats
path: root/test/features/1.4.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/features/1.4.exp')
-rwxr-xr-xtest/features/1.4.exp116
1 files changed, 0 insertions, 116 deletions
diff --git a/test/features/1.4.exp b/test/features/1.4.exp
deleted file mode 100755
index f5db0c450..000000000
--- a/test/features/1.4.exp
+++ /dev/null
@@ -1,116 +0,0 @@
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# mask other users
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ls -l /home | wc -l\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "2"
29}
30after 100
31send -- "cat /etc/passwd | grep 1001 | wc -l\r"
32expect {
33 timeout {puts "TESTING ERROR 1.1\n";exit}
34 "0"
35}
36after 100
37send -- "cat /etc/group | grep 1001 | wc -l\r"
38expect {
39 timeout {puts "TESTING ERROR 1.2\n";exit}
40 "0"
41}
42after 100
43
44send -- "exit\r"
45sleep 1
46
47
48#
49# O
50#
51if { $overlay == "overlay" } {
52 send -- "firejail --noprofile --overlay\r"
53 expect {
54 timeout {puts "TESTING ERROR 2\n";exit}
55 "overlay option is not available" {puts "grsecurity\n"; exit}
56 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
57 }
58 sleep 1
59
60 send -- "ls -l /home | wc -l\r"
61 expect {
62 timeout {puts "TESTING ERROR 3\n";exit}
63 "2"
64 }
65 after 100
66 send -- "cat /etc/passwd | grep 1001 | wc -l\r"
67 expect {
68 timeout {puts "TESTING ERROR 3.1\n";exit}
69 "0"
70 }
71 after 100
72 send -- "cat /etc/group | grep 1001 | wc -l\r"
73 expect {
74 timeout {puts "TESTING ERROR 3.2\n";exit}
75 "0"
76 }
77 after 100
78 send -- "exit\r"
79 sleep 1
80}
81
82#
83# C
84#
85if { $chroot == "chroot" } {
86 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
87 expect {
88 timeout {puts "TESTING ERROR 4\n";exit}
89 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
90 }
91 sleep 1
92
93 send -- "ls -l /home | wc -l\r"
94 expect {
95 timeout {puts "TESTING ERROR 5\n";exit}
96 "2"
97 }
98 after 100
99 send -- "cat /etc/passwd | grep 1001 | wc -l\r"
100 expect {
101 timeout {puts "TESTING ERROR 5.1\n";exit}
102 "0"
103 }
104 after 100
105 send -- "cat /etc/group | grep 1001 | wc -l\r"
106 expect {
107 timeout {puts "TESTING ERROR 5.2\n";exit}
108 "0"
109 }
110 after 100
111 send -- "exit\r"
112 sleep 1
113}
114
115
116puts "\nall done\n"