Commit e7fbd682 authored by root's avatar root

testing

parent 5ff53a2c
......@@ -17,4 +17,11 @@ expect {
send -- "rm -rf ~/.firejail_test\r"
after 100
send -- "firejail --profile=mkdir2.profile\r"
expect {
timeout {puts "TESTING ERROR 2\n";exit}
"only directories in user home or /tmp"
}
after 100
puts "\nall done\n"
mkdir /etc/somefile
......@@ -42,5 +42,14 @@ expect {
"_firejail_test_dir/dir1/dir2/dir3/file1"
}
after 100
send -- "exit\r"
after 100
send -- "firejail --profile=mkfile.profile\r"
expect {
timeout {puts "TESTING ERROR 1\n";exit}
"only files in user home or /tmp"
}
after 100
puts "all done\n"
mkfile /etc/somefile
#!/usr/bin/expect -f
# This file is part of Firejail project
# Copyright (C) 2014-2017 Firejail Authors
# License GPL v2
set timeout 10
cd /home
spawn $env(SHELL)
match_max 100000
send -- "mkdir /sys/fs/cgroup/systemd/firejail\r"
sleep 1
send -- "ls /sys/fs/cgroup/systemd/firejail\r"
expect {
timeout {puts "TESTING ERROR 0\n";exit}
"tasks"
}
send -- "firejail --name=\"join testing\" --cgroup=/sys/fs/cgroup/systemd/firejail/tasks\r"
expect {
timeout {puts "TESTING ERROR 1\n";exit}
"Child process initialized"
}
sleep 2
spawn $env(SHELL)
send -- "wc -l /sys/fs/cgroup/systemd/firejail/tasks\r"
expect {
timeout {puts "TESTING ERROR 2\n";exit}
"3"
}
spawn $env(SHELL)
send -- "firejail --join=\"join testing\"\r"
expect {
timeout {puts "TESTING ERROR 3\n";exit}
"Switching to pid"
}
sleep 1
send -- "ps aux\r"
expect {
timeout {puts "TESTING ERROR 4\n";exit}
"/bin/bash"
}
expect {
timeout {puts "TESTING ERROR 5\n";exit}
"/bin/bash"
}
after 100
spawn $env(SHELL)
send -- "wc -l /sys/fs/cgroup/systemd/firejail/tasks\r"
expect {
timeout {puts "TESTING ERROR 6\n";exit}
"3"
}
after 100
puts "\nall done\n"
#!/bin/bash
# set a new firejail config file
cp firejail.config /etc/firejail/firejail.config
#cp firejail.config /etc/firejail/firejail.config
#********************************
# servers
......@@ -84,6 +84,9 @@ echo "TESTING: firejail configuration (test/root/checkcfg.exp)"
./checkcfg.exp
cp ../../etc/firejail.config /etc/firejail/.
echo "TESTING: cgroup (test/root/cgroup.exp)"
./cgroup.exp
echo "TESTING: tmpfs (test/root/option_tmpfs.exp)"
./option_tmpfs.exp
......@@ -117,5 +120,5 @@ else
fi
# restore the default config file
cp ../../etc/firejail.config /etc/firejail/firejail.config
#cp ../../etc/firejail.config /etc/firejail/firejail.config
......@@ -29,7 +29,7 @@ expect {
"/bin/bash"
}
send -- "exit"
send -- "exit\r"
after 100
puts "\nall done\n"
......@@ -32,7 +32,7 @@ expect {
"/bin/bash"
}
send -- "exit"
send -- "exit\r"
after 100
puts "\nall done\n"
......@@ -32,7 +32,7 @@ expect {
"/bin/bash"
}
send -- "exit"
send -- "exit\r"
after 100
puts "\nall done\n"
......@@ -32,7 +32,7 @@ expect {
"/bin/bash"
}
send -- "exit"
send -- "exit\r"
after 100
puts "\nall done\n"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment