diff options
author | netblue30 <netblue30@protonmail.com> | 2023-01-19 00:17:47 -0500 |
---|---|---|
committer | netblue30 <netblue30@protonmail.com> | 2023-01-19 00:17:47 -0500 |
commit | 17189823335d670388e71e25db8d5bec828806c2 (patch) | |
tree | 90927ef643dd414ef84a858a91f5cc71f0e60b14 /test/sysutils | |
parent | Merge branch 'master' of ssh://github.com/netblue30/firejail (diff) | |
download | firejail-17189823335d670388e71e25db8d5bec828806c2.tar.gz firejail-17189823335d670388e71e25db8d5bec828806c2.tar.zst firejail-17189823335d670388e71e25db8d5bec828806c2.zip |
more profile fixes/testing
Diffstat (limited to 'test/sysutils')
-rwxr-xr-x | test/sysutils/dig.exp | 18 | ||||
-rwxr-xr-x | test/sysutils/host.exp | 18 | ||||
-rwxr-xr-x | test/sysutils/man.exp | 20 | ||||
-rwxr-xr-x | test/sysutils/nslookup.exp | 18 | ||||
-rwxr-xr-x | test/sysutils/sysutils.sh | 34 |
5 files changed, 108 insertions, 0 deletions
diff --git a/test/sysutils/dig.exp b/test/sysutils/dig.exp new file mode 100755 index 000000000..bd5ccbb5c --- /dev/null +++ b/test/sysutils/dig.exp | |||
@@ -0,0 +1,18 @@ | |||
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 -- "firejail dig +timeout=1 +retry=0 dns.quad9.net\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "no servers could be reached" {puts "no network connectivity!\n";exit} | ||
14 | "NXDOMAIN" {puts "not found\n";exit} | ||
15 | "ANSWER SECTION" | ||
16 | } | ||
17 | after 100 | ||
18 | puts "\nall done\n" | ||
diff --git a/test/sysutils/host.exp b/test/sysutils/host.exp new file mode 100755 index 000000000..7fe3ddfa4 --- /dev/null +++ b/test/sysutils/host.exp | |||
@@ -0,0 +1,18 @@ | |||
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 -- "firejail host -W 1 -R 0 dns.quad9.net\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "no servers could be reached" {puts "no network connectivity!\n";exit} | ||
14 | "NXDOMAIN" {puts "not found\n";exit} | ||
15 | "has address" | ||
16 | } | ||
17 | after 100 | ||
18 | puts "\nall done\n" | ||
diff --git a/test/sysutils/man.exp b/test/sysutils/man.exp new file mode 100755 index 000000000..6e0fb5584 --- /dev/null +++ b/test/sysutils/man.exp | |||
@@ -0,0 +1,20 @@ | |||
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 -- "firejail man ls\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "NAME" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 0\n";exit} | ||
17 | "SYNOPSIS" | ||
18 | } | ||
19 | after 100 | ||
20 | puts "\nall done\n" | ||
diff --git a/test/sysutils/nslookup.exp b/test/sysutils/nslookup.exp new file mode 100755 index 000000000..2a99441d9 --- /dev/null +++ b/test/sysutils/nslookup.exp | |||
@@ -0,0 +1,18 @@ | |||
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 -- "firejail nslookup -timeout=1 -retry=0 dns.quad9.net\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "no servers could be reached" {puts "no network connectivity!\n";exit} | ||
14 | "NXDOMAIN" {puts "not found\n";exit} | ||
15 | "Address" | ||
16 | } | ||
17 | after 100 | ||
18 | puts "\nall done\n" | ||
diff --git a/test/sysutils/sysutils.sh b/test/sysutils/sysutils.sh index bfe723047..a46cfb1ad 100755 --- a/test/sysutils/sysutils.sh +++ b/test/sysutils/sysutils.sh | |||
@@ -78,3 +78,37 @@ then | |||
78 | else | 78 | else |
79 | echo "TESTING SKIP: ping not found" | 79 | echo "TESTING SKIP: ping not found" |
80 | fi | 80 | fi |
81 | |||
82 | if command -v dig | ||
83 | then | ||
84 | echo "TESTING: dig" | ||
85 | ./dig.exp | ||
86 | else | ||
87 | echo "TESTING SKIP: dig not found" | ||
88 | fi | ||
89 | |||
90 | if command -v host | ||
91 | then | ||
92 | echo "TESTING: host" | ||
93 | ./host.exp | ||
94 | else | ||
95 | echo "TESTING SKIP: host not found" | ||
96 | fi | ||
97 | |||
98 | if command -v nslookup | ||
99 | then | ||
100 | echo "TESTING: nslookup" | ||
101 | ./host.exp | ||
102 | else | ||
103 | echo "TESTING SKIP: nslookup not found" | ||
104 | fi | ||
105 | |||
106 | if command -v man | ||
107 | then | ||
108 | echo "TESTING: man" | ||
109 | ./man.exp | ||
110 | else | ||
111 | echo "TESTING SKIP: man not found" | ||
112 | fi | ||
113 | |||
114 | |||