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