From fffce11c3da087172c069ec0ff4c788f5bcc522b Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 10 Nov 2016 20:15:22 -0500 Subject: testing --- test/fs/read-write.exp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 test/fs/read-write.exp (limited to 'test/fs/read-write.exp') diff --git a/test/fs/read-write.exp b/test/fs/read-write.exp new file mode 100755 index 000000000..cfca15605 --- /dev/null +++ b/test/fs/read-write.exp @@ -0,0 +1,49 @@ +#!/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 --read-only=~/_firejail_test_dir --read-write=~/_firejail_test_dir/test1\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "echo mytest >~/_firejail_test_dir/a;echo done\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "done" +} + +send -- "echo mytest >~/_firejail_test_dir/test1/b;echo done\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "done" +} + +send -- "cat ~/_firejail_test_dir/a;echo done\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "mytest" {puts "TESTING ERROR 4\n";exit} + "done" +} + + +send -- "cat ~/_firejail_test_dir/test1/b;echo done\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "mytest" +} +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "done" +} + +after 100 +puts "\nall done\n" -- cgit v1.2.3-70-g09d2