mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-16 14:16:16 -06:00
testing
This commit is contained in:
parent
1c539a83dd
commit
d30ae468d9
14 changed files with 90 additions and 19 deletions
|
|
@ -147,7 +147,7 @@ uninstall:
|
|||
rm -f $(DESTDIR)/$(datarootdir)/bash-completion/completions/firecfg
|
||||
|
||||
DISTFILES = "src etc platform configure configure.ac Makefile.in install.sh mkman.sh mketc.sh mkdeb.sh mkuid.sh COPYING README RELNOTES"
|
||||
DISTFILES_TEST = "test/rlimit test/apps test/apps-x11 test/apps-x11-xorg test/root test/fcopy test/environment test/profiles test/utils test/compile test/filters test/network test/arguments test/fs test/sysutils"
|
||||
DISTFILES_TEST = "test/apps test/apps-x11 test/apps-x11-xorg test/root test/fcopy test/environment test/profiles test/utils test/compile test/filters test/network test/arguments test/fs test/sysutils"
|
||||
|
||||
dist:
|
||||
mv config.status config.status.old
|
||||
|
|
@ -225,13 +225,10 @@ test-arguments:
|
|||
test-fs:
|
||||
cd test/fs; ./fs.sh | grep TESTING
|
||||
|
||||
test-rlimit:
|
||||
cd test/rlimit; ./rlimit.sh | grep TESTING
|
||||
|
||||
test-fcopy:
|
||||
cd test/fcopy; ./fcopy.sh | grep TESTING
|
||||
|
||||
test: test-profiles test-fcopy test-fs test-utils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments test-rlimit
|
||||
test: test-profiles test-fcopy test-fs test-utils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments
|
||||
echo "TEST COMPLETE"
|
||||
|
||||
##########################################
|
||||
|
|
|
|||
|
|
@ -95,4 +95,19 @@ if [ "$?" -eq 0 ];
|
|||
then
|
||||
echo "TESTING: ibus (test/environment/ibus.exp)"
|
||||
./ibus.exp
|
||||
else
|
||||
echo "TESTING SKIP: ibus not configured"
|
||||
fi
|
||||
|
||||
echo "TESTING: rlimit (test/rlimit/rlimit.exp)"
|
||||
./rlimit.exp
|
||||
|
||||
echo "TESTING: rlimit profile (test/rlimit/rlimit-profile.exp)"
|
||||
./rlimit-profile.exp
|
||||
|
||||
echo "TESTING: rlimit errors (test/rlimit/rlimit-bad.exp)"
|
||||
./rlimit-bad.exp
|
||||
|
||||
echo "TESTING: rlimit errors profile (test/rlimit/rlimit-bad-profile.exp)"
|
||||
./rlimit-bad-profile.exp
|
||||
|
||||
|
|
|
|||
35
test/environment/rlimit-bad-profile.exp
Executable file
35
test/environment/rlimit-bad-profile.exp
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout 10
|
||||
spawn $env(SHELL)
|
||||
match_max 100000
|
||||
|
||||
|
||||
send -- "firejail --profile=rlimit-bad1.profile\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 4\n";exit}
|
||||
"Invalid rlimit option"
|
||||
}
|
||||
after 100
|
||||
|
||||
send -- "firejail --profile=rlimit-bad2.profile\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 5\n";exit}
|
||||
"Invalid rlimit option"
|
||||
}
|
||||
after 100
|
||||
|
||||
send -- "firejail --profile=rlimit-bad3.profile\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 6\n";exit}
|
||||
"Invalid rlimit option"
|
||||
}
|
||||
after 100
|
||||
send -- "firejail --profile=rlimit-bad4.profile\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 7\n";exit}
|
||||
"Invalid rlimit option"
|
||||
}
|
||||
after 100
|
||||
|
||||
puts "\nall done\n"
|
||||
34
test/environment/rlimit-bad.exp
Executable file
34
test/environment/rlimit-bad.exp
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout 10
|
||||
spawn $env(SHELL)
|
||||
match_max 100000
|
||||
|
||||
send -- "firejail --rlimit-fsize=-1024\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 0\n";exit}
|
||||
"invalid rlimt fsize"
|
||||
}
|
||||
after 100
|
||||
|
||||
send -- "firejail --rlimit-nofile=asdf\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 1\n";exit}
|
||||
"invalid rlimt nofile"
|
||||
}
|
||||
after 100
|
||||
|
||||
send -- "firejail --rlimit-nproc=100.23\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 2\n";exit}
|
||||
"invalid rlimt nproc"
|
||||
}
|
||||
after 100
|
||||
send -- "firejail --rlimit-sigpending=2345-78\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 3\n";exit}
|
||||
"invalid rlimt sigpending"
|
||||
}
|
||||
after 100
|
||||
|
||||
puts "\nall done\n"
|
||||
1
test/environment/rlimit-bad1.profile
Normal file
1
test/environment/rlimit-bad1.profile
Normal file
|
|
@ -0,0 +1 @@
|
|||
rlimit-fsize -1024
|
||||
1
test/environment/rlimit-bad2.profile
Normal file
1
test/environment/rlimit-bad2.profile
Normal file
|
|
@ -0,0 +1 @@
|
|||
rlimit-nofile asdf
|
||||
1
test/environment/rlimit-bad3.profile
Normal file
1
test/environment/rlimit-bad3.profile
Normal file
|
|
@ -0,0 +1 @@
|
|||
rlimit-nproc 100.23
|
||||
1
test/environment/rlimit-bad4.profile
Normal file
1
test/environment/rlimit-bad4.profile
Normal file
|
|
@ -0,0 +1 @@
|
|||
rlimit-sigpending 67asd56
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/bash
|
||||
# This file is part of Firejail project
|
||||
# Copyright (C) 2014-2016 Firejail Authors
|
||||
# License GPL v2
|
||||
|
||||
export MALLOC_CHECK_=3
|
||||
export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
|
||||
|
||||
echo "TESTING: rlimit (test/rlimit/rlimit.exp)"
|
||||
./rlimit.exp
|
||||
|
||||
echo "TESTING: rlimit profile (test/rlimit/rlimit-profile.exp)"
|
||||
./rlimit-profile.exp
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue