mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-21 06:45:29 -06:00
more profile fixes/testing
This commit is contained in:
parent
6d7335c36b
commit
1718982333
10 changed files with 114 additions and 7 deletions
4
Makefile
4
Makefile
|
|
@ -275,8 +275,8 @@ $(TEST_TARGETS):
|
|||
$(MAKE) -C test $(subst test-,,$@)
|
||||
|
||||
|
||||
# extract some data about the testing setup: kernel, network connectivity, pwd
|
||||
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;
|
||||
# extract some data about the testing setup: kernel, network connectivity, user
|
||||
lab-setup:; uname -r; pwd; whoami; cat /etc/resolv.conf; cat /etc/hosts; dig dns.quad9.net; ping -c 3 dns.quad9.net
|
||||
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ tracelog
|
|||
disable-mnt
|
||||
private-bin bash,dig,sh
|
||||
private-dev
|
||||
private-etc resolv.conf,login.defs,passwd
|
||||
private-etc login.defs,passwd,resolv.conf
|
||||
# Add the next line to your dig.local on non Debian/Ubuntu OS (see issue #3038).
|
||||
#private-lib
|
||||
private-tmp
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ tracelog
|
|||
disable-mnt
|
||||
private
|
||||
private-bin bash,host,sh
|
||||
private-etc resolv.conf,login.defs,passwd
|
||||
private-etc login.defs,passwd,resolv.conf
|
||||
private-dev
|
||||
private-tmp
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ tracelog
|
|||
|
||||
disable-mnt
|
||||
private-bin bash,nslookup,sh
|
||||
private-etc resolv.conf,login.defs,passwd
|
||||
private-etc login.defs,passwd,resolv.conf
|
||||
private-dev
|
||||
private-tmp
|
||||
|
||||
|
|
|
|||
|
|
@ -56,8 +56,7 @@ private
|
|||
#private-bin ping - has mammoth problems with execvp: "No such file or directory"
|
||||
private-cache
|
||||
private-dev
|
||||
# /etc/hosts is required in private-etc; however, just adding it to the list doesn't solve the problem!
|
||||
private-etc alternatives,ca-certificates,crypto-policies,hosts,pki,resolv.conf,ssl,passwd,login.defs
|
||||
private-etc alternatives,ca-certificates,crypto-policies,hosts,login.defs,passwd,pki,resolv.conf,ssl
|
||||
private-lib
|
||||
private-tmp
|
||||
|
||||
|
|
|
|||
18
test/sysutils/dig.exp
Executable file
18
test/sysutils/dig.exp
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/expect -f
|
||||
# This file is part of Firejail project
|
||||
# Copyright (C) 2014-2022 Firejail Authors
|
||||
# License GPL v2
|
||||
|
||||
set timeout 10
|
||||
spawn $env(SHELL)
|
||||
match_max 100000
|
||||
|
||||
send -- "firejail dig +timeout=1 +retry=0 dns.quad9.net\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 0\n";exit}
|
||||
"no servers could be reached" {puts "no network connectivity!\n";exit}
|
||||
"NXDOMAIN" {puts "not found\n";exit}
|
||||
"ANSWER SECTION"
|
||||
}
|
||||
after 100
|
||||
puts "\nall done\n"
|
||||
18
test/sysutils/host.exp
Executable file
18
test/sysutils/host.exp
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/expect -f
|
||||
# This file is part of Firejail project
|
||||
# Copyright (C) 2014-2022 Firejail Authors
|
||||
# License GPL v2
|
||||
|
||||
set timeout 10
|
||||
spawn $env(SHELL)
|
||||
match_max 100000
|
||||
|
||||
send -- "firejail host -W 1 -R 0 dns.quad9.net\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 0\n";exit}
|
||||
"no servers could be reached" {puts "no network connectivity!\n";exit}
|
||||
"NXDOMAIN" {puts "not found\n";exit}
|
||||
"has address"
|
||||
}
|
||||
after 100
|
||||
puts "\nall done\n"
|
||||
20
test/sysutils/man.exp
Executable file
20
test/sysutils/man.exp
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/expect -f
|
||||
# This file is part of Firejail project
|
||||
# Copyright (C) 2014-2022 Firejail Authors
|
||||
# License GPL v2
|
||||
|
||||
set timeout 10
|
||||
spawn $env(SHELL)
|
||||
match_max 100000
|
||||
|
||||
send -- "firejail man ls\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 0\n";exit}
|
||||
"NAME"
|
||||
}
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 0\n";exit}
|
||||
"SYNOPSIS"
|
||||
}
|
||||
after 100
|
||||
puts "\nall done\n"
|
||||
18
test/sysutils/nslookup.exp
Executable file
18
test/sysutils/nslookup.exp
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/expect -f
|
||||
# This file is part of Firejail project
|
||||
# Copyright (C) 2014-2022 Firejail Authors
|
||||
# License GPL v2
|
||||
|
||||
set timeout 10
|
||||
spawn $env(SHELL)
|
||||
match_max 100000
|
||||
|
||||
send -- "firejail nslookup -timeout=1 -retry=0 dns.quad9.net\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 0\n";exit}
|
||||
"no servers could be reached" {puts "no network connectivity!\n";exit}
|
||||
"NXDOMAIN" {puts "not found\n";exit}
|
||||
"Address"
|
||||
}
|
||||
after 100
|
||||
puts "\nall done\n"
|
||||
|
|
@ -78,3 +78,37 @@ then
|
|||
else
|
||||
echo "TESTING SKIP: ping not found"
|
||||
fi
|
||||
|
||||
if command -v dig
|
||||
then
|
||||
echo "TESTING: dig"
|
||||
./dig.exp
|
||||
else
|
||||
echo "TESTING SKIP: dig not found"
|
||||
fi
|
||||
|
||||
if command -v host
|
||||
then
|
||||
echo "TESTING: host"
|
||||
./host.exp
|
||||
else
|
||||
echo "TESTING SKIP: host not found"
|
||||
fi
|
||||
|
||||
if command -v nslookup
|
||||
then
|
||||
echo "TESTING: nslookup"
|
||||
./host.exp
|
||||
else
|
||||
echo "TESTING SKIP: nslookup not found"
|
||||
fi
|
||||
|
||||
if command -v man
|
||||
then
|
||||
echo "TESTING: man"
|
||||
./man.exp
|
||||
else
|
||||
echo "TESTING SKIP: man not found"
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue