diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | etc/profile-a-l/dig.profile | 2 | ||||
-rw-r--r-- | etc/profile-a-l/host.profile | 2 | ||||
-rw-r--r-- | etc/profile-m-z/nslookup.profile | 2 | ||||
-rw-r--r-- | etc/profile-m-z/ping.profile | 3 | ||||
-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 |
10 files changed, 114 insertions, 7 deletions
@@ -275,8 +275,8 @@ $(TEST_TARGETS): | |||
275 | $(MAKE) -C test $(subst test-,,$@) | 275 | $(MAKE) -C test $(subst test-,,$@) |
276 | 276 | ||
277 | 277 | ||
278 | # extract some data about the testing setup: kernel, network connectivity, pwd | 278 | # extract some data about the testing setup: kernel, network connectivity, user |
279 | lab-setup:; uname -r; pwd; whoami; cat /etc/resolv.conf; cat /etc/hosts; ping -c 3 yahoo.com; dig yahoo.com; host yahoo.com; nslookup yahoo.com; | 279 | lab-setup:; uname -r; pwd; whoami; cat /etc/resolv.conf; cat /etc/hosts; dig dns.quad9.net; ping -c 3 dns.quad9.net |
280 | 280 | ||
281 | 281 | ||
282 | test: lab-setup test-profiles test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters | 282 | test: lab-setup test-profiles test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters |
diff --git a/etc/profile-a-l/dig.profile b/etc/profile-a-l/dig.profile index 90db2caa6..5ae3a81c6 100644 --- a/etc/profile-a-l/dig.profile +++ b/etc/profile-a-l/dig.profile | |||
@@ -48,7 +48,7 @@ tracelog | |||
48 | disable-mnt | 48 | disable-mnt |
49 | private-bin bash,dig,sh | 49 | private-bin bash,dig,sh |
50 | private-dev | 50 | private-dev |
51 | private-etc resolv.conf,login.defs,passwd | 51 | private-etc login.defs,passwd,resolv.conf |
52 | # Add the next line to your dig.local on non Debian/Ubuntu OS (see issue #3038). | 52 | # Add the next line to your dig.local on non Debian/Ubuntu OS (see issue #3038). |
53 | #private-lib | 53 | #private-lib |
54 | private-tmp | 54 | private-tmp |
diff --git a/etc/profile-a-l/host.profile b/etc/profile-a-l/host.profile index b1689b67e..a9c9d81b2 100644 --- a/etc/profile-a-l/host.profile +++ b/etc/profile-a-l/host.profile | |||
@@ -42,7 +42,7 @@ tracelog | |||
42 | disable-mnt | 42 | disable-mnt |
43 | private | 43 | private |
44 | private-bin bash,host,sh | 44 | private-bin bash,host,sh |
45 | private-etc resolv.conf,login.defs,passwd | 45 | private-etc login.defs,passwd,resolv.conf |
46 | private-dev | 46 | private-dev |
47 | private-tmp | 47 | private-tmp |
48 | 48 | ||
diff --git a/etc/profile-m-z/nslookup.profile b/etc/profile-m-z/nslookup.profile index 8eeccf870..8069daf52 100644 --- a/etc/profile-m-z/nslookup.profile +++ b/etc/profile-m-z/nslookup.profile | |||
@@ -45,7 +45,7 @@ tracelog | |||
45 | 45 | ||
46 | disable-mnt | 46 | disable-mnt |
47 | private-bin bash,nslookup,sh | 47 | private-bin bash,nslookup,sh |
48 | private-etc resolv.conf,login.defs,passwd | 48 | private-etc login.defs,passwd,resolv.conf |
49 | private-dev | 49 | private-dev |
50 | private-tmp | 50 | private-tmp |
51 | 51 | ||
diff --git a/etc/profile-m-z/ping.profile b/etc/profile-m-z/ping.profile index 1a6178bae..c86cf13da 100644 --- a/etc/profile-m-z/ping.profile +++ b/etc/profile-m-z/ping.profile | |||
@@ -56,8 +56,7 @@ private | |||
56 | #private-bin ping - has mammoth problems with execvp: "No such file or directory" | 56 | #private-bin ping - has mammoth problems with execvp: "No such file or directory" |
57 | private-cache | 57 | private-cache |
58 | private-dev | 58 | private-dev |
59 | # /etc/hosts is required in private-etc; however, just adding it to the list doesn't solve the problem! | 59 | private-etc alternatives,ca-certificates,crypto-policies,hosts,login.defs,passwd,pki,resolv.conf,ssl |
60 | private-etc alternatives,ca-certificates,crypto-policies,hosts,pki,resolv.conf,ssl,passwd,login.defs | ||
61 | private-lib | 60 | private-lib |
62 | private-tmp | 61 | private-tmp |
63 | 62 | ||
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 | |||