-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
netblue30
committed
Mar 29, 2017
1 parent
458f3d9
commit b2b603e
Showing
6 changed files
with
149 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/expect -f | ||
# This file is part of Firejail project | ||
# Copyright (C) 2014-2017 Firejail Authors | ||
# License GPL v2 | ||
|
||
set timeout 10 | ||
spawn $env(SHELL) | ||
match_max 100000 | ||
|
||
set MAXi 100 | ||
|
||
# blacklist testing | ||
set i 1 | ||
send -- "firejail --profile=blacklist.profile\r" | ||
expect { | ||
timeout {puts "TESTING ERROR 1\n";exit} | ||
"Child process initialized" | ||
} | ||
|
||
while { $i <= $MAXi } { | ||
send -- "cat ~/fj-stress-test/testfile$i\r" | ||
expect { | ||
timeout {puts "TESTING ERROR 1\n";exit} | ||
"denied" | ||
} | ||
incr i | ||
after 100 | ||
} | ||
after 100 | ||
|
||
send -- "exit\r" | ||
sleep 1 | ||
|
||
# noblacklist testing | ||
set i 1 | ||
send -- "firejail --profile=noblacklist.profile\r" | ||
expect { | ||
timeout {puts "TESTING ERROR 1\n";exit} | ||
"Child process initialized" | ||
} | ||
|
||
while { $i <= $MAXi } { | ||
send -- "cat ~/fj-stress-test/testfile$i\r" | ||
expect { | ||
timeout {puts "TESTING ERROR 1\n";exit} | ||
"hello" | ||
} | ||
incr i | ||
after 100 | ||
} | ||
after 100 | ||
|
||
send -- "exit\r" | ||
sleep 1 | ||
|
||
|
||
|
||
after 100 | ||
puts "\nall done\n" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/expect -f | ||
# This file is part of Firejail project | ||
# Copyright (C) 2014-2017 Firejail Authors | ||
# License GPL v2 | ||
|
||
set timeout 10 | ||
spawn $env(SHELL) | ||
match_max 100000 | ||
|
||
# env testing | ||
send -- "firejail --profile=env.profile\r" | ||
expect { | ||
timeout {puts "TESTING ERROR 1\n";exit} | ||
"Child process initialized" | ||
} | ||
|
||
send -- "env | grep FJSTRESS77\r" | ||
expect { | ||
timeout {puts "TESTING ERROR 2\n";exit} | ||
"FJSTRESS77=stress" | ||
} | ||
|
||
send -- "env | grep FJSTRESS | wc -l\r" | ||
expect { | ||
timeout {puts "TESTING ERROR 3\n";exit} | ||
"100" | ||
} | ||
|
||
send -- "exit\r" | ||
after 100 | ||
puts "\nall done\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters