From 362d290bacf90a9bb29d6c25ca395117e4da838e Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 5 Sep 2017 10:56:40 -0400 Subject: testing --- test/fs/fs.sh | 3 +++ test/fs/private-lib.exp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100755 test/fs/private-lib.exp (limited to 'test/fs') diff --git a/test/fs/fs.sh b/test/fs/fs.sh index 9e7ead3c9..e67ccc476 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh @@ -28,6 +28,9 @@ echo "TESTING: kmsg access (test/fs/kmsg.exp)" echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)" ./fs_var_tmp.exp +echo "TESTING: private-lib (test/fs/private-lib.exp)" +./private-lib.exp + echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" ./fs_var_lock.exp diff --git a/test/fs/private-lib.exp b/test/fs/private-lib.exp new file mode 100755 index 000000000..dd418da0f --- /dev/null +++ b/test/fs/private-lib.exp @@ -0,0 +1,44 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2017 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --private-lib --private-bin=sh,bash,dash,ps,grep,ls,find,echo \r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +after 100 + +send -- "find /bin; echo done\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "rm" {puts "TESTING ERROR 3\n";exit} + "cp" {puts "TESTING ERROR 4\n";exit} + "done" +} +after 100 + +send -- "find /lib; echo done\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "modules" {puts "TESTING ERROR 6\n";exit} + "firmware" {puts "TESTING ERROR 7\n";exit} + "libc.so" +} +after 100 + +send -- "find /usr/lib; echo done\r" +expect { + timeout {puts "TESTING ERROR 8\n";exit} + "grub" {puts "TESTING ERROR 9\n";exit} + "mozilla" {puts "TESTING ERROR 10\n";exit} + "libdl.so" +} +after 100 + +puts "\nall done\n" -- cgit v1.2.3-54-g00ecf