aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--etc/profile-a-l/dig.profile2
-rw-r--r--etc/profile-a-l/host.profile2
-rw-r--r--etc/profile-m-z/nslookup.profile2
-rw-r--r--etc/profile-m-z/ping.profile3
-rwxr-xr-xtest/sysutils/dig.exp18
-rwxr-xr-xtest/sysutils/host.exp18
-rwxr-xr-xtest/sysutils/man.exp20
-rwxr-xr-xtest/sysutils/nslookup.exp18
-rwxr-xr-xtest/sysutils/sysutils.sh34
10 files changed, 114 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index ad20921ba..3dfd6a3b6 100644
--- a/Makefile
+++ b/Makefile
@@ -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
279lab-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; 279lab-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
282test: 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 282test: 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
48disable-mnt 48disable-mnt
49private-bin bash,dig,sh 49private-bin bash,dig,sh
50private-dev 50private-dev
51private-etc resolv.conf,login.defs,passwd 51private-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
54private-tmp 54private-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
42disable-mnt 42disable-mnt
43private 43private
44private-bin bash,host,sh 44private-bin bash,host,sh
45private-etc resolv.conf,login.defs,passwd 45private-etc login.defs,passwd,resolv.conf
46private-dev 46private-dev
47private-tmp 47private-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
46disable-mnt 46disable-mnt
47private-bin bash,nslookup,sh 47private-bin bash,nslookup,sh
48private-etc resolv.conf,login.defs,passwd 48private-etc login.defs,passwd,resolv.conf
49private-dev 49private-dev
50private-tmp 50private-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"
57private-cache 57private-cache
58private-dev 58private-dev
59# /etc/hosts is required in private-etc; however, just adding it to the list doesn't solve the problem! 59private-etc alternatives,ca-certificates,crypto-policies,hosts,login.defs,passwd,pki,resolv.conf,ssl
60private-etc alternatives,ca-certificates,crypto-policies,hosts,pki,resolv.conf,ssl,passwd,login.defs
61private-lib 60private-lib
62private-tmp 61private-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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail dig +timeout=1 +retry=0 dns.quad9.net\r"
11expect {
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}
17after 100
18puts "\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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail host -W 1 -R 0 dns.quad9.net\r"
11expect {
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}
17after 100
18puts "\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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail man ls\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "NAME"
14}
15expect {
16 timeout {puts "TESTING ERROR 0\n";exit}
17 "SYNOPSIS"
18}
19after 100
20puts "\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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail nslookup -timeout=1 -retry=0 dns.quad9.net\r"
11expect {
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}
17after 100
18puts "\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
78else 78else
79 echo "TESTING SKIP: ping not found" 79 echo "TESTING SKIP: ping not found"
80fi 80fi
81
82if command -v dig
83then
84 echo "TESTING: dig"
85 ./dig.exp
86else
87 echo "TESTING SKIP: dig not found"
88fi
89
90if command -v host
91then
92 echo "TESTING: host"
93 ./host.exp
94else
95 echo "TESTING SKIP: host not found"
96fi
97
98if command -v nslookup
99then
100 echo "TESTING: nslookup"
101 ./host.exp
102else
103 echo "TESTING SKIP: nslookup not found"
104fi
105
106if command -v man
107then
108 echo "TESTING: man"
109 ./man.exp
110else
111 echo "TESTING SKIP: man not found"
112fi
113
114