diff options
author | 2023-01-31 11:15:21 -0500 | |
---|---|---|
committer | 2023-01-31 11:15:21 -0500 | |
commit | 1e6116cf15d03745b2f1d8667b8c06a3fe1cce3d (patch) | |
tree | 3aff0e9f825566778831719ad3a5512279801def /test | |
parent | merges (diff) | |
download | firejail-1e6116cf15d03745b2f1d8667b8c06a3fe1cce3d.tar.gz firejail-1e6116cf15d03745b2f1d8667b8c06a3fe1cce3d.tar.zst firejail-1e6116cf15d03745b2f1d8667b8c06a3fe1cce3d.zip |
testing sysutils
Diffstat (limited to 'test')
-rwxr-xr-x | test/sysutils/curl.exp | 34 | ||||
-rwxr-xr-x | test/sysutils/less.exp | 9 | ||||
-rwxr-xr-x | test/sysutils/man.exp | 4 | ||||
-rwxr-xr-x | test/sysutils/sysutils.sh | 31 | ||||
-rwxr-xr-x | test/sysutils/wget.exp | 34 |
5 files changed, 98 insertions, 14 deletions
diff --git a/test/sysutils/curl.exp b/test/sysutils/curl.exp new file mode 100755 index 000000000..29c9883a4 --- /dev/null +++ b/test/sysutils/curl.exp | |||
@@ -0,0 +1,34 @@ | |||
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 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "rm index.html*\r" | ||
11 | after 500 | ||
12 | |||
13 | send -- "firejail --ignore=quiet curl -s -o index.html debian.org\r" | ||
14 | expect { | ||
15 | timeout {puts "TESTING ERROR 1\n";exit} | ||
16 | "Child process initialized" | ||
17 | } | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 2\n";exit} | ||
20 | "Parent is shutting down" | ||
21 | } | ||
22 | after 100 | ||
23 | |||
24 | send -- "ls -l index.html\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 3\n";exit} | ||
27 | "No such file or directory" {puts "TESTING ERROR 4\n";exit} | ||
28 | "rw" | ||
29 | } | ||
30 | after 100 | ||
31 | send -- "rm index.html*\r" | ||
32 | after 500 | ||
33 | |||
34 | puts "\nall done\n" | ||
diff --git a/test/sysutils/less.exp b/test/sysutils/less.exp index 01a298fe0..7bbd76942 100755 --- a/test/sysutils/less.exp +++ b/test/sysutils/less.exp | |||
@@ -10,13 +10,14 @@ match_max 100000 | |||
10 | send -- "firejail less sysutils.sh\r" | 10 | send -- "firejail less sysutils.sh\r" |
11 | expect { | 11 | expect { |
12 | timeout {puts "TESTING ERROR 1\n";exit} | 12 | timeout {puts "TESTING ERROR 1\n";exit} |
13 | "(press RETURN)" {puts "TESTING SKIP 1.1\n";exit} | 13 | "(press RETURN)" {puts "TESTING SKIP: terminal is not fully functional - 1.1\n";exit} |
14 | "Press RETURN to continue" {puts "TESTING SKIP 1.2\n";exit} | 14 | "Press RETURN to continue" {puts "TESTING SKIP: terminal is not fully functional - 1.2\n";exit} |
15 | "MALLOC_CHECK" | 15 | "Firejail Authors" |
16 | } | 16 | } |
17 | expect { | 17 | expect { |
18 | timeout {puts "TESTING ERROR 2\n";exit} | 18 | timeout {puts "TESTING ERROR 2\n";exit} |
19 | "./cpio.exp" | 19 | "MALLOC_CHECK" |
20 | } | 20 | } |
21 | 21 | ||
22 | after 100 | ||
22 | puts "\nall done\n" | 23 | puts "\nall done\n" |
diff --git a/test/sysutils/man.exp b/test/sysutils/man.exp index a263180b5..c569653c6 100755 --- a/test/sysutils/man.exp +++ b/test/sysutils/man.exp | |||
@@ -10,8 +10,8 @@ match_max 100000 | |||
10 | send -- "firejail man firejail\r" | 10 | send -- "firejail man firejail\r" |
11 | expect { | 11 | expect { |
12 | timeout {puts "TESTING ERROR 0\n";exit} | 12 | timeout {puts "TESTING ERROR 0\n";exit} |
13 | "(press RETURN)" {puts "TESTING SKIP 1.1\n";exit} | 13 | "(press RETURN)" {puts "TESTING SKIP: terminal is not fully functional - 1.1\n";exit} |
14 | "Press RETURN to continue" {puts "TESTING SKIP 1.2\n";exit} | 14 | "Press RETURN to continue" {puts "TESTING SKIP: terminal is not fully functional - 1.2\n";exit} |
15 | "NAME" | 15 | "NAME" |
16 | } | 16 | } |
17 | after 100 | 17 | after 100 |
diff --git a/test/sysutils/sysutils.sh b/test/sysutils/sysutils.sh index a46cfb1ad..bab243c4b 100755 --- a/test/sysutils/sysutils.sh +++ b/test/sysutils/sysutils.sh | |||
@@ -15,14 +15,6 @@ else | |||
15 | echo "TESTING SKIP: cpio not found" | 15 | echo "TESTING SKIP: cpio not found" |
16 | fi | 16 | fi |
17 | 17 | ||
18 | #if command -v strings | ||
19 | #then | ||
20 | # echo "TESTING: strings" | ||
21 | # ./strings.exp | ||
22 | #else | ||
23 | # echo "TESTING SKIP: strings not found" | ||
24 | #fi | ||
25 | |||
26 | if command -v gzip | 18 | if command -v gzip |
27 | then | 19 | then |
28 | echo "TESTING: gzip" | 20 | echo "TESTING: gzip" |
@@ -111,4 +103,27 @@ else | |||
111 | echo "TESTING SKIP: man not found" | 103 | echo "TESTING SKIP: man not found" |
112 | fi | 104 | fi |
113 | 105 | ||
106 | if command -v wget | ||
107 | then | ||
108 | echo "TESTING: wget" | ||
109 | ./wget.exp | ||
110 | else | ||
111 | echo "TESTING SKIP: wget not found" | ||
112 | fi | ||
113 | |||
114 | if command -v curl | ||
115 | then | ||
116 | echo "TESTING: curl" | ||
117 | ./curl.exp | ||
118 | else | ||
119 | echo "TESTING SKIP: curl not found" | ||
120 | fi | ||
121 | |||
122 | if command -v strings | ||
123 | then | ||
124 | echo "TESTING: strings" | ||
125 | ./strings.exp | ||
126 | else | ||
127 | echo "TESTING SKIP: strings not found" | ||
128 | fi | ||
114 | 129 | ||
diff --git a/test/sysutils/wget.exp b/test/sysutils/wget.exp new file mode 100755 index 000000000..c6d2765c7 --- /dev/null +++ b/test/sysutils/wget.exp | |||
@@ -0,0 +1,34 @@ | |||
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 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "rm index.html*\r" | ||
11 | after 500 | ||
12 | |||
13 | send -- "firejail --ignore=quiet wget -q debian.org\r" | ||
14 | expect { | ||
15 | timeout {puts "TESTING ERROR 1\n";exit} | ||
16 | "Child process initialized" | ||
17 | } | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 2\n";exit} | ||
20 | "Parent is shutting down" | ||
21 | } | ||
22 | after 100 | ||
23 | |||
24 | send -- "ls -l index.html\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 3\n";exit} | ||
27 | "No such file or directory" {puts "TESTING ERROR 4\n";exit} | ||
28 | "rw" | ||
29 | } | ||
30 | after 100 | ||
31 | send -- "rm index.html*\r" | ||
32 | after 500 | ||
33 | |||
34 | puts "\nall done\n" | ||