diff options
author | 2018-09-27 08:43:21 -0400 | |
---|---|---|
committer | 2018-09-27 08:43:21 -0400 | |
commit | d0dc2196dff8ef1ea1b02c9b236f52e2dfbb89fa (patch) | |
tree | 6c10d1b87f32bde69324c14f1315a2131da6922f /test | |
parent | fixed test-arguments (diff) | |
download | firejail-d0dc2196dff8ef1ea1b02c9b236f52e2dfbb89fa.tar.gz firejail-d0dc2196dff8ef1ea1b02c9b236f52e2dfbb89fa.tar.zst firejail-d0dc2196dff8ef1ea1b02c9b236f52e2dfbb89fa.zip |
fixed test-arguments
Diffstat (limited to 'test')
-rwxr-xr-x | test/arguments/bashrun.exp | 24 | ||||
-rwxr-xr-x | test/arguments/bashrun.sh | 12 | ||||
-rwxr-xr-x | test/arguments/joinrun.exp | 26 | ||||
-rwxr-xr-x | test/arguments/symrun.exp | 20 |
4 files changed, 76 insertions, 6 deletions
diff --git a/test/arguments/bashrun.exp b/test/arguments/bashrun.exp index a3c9e382d..de9b4d7e3 100755 --- a/test/arguments/bashrun.exp +++ b/test/arguments/bashrun.exp | |||
@@ -6,6 +6,10 @@ match_max 100000 | |||
6 | 6 | ||
7 | send -- "./bashrun.sh\r" | 7 | send -- "./bashrun.sh\r" |
8 | expect { | 8 | expect { |
9 | timeout {puts "TESTING ERROR 1.1.0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | expect { | ||
9 | timeout {puts "TESTING ERROR 1.1.1\n";exit} | 13 | timeout {puts "TESTING ERROR 1.1.1\n";exit} |
10 | "Arguments:" | 14 | "Arguments:" |
11 | } | 15 | } |
@@ -19,6 +23,10 @@ expect { | |||
19 | } | 23 | } |
20 | 24 | ||
21 | expect { | 25 | expect { |
26 | timeout {puts "TESTING ERROR 1.2.0\n";exit} | ||
27 | "Child process initialized" | ||
28 | } | ||
29 | expect { | ||
22 | timeout {puts "TESTING ERROR 1.2.1\n";exit} | 30 | timeout {puts "TESTING ERROR 1.2.1\n";exit} |
23 | "Arguments:" | 31 | "Arguments:" |
24 | } | 32 | } |
@@ -32,6 +40,10 @@ expect { | |||
32 | } | 40 | } |
33 | 41 | ||
34 | expect { | 42 | expect { |
43 | timeout {puts "TESTING ERROR 1.3.0\n";exit} | ||
44 | "Child process initialized" | ||
45 | } | ||
46 | expect { | ||
35 | timeout {puts "TESTING ERROR 1.3.1\n";exit} | 47 | timeout {puts "TESTING ERROR 1.3.1\n";exit} |
36 | "Arguments:" | 48 | "Arguments:" |
37 | } | 49 | } |
@@ -45,6 +57,10 @@ expect { | |||
45 | } | 57 | } |
46 | 58 | ||
47 | expect { | 59 | expect { |
60 | timeout {puts "TESTING ERROR 1.4.0\n";exit} | ||
61 | "Child process initialized" | ||
62 | } | ||
63 | expect { | ||
48 | timeout {puts "TESTING ERROR 1.4.1\n";exit} | 64 | timeout {puts "TESTING ERROR 1.4.1\n";exit} |
49 | "Arguments:" | 65 | "Arguments:" |
50 | } | 66 | } |
@@ -58,6 +74,10 @@ expect { | |||
58 | } | 74 | } |
59 | 75 | ||
60 | expect { | 76 | expect { |
77 | timeout {puts "TESTING ERROR 1.5.0\n";exit} | ||
78 | "Child process initialized" | ||
79 | } | ||
80 | expect { | ||
61 | timeout {puts "TESTING ERROR 1.5.1\n";exit} | 81 | timeout {puts "TESTING ERROR 1.5.1\n";exit} |
62 | "Arguments:" | 82 | "Arguments:" |
63 | } | 83 | } |
@@ -71,6 +91,10 @@ expect { | |||
71 | } | 91 | } |
72 | 92 | ||
73 | expect { | 93 | expect { |
94 | timeout {puts "TESTING ERROR 1.6.0\n";exit} | ||
95 | "Child process initialized" | ||
96 | } | ||
97 | expect { | ||
74 | timeout {puts "TESTING ERROR 1.6.1\n";exit} | 98 | timeout {puts "TESTING ERROR 1.6.1\n";exit} |
75 | "Arguments:" | 99 | "Arguments:" |
76 | } | 100 | } |
diff --git a/test/arguments/bashrun.sh b/test/arguments/bashrun.sh index 8128ae37d..51a904e92 100755 --- a/test/arguments/bashrun.sh +++ b/test/arguments/bashrun.sh | |||
@@ -1,22 +1,22 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | echo "TESTING: 1.1 - simple args" | 3 | echo "TESTING: 1.1 - simple args" |
4 | firejail --quiet ./args arg1 arg2 | 4 | firejail ./args arg1 arg2 |
5 | 5 | ||
6 | # simple quotes, testing spaces in file names | 6 | # simple quotes, testing spaces in file names |
7 | echo "TESTING: 1.2 - args with space and \"" | 7 | echo "TESTING: 1.2 - args with space and \"" |
8 | firejail --quiet ./args "arg1 tail" "arg2 tail" | 8 | firejail ./args "arg1 tail" "arg2 tail" |
9 | 9 | ||
10 | echo "TESTING: 1.3 - args with space and '" | 10 | echo "TESTING: 1.3 - args with space and '" |
11 | firejail --quiet ./args 'arg1 tail' 'arg2 tail' | 11 | firejail ./args 'arg1 tail' 'arg2 tail' |
12 | 12 | ||
13 | # escaped space in file names | 13 | # escaped space in file names |
14 | echo "TESTING: 1.4 - args with space and \\" | 14 | echo "TESTING: 1.4 - args with space and \\" |
15 | firejail --quiet ./args arg1\ tail arg2\ tail | 15 | firejail ./args arg1\ tail arg2\ tail |
16 | 16 | ||
17 | # & char appears in URLs - URLs should be quoted | 17 | # & char appears in URLs - URLs should be quoted |
18 | echo "TESTING: 1.5 - args with & and \"" | 18 | echo "TESTING: 1.5 - args with & and \"" |
19 | firejail --quiet ./args "arg1&tail" "arg2&tail" | 19 | firejail ./args "arg1&tail" "arg2&tail" |
20 | 20 | ||
21 | echo "TESTING: 1.6 - args with & and '" | 21 | echo "TESTING: 1.6 - args with & and '" |
22 | firejail --quiet ./args 'arg1&tail' 'arg2&tail' | 22 | firejail ./args 'arg1&tail' 'arg2&tail' |
diff --git a/test/arguments/joinrun.exp b/test/arguments/joinrun.exp index 97972e5e8..e99cb20c6 100755 --- a/test/arguments/joinrun.exp +++ b/test/arguments/joinrun.exp | |||
@@ -11,6 +11,10 @@ sleep 2 | |||
11 | spawn $env(SHELL) | 11 | spawn $env(SHELL) |
12 | send -- "./joinrun.sh\r" | 12 | send -- "./joinrun.sh\r" |
13 | expect { | 13 | expect { |
14 | timeout {puts "TESTING ERROR 3.1.0\n";exit} | ||
15 | "Child process initialized" | ||
16 | } | ||
17 | expect { | ||
14 | timeout {puts "TESTING ERROR 3.1.1\n";exit} | 18 | timeout {puts "TESTING ERROR 3.1.1\n";exit} |
15 | "Arguments:" | 19 | "Arguments:" |
16 | } | 20 | } |
@@ -24,6 +28,10 @@ expect { | |||
24 | } | 28 | } |
25 | 29 | ||
26 | expect { | 30 | expect { |
31 | timeout {puts "TESTING ERROR 3.2.0\n";exit} | ||
32 | "Child process initialized" | ||
33 | } | ||
34 | expect { | ||
27 | timeout {puts "TESTING ERROR 3.2.1\n";exit} | 35 | timeout {puts "TESTING ERROR 3.2.1\n";exit} |
28 | "Arguments:" | 36 | "Arguments:" |
29 | } | 37 | } |
@@ -35,6 +43,11 @@ expect { | |||
35 | timeout {puts "TESTING ERROR 3.2.3\n";exit} | 43 | timeout {puts "TESTING ERROR 3.2.3\n";exit} |
36 | "#arg2 tail#" | 44 | "#arg2 tail#" |
37 | } | 45 | } |
46 | |||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 3.3.0\n";exit} | ||
49 | "Child process initialized" | ||
50 | } | ||
38 | expect { | 51 | expect { |
39 | timeout {puts "TESTING ERROR 3.3.1\n";exit} | 52 | timeout {puts "TESTING ERROR 3.3.1\n";exit} |
40 | "Arguments:" | 53 | "Arguments:" |
@@ -47,6 +60,11 @@ expect { | |||
47 | timeout {puts "TESTING ERROR 3.3.3\n";exit} | 60 | timeout {puts "TESTING ERROR 3.3.3\n";exit} |
48 | "#arg2 tail#" | 61 | "#arg2 tail#" |
49 | } | 62 | } |
63 | |||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 3.4.0\n";exit} | ||
66 | "Child process initialized" | ||
67 | } | ||
50 | expect { | 68 | expect { |
51 | timeout {puts "TESTING ERROR 3.4.1\n";exit} | 69 | timeout {puts "TESTING ERROR 3.4.1\n";exit} |
52 | "Arguments:" | 70 | "Arguments:" |
@@ -61,6 +79,10 @@ expect { | |||
61 | } | 79 | } |
62 | 80 | ||
63 | expect { | 81 | expect { |
82 | timeout {puts "TESTING ERROR 3.5.0\n";exit} | ||
83 | "Child process initialized" | ||
84 | } | ||
85 | expect { | ||
64 | timeout {puts "TESTING ERROR 3.5.1\n";exit} | 86 | timeout {puts "TESTING ERROR 3.5.1\n";exit} |
65 | "Arguments:" | 87 | "Arguments:" |
66 | } | 88 | } |
@@ -74,6 +96,10 @@ expect { | |||
74 | } | 96 | } |
75 | 97 | ||
76 | expect { | 98 | expect { |
99 | timeout {puts "TESTING ERROR 3.6.0\n";exit} | ||
100 | "Child process initialized" | ||
101 | } | ||
102 | expect { | ||
77 | timeout {puts "TESTING ERROR 3.6.1\n";exit} | 103 | timeout {puts "TESTING ERROR 3.6.1\n";exit} |
78 | "Arguments:" | 104 | "Arguments:" |
79 | } | 105 | } |
diff --git a/test/arguments/symrun.exp b/test/arguments/symrun.exp index 10e7ac6c8..f9095bd3c 100755 --- a/test/arguments/symrun.exp +++ b/test/arguments/symrun.exp | |||
@@ -6,6 +6,10 @@ match_max 100000 | |||
6 | 6 | ||
7 | send -- "./symrun.sh\r" | 7 | send -- "./symrun.sh\r" |
8 | expect { | 8 | expect { |
9 | timeout {puts "TESTING ERROR 2.1.0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | expect { | ||
9 | timeout {puts "TESTING ERROR 2.1.1\n";exit} | 13 | timeout {puts "TESTING ERROR 2.1.1\n";exit} |
10 | "Arguments:" | 14 | "Arguments:" |
11 | } | 15 | } |
@@ -19,6 +23,10 @@ expect { | |||
19 | } | 23 | } |
20 | 24 | ||
21 | expect { | 25 | expect { |
26 | timeout {puts "TESTING ERROR 2.3.0\n";exit} | ||
27 | "Child process initialized" | ||
28 | } | ||
29 | expect { | ||
22 | timeout {puts "TESTING ERROR 2.3.1\n";exit} | 30 | timeout {puts "TESTING ERROR 2.3.1\n";exit} |
23 | "Arguments:" | 31 | "Arguments:" |
24 | } | 32 | } |
@@ -32,6 +40,10 @@ expect { | |||
32 | } | 40 | } |
33 | 41 | ||
34 | expect { | 42 | expect { |
43 | timeout {puts "TESTING ERROR 2.4.0\n";exit} | ||
44 | "Child process initialized" | ||
45 | } | ||
46 | expect { | ||
35 | timeout {puts "TESTING ERROR 2.4.1\n";exit} | 47 | timeout {puts "TESTING ERROR 2.4.1\n";exit} |
36 | "Arguments:" | 48 | "Arguments:" |
37 | } | 49 | } |
@@ -45,6 +57,10 @@ expect { | |||
45 | } | 57 | } |
46 | 58 | ||
47 | expect { | 59 | expect { |
60 | timeout {puts "TESTING ERROR 2.5.0\n";exit} | ||
61 | "Child process initialized" | ||
62 | } | ||
63 | expect { | ||
48 | timeout {puts "TESTING ERROR 2.5.1\n";exit} | 64 | timeout {puts "TESTING ERROR 2.5.1\n";exit} |
49 | "Arguments:" | 65 | "Arguments:" |
50 | } | 66 | } |
@@ -58,6 +74,10 @@ expect { | |||
58 | } | 74 | } |
59 | 75 | ||
60 | expect { | 76 | expect { |
77 | timeout {puts "TESTING ERROR 2.6.0\n";exit} | ||
78 | "Child process initialized" | ||
79 | } | ||
80 | expect { | ||
61 | timeout {puts "TESTING ERROR 2.6.1\n";exit} | 81 | timeout {puts "TESTING ERROR 2.6.1\n";exit} |
62 | "Arguments:" | 82 | "Arguments:" |
63 | } | 83 | } |