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 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100755 test/features/3.7.exp (limited to 'test/features/3.7.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" -- cgit v1.2.3-54-g00ecf