diff options
author | netblue30 <netblue30@protonmail.com> | 2023-02-14 16:11:39 -0500 |
---|---|---|
committer | netblue30 <netblue30@protonmail.com> | 2023-02-14 16:11:39 -0500 |
commit | 18a4af4f770ab100e3e755647d38b04d68357082 (patch) | |
tree | c1ef2d9c44c0d30a0482ebab0692b60801ba7e0c | |
parent | RELNOTES (diff) | |
download | firejail-18a4af4f770ab100e3e755647d38b04d68357082.tar.gz firejail-18a4af4f770ab100e3e755647d38b04d68357082.tar.zst firejail-18a4af4f770ab100e3e755647d38b04d68357082.zip |
testing --name
-rwxr-xr-x | test/utils/join2.exp | 42 | ||||
-rwxr-xr-x | test/utils/join3.exp | 42 | ||||
-rwxr-xr-x | test/utils/name.exp | 77 | ||||
-rwxr-xr-x | test/utils/utils.sh | 6 |
4 files changed, 53 insertions, 114 deletions
diff --git a/test/utils/join2.exp b/test/utils/join2.exp deleted file mode 100755 index 5f5a6bfe0..000000000 --- a/test/utils/join2.exp +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
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 | |||
6 | set timeout 10 | ||
7 | cd /home | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | send -- "firejail --name=\"join testing\"\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 2 | ||
17 | |||
18 | spawn $env(SHELL) | ||
19 | send -- "firejail --join=\"join testing\"\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | "Switching to pid" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 2\n";exit} | ||
26 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
27 | } | ||
28 | sleep 1 | ||
29 | send -- "ps aux\r" | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 3\n";exit} | ||
32 | "/bin/bash" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 4\n";exit} | ||
36 | "/bin/bash" | ||
37 | } | ||
38 | |||
39 | send -- "exit\r" | ||
40 | after 100 | ||
41 | |||
42 | puts "\nall done\n" | ||
diff --git a/test/utils/join3.exp b/test/utils/join3.exp deleted file mode 100755 index c771b924b..000000000 --- a/test/utils/join3.exp +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
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 | |||
6 | set timeout 10 | ||
7 | cd /home | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | send -- "firejail --name=join\\ testing\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 2 | ||
17 | |||
18 | spawn $env(SHELL) | ||
19 | send -- "firejail --join=join\\ testing\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | "Switching to pid" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 2\n";exit} | ||
26 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
27 | } | ||
28 | sleep 1 | ||
29 | send -- "ps aux\r" | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 3\n";exit} | ||
32 | "/bin/bash" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 4\n";exit} | ||
36 | "/bin/bash" | ||
37 | } | ||
38 | |||
39 | send -- "exit\r" | ||
40 | after 100 | ||
41 | |||
42 | puts "\nall done\n" | ||
diff --git a/test/utils/name.exp b/test/utils/name.exp index cd4465d41..4c317216c 100755 --- a/test/utils/name.exp +++ b/test/utils/name.exp | |||
@@ -7,10 +7,39 @@ set timeout 10 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | send -- "firejail --name=12345\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "invalid sandbox name" | ||
14 | } | ||
15 | after 100 | ||
16 | |||
17 | send -- "firejail --name=\"join testing\"\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 2\n";exit} | ||
20 | "invalid sandbox name" | ||
21 | } | ||
22 | after 100 | ||
23 | |||
24 | |||
25 | send -- "firejail --name=join\\ testing\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 3\n";exit} | ||
28 | "invalid sandbox name" | ||
29 | } | ||
30 | after 100 | ||
31 | |||
32 | send -- "firejail --name=asdf,12345\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 4\n";exit} | ||
35 | "invalid sandbox name" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
10 | 39 | ||
11 | send -- "firejail --name=ftest\r" | 40 | send -- "firejail --name=ftest\r" |
12 | expect { | 41 | expect { |
13 | timeout {puts "TESTING ERROR 0\n";exit} | 42 | timeout {puts "TESTING ERROR 5\n";exit} |
14 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | 43 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
15 | } | 44 | } |
16 | after 100 | 45 | after 100 |
@@ -18,7 +47,7 @@ after 100 | |||
18 | spawn $env(SHELL) | 47 | spawn $env(SHELL) |
19 | send -- "firejail --name=ftest\r" | 48 | send -- "firejail --name=ftest\r" |
20 | expect { | 49 | expect { |
21 | timeout {puts "TESTING ERROR 1\n";exit} | 50 | timeout {puts "TESTING ERROR 6\n";exit} |
22 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | 51 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
23 | } | 52 | } |
24 | after 100 | 53 | after 100 |
@@ -26,7 +55,7 @@ after 100 | |||
26 | spawn $env(SHELL) | 55 | spawn $env(SHELL) |
27 | send -- "firejail --name=ftest\r" | 56 | send -- "firejail --name=ftest\r" |
28 | expect { | 57 | expect { |
29 | timeout {puts "TESTING ERROR 2\n";exit} | 58 | timeout {puts "TESTING ERROR 7\n";exit} |
30 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | 59 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
31 | } | 60 | } |
32 | after 100 | 61 | after 100 |
@@ -34,7 +63,7 @@ after 100 | |||
34 | spawn $env(SHELL) | 63 | spawn $env(SHELL) |
35 | send -- "firejail --name=ftest\r" | 64 | send -- "firejail --name=ftest\r" |
36 | expect { | 65 | expect { |
37 | timeout {puts "TESTING ERROR 3\n";exit} | 66 | timeout {puts "TESTING ERROR 8\n";exit} |
38 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | 67 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
39 | } | 68 | } |
40 | after 100 | 69 | after 100 |
@@ -42,7 +71,7 @@ after 100 | |||
42 | spawn $env(SHELL) | 71 | spawn $env(SHELL) |
43 | send -- "firejail --name=ftest\r" | 72 | send -- "firejail --name=ftest\r" |
44 | expect { | 73 | expect { |
45 | timeout {puts "TESTING ERROR 4\n";exit} | 74 | timeout {puts "TESTING ERROR 9\n";exit} |
46 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | 75 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
47 | } | 76 | } |
48 | after 100 | 77 | after 100 |
@@ -50,7 +79,7 @@ after 100 | |||
50 | spawn $env(SHELL) | 79 | spawn $env(SHELL) |
51 | send -- "firejail --name=ftest\r" | 80 | send -- "firejail --name=ftest\r" |
52 | expect { | 81 | expect { |
53 | timeout {puts "TESTING ERROR 5\n";exit} | 82 | timeout {puts "TESTING ERROR 10\n";exit} |
54 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | 83 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
55 | } | 84 | } |
56 | after 100 | 85 | after 100 |
@@ -58,7 +87,7 @@ after 100 | |||
58 | spawn $env(SHELL) | 87 | spawn $env(SHELL) |
59 | send -- "firejail --name=ftest\r" | 88 | send -- "firejail --name=ftest\r" |
60 | expect { | 89 | expect { |
61 | timeout {puts "TESTING ERROR 6\n";exit} | 90 | timeout {puts "TESTING ERROR 11\n";exit} |
62 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | 91 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
63 | } | 92 | } |
64 | after 100 | 93 | after 100 |
@@ -66,7 +95,7 @@ after 100 | |||
66 | spawn $env(SHELL) | 95 | spawn $env(SHELL) |
67 | send -- "firejail --name=ftest\r" | 96 | send -- "firejail --name=ftest\r" |
68 | expect { | 97 | expect { |
69 | timeout {puts "TESTING ERROR 7\n";exit} | 98 | timeout {puts "TESTING ERROR 12\n";exit} |
70 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | 99 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
71 | } | 100 | } |
72 | after 100 | 101 | after 100 |
@@ -74,7 +103,7 @@ after 100 | |||
74 | spawn $env(SHELL) | 103 | spawn $env(SHELL) |
75 | send -- "firejail --name=ftest\r" | 104 | send -- "firejail --name=ftest\r" |
76 | expect { | 105 | expect { |
77 | timeout {puts "TESTING ERROR 8\n";exit} | 106 | timeout {puts "TESTING ERROR 13\n";exit} |
78 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | 107 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
79 | } | 108 | } |
80 | after 100 | 109 | after 100 |
@@ -82,7 +111,7 @@ after 100 | |||
82 | spawn $env(SHELL) | 111 | spawn $env(SHELL) |
83 | send -- "firejail --name=ftest\r" | 112 | send -- "firejail --name=ftest\r" |
84 | expect { | 113 | expect { |
85 | timeout {puts "TESTING ERROR 9\n";exit} | 114 | timeout {puts "TESTING ERROR 14\n";exit} |
86 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | 115 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
87 | } | 116 | } |
88 | after 100 | 117 | after 100 |
@@ -90,7 +119,7 @@ after 100 | |||
90 | spawn $env(SHELL) | 119 | spawn $env(SHELL) |
91 | send -- "firejail --name=ftest\r" | 120 | send -- "firejail --name=ftest\r" |
92 | expect { | 121 | expect { |
93 | timeout {puts "TESTING ERROR 10\n";exit} | 122 | timeout {puts "TESTING ERROR 15\n";exit} |
94 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | 123 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
95 | } | 124 | } |
96 | after 100 | 125 | after 100 |
@@ -98,7 +127,7 @@ after 100 | |||
98 | spawn $env(SHELL) | 127 | spawn $env(SHELL) |
99 | send -- "firejail --name=ftest\r" | 128 | send -- "firejail --name=ftest\r" |
100 | expect { | 129 | expect { |
101 | timeout {puts "TESTING ERROR 11\n";exit} | 130 | timeout {puts "TESTING ERROR 16\n";exit} |
102 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | 131 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" |
103 | } | 132 | } |
104 | after 100 | 133 | after 100 |
@@ -106,51 +135,51 @@ after 100 | |||
106 | spawn $env(SHELL) | 135 | spawn $env(SHELL) |
107 | send -- "firejail --list\r" | 136 | send -- "firejail --list\r" |
108 | expect { | 137 | expect { |
109 | timeout {puts "TESTING ERROR 12\n";exit} | 138 | timeout {puts "TESTING ERROR 17\n";exit} |
110 | ":ftest:" | 139 | ":ftest:" |
111 | } | 140 | } |
112 | expect { | 141 | expect { |
113 | timeout {puts "TESTING ERROR 13\n";exit} | 142 | timeout {puts "TESTING ERROR 18\n";exit} |
114 | ":ftest-" | 143 | ":ftest-" |
115 | } | 144 | } |
116 | expect { | 145 | expect { |
117 | timeout {puts "TESTING ERROR 14\n";exit} | 146 | timeout {puts "TESTING ERROR 19\n";exit} |
118 | ":ftest-" | 147 | ":ftest-" |
119 | } | 148 | } |
120 | expect { | 149 | expect { |
121 | timeout {puts "TESTING ERROR 15\n";exit} | 150 | timeout {puts "TESTING ERROR 20\n";exit} |
122 | ":ftest-" | 151 | ":ftest-" |
123 | } | 152 | } |
124 | expect { | 153 | expect { |
125 | timeout {puts "TESTING ERROR 16\n";exit} | 154 | timeout {puts "TESTING ERROR 21\n";exit} |
126 | ":ftest-" | 155 | ":ftest-" |
127 | } | 156 | } |
128 | expect { | 157 | expect { |
129 | timeout {puts "TESTING ERROR 17\n";exit} | 158 | timeout {puts "TESTING ERROR 22\n";exit} |
130 | ":ftest-" | 159 | ":ftest-" |
131 | } | 160 | } |
132 | expect { | 161 | expect { |
133 | timeout {puts "TESTING ERROR 18\n";exit} | 162 | timeout {puts "TESTING ERROR 23\n";exit} |
134 | ":ftest-" | 163 | ":ftest-" |
135 | } | 164 | } |
136 | expect { | 165 | expect { |
137 | timeout {puts "TESTING ERROR 19\n";exit} | 166 | timeout {puts "TESTING ERROR 24\n";exit} |
138 | ":ftest-" | 167 | ":ftest-" |
139 | } | 168 | } |
140 | expect { | 169 | expect { |
141 | timeout {puts "TESTING ERROR 20\n";exit} | 170 | timeout {puts "TESTING ERROR 25\n";exit} |
142 | ":ftest-" | 171 | ":ftest-" |
143 | } | 172 | } |
144 | expect { | 173 | expect { |
145 | timeout {puts "TESTING ERROR 21\n";exit} | 174 | timeout {puts "TESTING ERROR 26\n";exit} |
146 | ":ftest-" | 175 | ":ftest-" |
147 | } | 176 | } |
148 | expect { | 177 | expect { |
149 | timeout {puts "TESTING ERROR 22\n";exit} | 178 | timeout {puts "TESTING ERROR 27\n";exit} |
150 | ":ftest-" | 179 | ":ftest-" |
151 | } | 180 | } |
152 | expect { | 181 | expect { |
153 | timeout {puts "TESTING ERROR 23\n";exit} | 182 | timeout {puts "TESTING ERROR 28\n";exit} |
154 | ":ftest-" | 183 | ":ftest-" |
155 | } | 184 | } |
156 | sleep 1 | 185 | sleep 1 |
diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 647cbfb34..35c292832 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh | |||
@@ -85,12 +85,6 @@ echo "TESTING: shutdown4 (test/utils/shutdown4.exp)" | |||
85 | echo "TESTING: join (test/utils/join.exp)" | 85 | echo "TESTING: join (test/utils/join.exp)" |
86 | ./join.exp | 86 | ./join.exp |
87 | 87 | ||
88 | echo "TESTING: join2 (test/utils/join2.exp)" | ||
89 | ./join2.exp | ||
90 | |||
91 | echo "TESTING: join3 (test/utils/join3.exp)" | ||
92 | ./join3.exp | ||
93 | |||
94 | echo "TESTING: join4 (test/utils/join4.exp)" | 88 | echo "TESTING: join4 (test/utils/join4.exp)" |
95 | ./join4.exp | 89 | ./join4.exp |
96 | 90 | ||