aboutsummaryrefslogtreecommitdiffstats
path: root/test/sysutils
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2023-01-19 00:17:47 -0500
committerLibravatar netblue30 <netblue30@protonmail.com>2023-01-19 00:17:47 -0500
commit17189823335d670388e71e25db8d5bec828806c2 (patch)
tree90927ef643dd414ef84a858a91f5cc71f0e60b14 /test/sysutils
parentMerge branch 'master' of ssh://github.com/netblue30/firejail (diff)
downloadfirejail-17189823335d670388e71e25db8d5bec828806c2.tar.gz
firejail-17189823335d670388e71e25db8d5bec828806c2.tar.zst
firejail-17189823335d670388e71e25db8d5bec828806c2.zip
more profile fixes/testing
Diffstat (limited to 'test/sysutils')
-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
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
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