mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
testing
This commit is contained in:
parent
c729d5927d
commit
020c544903
16 changed files with 117 additions and 32 deletions
|
|
@ -282,5 +282,8 @@ test-firemon:
|
|||
test-utils:
|
||||
cd test/utils; ./utils.sh | grep TESTING
|
||||
|
||||
test: test-profiles test-utils test-apps test-apps-x11 test-firemon
|
||||
test-environment:
|
||||
cd test/environment; ./environment.sh | grep TESTING
|
||||
|
||||
test: test-profiles test-utils test-environment test-apps test-apps-x11 test-firemon
|
||||
echo "TEST COMPLETE"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#!/usr/bin/expect -f
|
||||
# This file is part of Firejail project
|
||||
# Copyright (C) 2014-2016 Firejail Authors
|
||||
# License GPL v2
|
||||
|
||||
set timeout 10
|
||||
spawn $env(SHELL)
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
#!/usr/bin/expect -f
|
||||
# This file is part of Firejail project
|
||||
# Copyright (C) 2014-2016 Firejail Authors
|
||||
# License GPL v2
|
||||
|
||||
set timeout 10
|
||||
spawn $env(SHELL)
|
||||
47
test/environment/environment.sh
Executable file
47
test/environment/environment.sh
Executable file
|
|
@ -0,0 +1,47 @@
|
|||
#!/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: environment variables (test/environment/env.exp)"
|
||||
./env.exp
|
||||
|
||||
echo "TESTING: shell none(test/environment/shell-none.exp)"
|
||||
./shell-none.exp
|
||||
|
||||
which dash
|
||||
if [ "$?" -eq 0 ];
|
||||
then
|
||||
echo "TESTING: dash (test/environment/dash.exp)"
|
||||
./dash.exp
|
||||
else
|
||||
echo "TESTING: dash not found"
|
||||
fi
|
||||
|
||||
which csh
|
||||
if [ "$?" -eq 0 ];
|
||||
then
|
||||
echo "TESTING: csh (test/environment/csh.exp)"
|
||||
./csh.exp
|
||||
else
|
||||
echo "TESTING: csh not found"
|
||||
fi
|
||||
|
||||
which zsh
|
||||
if [ "$?" -eq 0 ];
|
||||
then
|
||||
echo "TESTING: zsh (test/environment/zsh.exp)"
|
||||
./csh.exp
|
||||
else
|
||||
echo "TESTING: zsh not found"
|
||||
fi
|
||||
|
||||
echo "TESTING: rlimit (test/environment/rlimit.exp)"
|
||||
./rlimit.exp
|
||||
|
||||
echo "TESTING: rlimit profile (test/environment/rlimit-profile.exp)"
|
||||
./rlimit-profile.exp
|
||||
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
#!/usr/bin/expect -f
|
||||
# This file is part of Firejail project
|
||||
# Copyright (C) 2014-2016 Firejail Authors
|
||||
# License GPL v2
|
||||
|
||||
set timeout 10
|
||||
spawn $env(SHELL)
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
#!/usr/bin/expect -f
|
||||
# This file is part of Firejail project
|
||||
# Copyright (C) 2014-2016 Firejail Authors
|
||||
# License GPL v2
|
||||
|
||||
set timeout 10
|
||||
spawn $env(SHELL)
|
||||
48
test/environment/shell-none.exp
Executable file
48
test/environment/shell-none.exp
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/expect -f
|
||||
# This file is part of Firejail project
|
||||
# Copyright (C) 2014-2016 Firejail Authors
|
||||
# License GPL v2
|
||||
|
||||
set timeout 10
|
||||
spawn $env(SHELL)
|
||||
match_max 100000
|
||||
|
||||
send -- "firejail --shell=none\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 0\n";exit}
|
||||
"shell=none configured, but no program specified"
|
||||
}
|
||||
sleep 1
|
||||
|
||||
send -- "firejail --profile=shell-none.profile\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 1\n";exit}
|
||||
"shell=none configured, but no program specified"
|
||||
}
|
||||
sleep 1
|
||||
|
||||
send -- "firejail --shell=none ls\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 2\n";exit}
|
||||
"Child process initialized"
|
||||
}
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 3\n";exit}
|
||||
"environment.sh"
|
||||
}
|
||||
sleep 1
|
||||
|
||||
send -- "firejail --profile=shell-none.profile ls\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 4\n";exit}
|
||||
"Child process initialized"
|
||||
}
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 5\n";exit}
|
||||
"environment.sh"
|
||||
}
|
||||
sleep 1
|
||||
|
||||
|
||||
puts "\nall done\n"
|
||||
|
||||
1
test/environment/shell-none.profile
Normal file
1
test/environment/shell-none.profile
Normal file
|
|
@ -0,0 +1 @@
|
|||
shell none
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
#!/usr/bin/expect -f
|
||||
# This file is part of Firejail project
|
||||
# Copyright (C) 2014-2016 Firejail Authors
|
||||
# License GPL v2
|
||||
|
||||
set timeout 10
|
||||
spawn $env(SHELL)
|
||||
29
test/test.sh
29
test/test.sh
|
|
@ -34,9 +34,6 @@ echo "TESTING: protocol (protocol.exp)"
|
|||
echo "TESTING: invalid filename (invalid_filename.exp)"
|
||||
./invalid_filename.exp
|
||||
|
||||
echo "TESTING: environment variables (env.exp)"
|
||||
./env.exp
|
||||
|
||||
echo "TESTING: whitelist empty (whitelist-empty.exp)"
|
||||
./whitelist-empty.exp
|
||||
|
||||
|
|
@ -96,15 +93,6 @@ echo "TESTING: extract command (extract_command.exp)"
|
|||
echo "TESTING: kmsg access (kmsg.exp)"
|
||||
./kmsg.exp
|
||||
|
||||
echo "TESTING: rlimit (option_rlimit.exp)"
|
||||
./option_rlimit.exp
|
||||
|
||||
echo "TESTING: firejail in firejail - single sandbox (firejail-in-firejail.exp)"
|
||||
./firejail-in-firejail.exp
|
||||
|
||||
echo "TESTING: firejail in firejail - force new sandbox (firejail-in-firejail2.exp)"
|
||||
./firejail-in-firejail2.exp
|
||||
|
||||
echo "TESTING: chroot overlay (option_chroot_overlay.exp)"
|
||||
./option_chroot_overlay.exp
|
||||
|
||||
|
|
@ -135,20 +123,6 @@ ls -al > tmpreadonly
|
|||
sleep 5
|
||||
rm -f tmpreadonly
|
||||
|
||||
echo "TESTING: zsh (shell_zsh.exp)"
|
||||
./shell_zsh.exp
|
||||
|
||||
echo "TESTING: csh (shell_csh.exp)"
|
||||
./shell_csh.exp
|
||||
|
||||
which dash
|
||||
if [ "$?" -eq 0 ];
|
||||
then
|
||||
echo "TESTING: dash (shell_dash.exp)"
|
||||
./shell_dash.exp
|
||||
else
|
||||
echo "TESTING: dash not found"
|
||||
fi
|
||||
|
||||
echo "TESTING: PID (pid.exp)"
|
||||
./pid.exp
|
||||
|
|
@ -159,9 +133,6 @@ echo "TESTING: output (output.exp)"
|
|||
echo "TESTING: profile no permissions (profile_noperm.exp)"
|
||||
./profile_noperm.exp
|
||||
|
||||
echo "TESTING: profile rlimit (profile_rlimit.exp)"
|
||||
./profile_rlimit.exp
|
||||
|
||||
echo "TESTING: profile read-only (profile_readonly.exp)"
|
||||
./profile_readonly.exp
|
||||
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ echo "TESTING: shutdown4 (test/utils/shutdown4.exp)"
|
|||
echo "TESTING: join test/utils/(join.exp)"
|
||||
./join.exp
|
||||
|
||||
echo "TESTING: join2 test/utils/(join2.exp)"
|
||||
.join2.exp
|
||||
echo "TESTING: join2 (test/utils/join2.exp)"
|
||||
./join2.exp
|
||||
|
||||
echo "TESTING: join3 (test/utils/join3.exp)"
|
||||
./join3.exp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue