Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
netblue30 committed Oct 31, 2019
1 parent d0a4842 commit 0e723a8
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 17 deletions.
3 changes: 3 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ test-fnetfilter:
test: test-profiles test-private-lib test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments
echo "TEST COMPLETE"

test-noprofiles: test-private-lib test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments
echo "TEST COMPLETE"

test-travis: test-profiles test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment test-filters test-arguments
echo "TEST COMPLETE"

Expand Down
6 changes: 3 additions & 3 deletions test/apps/transmission-qt.exp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set timeout 10
spawn $env(SHELL)
match_max 100000

send -- "firejail transmission-qt\r"
send -- "firejail --ignore=quiet transmission-qt\r"
expect {
timeout {puts "TESTING ERROR 0\n";exit}
"Reading profile /etc/firejail/transmission-qt.profile"
Expand Down Expand Up @@ -50,7 +50,7 @@ send -- "firemon --seccomp\r"
expect {
timeout {puts "TESTING ERROR 5\n";exit}
"need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
":firejail transmission-qt"
":firejail --ignore=quiet transmission-qt"
}
expect {
timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
Expand All @@ -64,7 +64,7 @@ after 100
send -- "firemon --caps\r"
expect {
timeout {puts "TESTING ERROR 6\n";exit}
":firejail transmission-qt"
":firejail --ignore=quiet transmission-qt"
}
expect {
timeout {puts "TESTING ERROR 6.1\n";exit}
Expand Down
6 changes: 3 additions & 3 deletions test/private-lib/transmission-gtk.exp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set timeout 10
spawn $env(SHELL)
match_max 100000

send -- "firejail transmission-gtk\r"
send -- "firejail --ignore=quiet transmission-gtk\r"
expect {
timeout {puts "TESTING ERROR 0\n";exit}
"Reading profile /etc/firejail/transmission-gtk.profile"
Expand Down Expand Up @@ -50,7 +50,7 @@ send -- "firemon --seccomp\r"
expect {
timeout {puts "TESTING ERROR 5\n";exit}
"need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
":firejail transmission-gtk"
":firejail --ignore=quiet transmission-gtk"
}
expect {
timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
Expand All @@ -64,7 +64,7 @@ after 100
send -- "firemon --caps\r"
expect {
timeout {puts "TESTING ERROR 6\n";exit}
":firejail transmission-gtk"
":firejail --ignore=quiet transmission-gtk"
}
expect {
timeout {puts "TESTING ERROR 6.1\n";exit}
Expand Down
38 changes: 27 additions & 11 deletions test/utils/build.exp
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,40 @@ expect {
}
after 100

send -- "firejail --build cat /var/tmp/firejail-test-file-7699\r"
expect {
timeout {puts "TESTING ERROR 11\n";exit}
"whitelist /var/tmp/firejail-test-file-7699"
}
send -- "rm firejail-test-file-4388\r"
after 100

send -- "firejail --build man firejail\r"
send -- "firejail --build=firejail-test-file-4388 cat /etc/passwd\r"
after 100
send -- "cat firejail-test-file-4388\r"
expect {
timeout {puts "TESTING ERROR 12\n";exit}
"whitelist /usr/share/man"
timeout {puts "TESTING ERROR 10.1\n";exit}
"private-etc passwd,"
}
after 100

send -- "firejail --build wget blablabla\r"

#send -- "firejail --build cat /var/tmp/firejail-test-file-7699\r"
#expect {
# timeout {puts "TESTING ERROR 11\n";exit}
# "whitelist /var/tmp/firejail-test-file-7699"
#}
#after 100

#send -- "firejail --build man firejail\r"
#expect {
# timeout {puts "TESTING ERROR 12\n";exit}
# "whitelist /usr/share/man"
#}
#after 100

send -- "firejail --build wget --output-document=~ debian.org\r"
expect {
timeout {puts "TESTING ERROR 13\n";exit}
"protocol inet"
"protocol"
}
expect {
timeout {puts "TESTING ERROR 13.1\n";exit}
"inet"
}
after 100

Expand Down
1 change: 1 addition & 0 deletions test/utils/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ echo "TESTING: build (test/utils/build.exp)"
rm -f ~/firejail-test-file-7699
rm -f /tmp/firejail-test-file-7699
rm -f /var/tmp/firejail-test-file-7699
rm -f firejail-test-file-4388

if [ $(readlink /proc/self) -lt 100 ]; then
echo "TESTING SKIP: already running in pid namespace (test/utils/audit.exp)"
Expand Down

0 comments on commit 0e723a8

Please sign in to comment.