From 1379851360349d6617ad32944a25ee5e2bb74fc2 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sat, 8 Aug 2015 19:12:30 -0400 Subject: Baseline firejail 0.9.28 --- test/fs_var_tmp.exp | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100755 test/fs_var_tmp.exp (limited to 'test/fs_var_tmp.exp') diff --git a/test/fs_var_tmp.exp b/test/fs_var_tmp.exp new file mode 100755 index 000000000..95ceeb2a4 --- /dev/null +++ b/test/fs_var_tmp.exp @@ -0,0 +1,87 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +# testing read-write /var/tmp +send -- "firejail\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "echo mytest > /var/tmp/ttt;pwd\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "home" +} + +send -- "cat /var/tmp/ttt;pwd\r" +expect { + timeout {puts "TESTING ERROR 2.1\n";exit} + "mytest" +} +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "home" +} + +send -- "rm /var/tmp/ttt;pwd\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "home" +} + +send -- "cat /var/tmp/ttt;pwd\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "mytest" {puts "TESTING ERROR 4.1\n";exit} + "home" +} + +sleep 1 +send -- "exit\r" +sleep 1 + +# redo the test with --private +send -- "firejail\r" +expect { + timeout {puts "TESTING ERROR 10\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "echo mytest > /var/tmp/ttt;pwd\r" +expect { + timeout {puts "TESTING ERROR 11\n";exit} + "home" +} + +send -- "cat /var/tmp/ttt;pwd\r" +expect { + timeout {puts "TESTING ERROR 12.1\n";exit} + "mytest" +} +expect { + timeout {puts "TESTING ERROR 12\n";exit} + "home" +} + +send -- "rm /var/tmp/ttt;pwd\r" +expect { + timeout {puts "TESTING ERROR 13\n";exit} + "home" +} + +send -- "cat /var/tmp/ttt;pwd\r" +expect { + timeout {puts "TESTING ERROR 14\n";exit} + "mytest" {puts "TESTING ERROR 14.1\n";exit} + "home" +} + +sleep 1 + +puts "\n" -- cgit v1.2.3-54-g00ecf