#!/usr/bin/expect -f # This file is part of Firejail project # Copyright (C) 2014-2018 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"