Artifact Content
Not logged in

Artifact e49cd16eb8d6824e56e3b53d2af533ec071247f3:


#!/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 firefox -no-remote www.gentoo.org\r"
expect {
	timeout {puts "TESTING ERROR 0\n";exit}
	"Reading profile /etc/firejail/firefox.profile"
}
expect {
	timeout {puts "TESTING ERROR 1\n";exit}
	"Child process initialized"
}
sleep 10

spawn $env(SHELL)
send -- "firejail --list\r"
expect {
	timeout {puts "TESTING ERROR 3\n";exit}
	":firejail"
}
expect {
	timeout {puts "TESTING ERROR 3.1\n";exit}
	"firefox" {puts "firefox detected\n";}
	"iceweasel" {puts "iceweasel detected\n";}
}
expect {
	timeout {puts "TESTING ERROR 3.2\n";exit}
	"no-remote"
}
after 100

# grsecurity exit
send -- "file /proc/sys/kernel/grsecurity\r"
expect {
	timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
	"grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
	"cannot open" {puts "grsecurity not present\n"}
}


send -- "firejail --name=blablabla\r"
expect {
	timeout {puts "TESTING ERROR 4\n";exit}
	"Child process initialized"
}
sleep 2

spawn $env(SHELL)
send -- "firemon --seccomp\r"
expect {
	timeout {puts "TESTING ERROR 5\n";exit}
	"need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
	" firefox" {puts "firefox detected\n";}
	" iceweasel" {puts "iceweasel detected\n";}
}
expect {
	timeout {puts "TESTING ERROR 5.0\n";exit}
	"no-remote"
}
expect {
	timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
	"Seccomp:	2"
}
expect {
	timeout {puts "TESTING ERROR 5.1\n";exit}
	"name=blablabla"
}
after 100
send -- "firemon --caps\r"
expect {
	timeout {puts "TESTING ERROR 6\n";exit}
	" firefox" {puts "firefox detected\n";}
	" iceweasel" {puts "iceweasel detected\n";}
}
expect {
	timeout {puts "TESTING ERROR 6.0\n";exit}
	"no-remote"
}
expect {
	timeout {puts "TESTING ERROR 6.1\n";exit}
	"CapBnd:"
}
expect {
	timeout {puts "TESTING ERROR 6.2\n";exit}
	"0000000000000000"
}
expect {
	timeout {puts "TESTING ERROR 6.3\n";exit}
	"name=blablabla"
}
after 100

puts "\n"