From 57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 3 May 2016 08:41:24 -0400 Subject: networking features testing --- test/profiles/profile_readonly.exp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 test/profiles/profile_readonly.exp (limited to 'test/profiles/profile_readonly.exp') diff --git a/test/profiles/profile_readonly.exp b/test/profiles/profile_readonly.exp new file mode 100755 index 000000000..e8e78d6ad --- /dev/null +++ b/test/profiles/profile_readonly.exp @@ -0,0 +1,36 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "mkdir /tmp/firejailtestdir\r" +send -- "touch /tmp/firejailtestfile\r" +sleep 1 + +send -- "firejail --profile=readonly.profile\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 2 + +send -- "ls > /tmp/firejailtestdir/ttt\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Read-only file system" +} +sleep 1 + +send -- "ls > /tmp/firejailtestfile\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Read-only file system" +} +send -- "exit\r" +sleep 1 + +send -- "rm -fr /tmp/firejailtest*\r" +sleep 1 + +puts "\nall done\n" -- cgit v1.2.3-70-g09d2