#!/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 send -- "firejail --whitelist=/dev/null --debug\r" expect { timeout {puts "TESTING ERROR 0\n";exit} "Child process initialized" } sleep 1 send -- "find /dev | wc -l\r" expect { timeout {puts "TESTING ERROR 1\n";exit} "2" } after 100 send -- "exit\r" sleep 1 send -- "firejail --private-dev --debug\r" expect { timeout {puts "TESTING ERROR 2\n";exit} "Child process initialized" } sleep 1 send -- "ls -l /dev | wc -l\r" expect { timeout {puts "TESTING ERROR 3\n";exit} "13" {puts "OK\n"} "12" {puts "OK\n"} } after 100 send -- "exit\r" sleep 1 after 100 puts "\nall done\n"