From 6d1e93c2aea17fa209779e768a57450b06dcfa14 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 2 Feb 2016 09:34:58 -0500 Subject: 0.9.38 testing --- test/features/3.7.exp | 91 ++++++++++++++++++++++++++++++++++++++++++++++ test/features/3.8.exp | 79 ++++++++++++++++++++++++++++++++++++++++ test/features/features.txt | 7 +++- test/features/test.sh | 7 +++- 4 files changed, 182 insertions(+), 2 deletions(-) create mode 100755 test/features/3.7.exp create mode 100755 test/features/3.8.exp diff --git a/test/features/3.7.exp b/test/features/3.7.exp new file mode 100755 index 000000000..d8236b851 --- /dev/null +++ b/test/features/3.7.exp @@ -0,0 +1,91 @@ +#!/usr/bin/expect -f +# +# private-tmp +# + +set timeout 10 +spawn $env(SHELL) +match_max 100000 +set overlay [lindex $argv 0] +set chroot [lindex $argv 1] + +# +# N +# +send -- "touch /tmp/test1\r" +sleep 1 +send -- "touch /tmp/test2\r" +sleep 1 +send -- "firejail --noprofile --private-tmp\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -al /tmp | wc -l\r" +expect { + timeout {puts "TESTING ERROR 1.1\n";exit} + "3" +} + + +after 100 +send -- "exit\r" +sleep 1 + +# +# O +# +if { $overlay == "overlay" } { + send -- "touch /tmp/test1\r" + sleep 1 + send -- "touch /tmp/test2\r" + sleep 1 + send -- "firejail --noprofile --overlay --private-tmp\r" + expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Child process initialized" + } + sleep 1 + + send -- "ls -al /tmp | wc -l\r" + expect { + timeout {puts "TESTING ERROR 3.1\n";exit} + "3" + } + + + after 100 + send -- "exit\r" + sleep 1 +} + +# +# C +# +if { $chroot == "chroot" } { + send -- "touch /tmp/test1\r" + sleep 1 + send -- "touch /tmp/test2\r" + sleep 1 + send -- "firejail --noprofile --chroot=/tmp/chroot --private-tmp\r" + expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Child process initialized" + } + sleep 1 + + send -- "ls -al /tmp | wc -l\r" + expect { + timeout {puts "TESTING ERROR 5.1\n";exit} + "3" + } + + after 100 + send -- "exit\r" + sleep 1 +} + + +puts "\nall done\n" diff --git a/test/features/3.8.exp b/test/features/3.8.exp new file mode 100755 index 000000000..72953d159 --- /dev/null +++ b/test/features/3.8.exp @@ -0,0 +1,79 @@ +#!/usr/bin/expect -f +# +# private-bin +# + +set timeout 10 +spawn $env(SHELL) +match_max 100000 +set overlay [lindex $argv 0] +set chroot [lindex $argv 1] + +# +# N +# +send -- "firejail --noprofile --private-bin=bash,cat,cp,ls,wc\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -l /bin | wc -l\r" +expect { + timeout {puts "TESTING ERROR 1.1\n";exit} + "6" +} + + +after 100 +send -- "exit\r" +sleep 1 + +# +# O +# +if { $overlay == "overlay" } { + send -- "firejail --noprofile --overlay --private-bin=bash,cat,cp,ls,wc\r" + expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Child process initialized" + } + sleep 1 + + send -- "ls -l /bin | wc -l\r" + expect { + timeout {puts "TESTING ERROR 3.1\n";exit} + "6" + } + + + after 100 + send -- "exit\r" + sleep 1 +} + +# +# C +# +if { $chroot == "chroot" } { + send -- "firejail --noprofile --chroot=/tmp/chroot --private-bin=bash,cat,cp,ls,wc\r" + expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Child process initialized" + } + sleep 1 + + send -- "ls -l /bin | wc -l\r" + expect { + timeout {puts "TESTING ERROR 5.1\n";exit} + "6" + } + + after 100 + send -- "exit\r" + sleep 1 +} + + +puts "\nall done\n" diff --git a/test/features/features.txt b/test/features/features.txt index 0c41090aa..ac5390bc9 100644 --- a/test/features/features.txt +++ b/test/features/features.txt @@ -46,6 +46,11 @@ C - chroot filesystem 3.5 private-dev - O, C - somehow /dev/log is missing 3.6 private-etc - - O not working + - O not working - todo +3.7 private-tmp +3.8 private-bin + - O, C not working - todo + + \ No newline at end of file diff --git a/test/features/test.sh b/test/features/test.sh index a162fc9ca..4e84f1f9c 100755 --- a/test/features/test.sh +++ b/test/features/test.sh @@ -99,5 +99,10 @@ echo "TESTING: 3.5 private-dev" ./3.5.exp $OVERLAY $CHROOT echo "TESTING: 3.6 private-etc" -./3.6.exp notworking-todo $CHROOT +./3.6.exp notworking $CHROOT +echo "TESTING: 3.7 private-tmp" +./3.7.exp $OVERLAY $CHROOT + +echo "TESTING: 3.8 private-bin" +./3.6.exp notworking notworking -- cgit v1.2.3-54-g00ecf