From c0dc4e056589c41b423e9a5c1fe5edd2b845967a Mon Sep 17 00:00:00 2001 From: netblue30 Date: Wed, 23 Dec 2015 21:20:14 -0500 Subject: 0.9.36 testing --- test/features/1.2.exp | 24 ++++++++++++------------ test/features/test.sh | 33 ++++++++++++++++++++------------- test/private-etc.exp | 12 ++++-------- test/profile_syntax.exp | 11 ++--------- test/test.profile | 3 +-- 5 files changed, 39 insertions(+), 44 deletions(-) (limited to 'test') diff --git a/test/features/1.2.exp b/test/features/1.2.exp index 0b92247f1..623957f5f 100755 --- a/test/features/1.2.exp +++ b/test/features/1.2.exp @@ -36,10 +36,10 @@ expect { timeout {puts "TESTING ERROR 1.4\n";exit} "proc /proc/sysrq-trigger proc" } -expect { - timeout {puts "TESTING ERROR 1.5\n";exit} - "proc /proc/sys/kernel/hotplug" -} +#expect { +# timeout {puts "TESTING ERROR 1.5\n";exit} +# "proc /proc/sys/kernel/hotplug" +#} expect { timeout {puts "TESTING ERROR 1.6\n";exit} "proc /proc/irq proc" @@ -69,10 +69,10 @@ if { $overlay == "overlay" } { timeout {puts "TESTING ERROR 3.1\n";exit} "proc /proc proc" } - expect { - timeout {puts "TESTING ERROR 3.2\n";exit} - "proc /proc proc" - } +# expect { +# timeout {puts "TESTING ERROR 3.2\n";exit} +# "proc /proc proc" +# } expect { timeout {puts "TESTING ERROR 3.3\n";exit} "proc /proc/sys proc" @@ -81,10 +81,10 @@ if { $overlay == "overlay" } { timeout {puts "TESTING ERROR 3.4\n";exit} "proc /proc/sysrq-trigger proc" } - expect { - timeout {puts "TESTING ERROR 3.5\n";exit} - "proc /proc/sys/kernel/hotplug" - } +# expect { +# timeout {puts "TESTING ERROR 3.5\n";exit} +# "proc /proc/sys/kernel/hotplug" +# } expect { timeout {puts "TESTING ERROR 3.6\n";exit} "proc /proc/irq proc" diff --git a/test/features/test.sh b/test/features/test.sh index c3a4f21ae..d4bcead0b 100755 --- a/test/features/test.sh +++ b/test/features/test.sh @@ -1,6 +1,7 @@ #!/bin/bash OVERLAY="overlay" CHROOT="chroot" +NETWORK="network" while [ $# -gt 0 ]; do # Until you run out of parameters . . . case "$1" in @@ -10,8 +11,11 @@ while [ $# -gt 0 ]; do # Until you run out of parameters . . . --nochroot) CHROOT="none" ;; + --nonetwork) + NETWORK="none" + ;; --help) - echo "./test.sh [--nooverlay|--nochroot|--help] | grep TESTING" + echo "./test.sh [--nooverlay|--nochroot|--nonetwork|--help] | grep TESTING" exit ;; esac @@ -55,23 +59,26 @@ echo "TESTING: 1.10 disable /selinux" #################### # networking features #################### -echo "TESTING: 2.1 hostname" -./2.1.exp $OVERLAY $CHROOT +if [ $NETWORK == "network" ] +then + echo "TESTING: 2.1 hostname" + ./2.1.exp $OVERLAY $CHROOT -echo "TESTING: 2.2 DNS" -./2.2.exp $OVERLAY $CHROOT + echo "TESTING: 2.2 DNS" + ./2.2.exp $OVERLAY $CHROOT -echo "TESTING: 2.3 mac-vlan" -./2.3.exp $OVERLAY $CHROOT + echo "TESTING: 2.3 mac-vlan" + ./2.3.exp $OVERLAY $CHROOT -echo "TESTING: 2.4 bridge" -./2.4.exp $OVERLAY $CHROOT + echo "TESTING: 2.4 bridge" + ./2.4.exp $OVERLAY $CHROOT -echo "TESTING: 2.5 interface" -./2.5.exp $OVERLAY $CHROOT + echo "TESTING: 2.5 interface" + ./2.5.exp $OVERLAY $CHROOT -echo "TESTING: 2.6 Default gateway" -./2.6.exp $OVERLAY $CHROOT + echo "TESTING: 2.6 Default gateway" + ./2.6.exp $OVERLAY $CHROOT +fi #################### # filesystem features diff --git a/test/private-etc.exp b/test/private-etc.exp index 9df798e22..db1d1df3a 100755 --- a/test/private-etc.exp +++ b/test/private-etc.exp @@ -5,7 +5,7 @@ spawn $env(SHELL) match_max 100000 # directory with ~ -send -- "firejail --private-etc=passwd,group,resolv.conf,bash_completion.d,timezone\r" +send -- "firejail --private-etc=passwd,group,resolv.conf,X11\r" expect { timeout {puts "TESTING ERROR 1\n";exit} "Child process initialized" @@ -13,10 +13,6 @@ expect { sleep 1 send -- "ls -al /etc\r" -expect { - timeout {puts "TESTING ERROR 2\n";exit} - "bash_completion.d" -} expect { timeout {puts "TESTING ERROR 3\n";exit} "group" @@ -31,16 +27,16 @@ expect { } expect { timeout {puts "TESTING ERROR 6\n";exit} - "timezone" + "X11" } send -- "ls -al /etc\r" expect { timeout {puts "TESTING ERROR 7\n";exit} "shadow" {puts "TESTING ERROR 8\n";exit} - "timezone" + "X11" } sleep 1 -puts "\n" +puts "\nall done\n" diff --git a/test/profile_syntax.exp b/test/profile_syntax.exp index 3218177c3..5815bd619 100755 --- a/test/profile_syntax.exp +++ b/test/profile_syntax.exp @@ -11,17 +11,10 @@ expect { } sleep 2 -send -- "ls /sbin\r" -expect { - timeout {puts "TESTING ERROR 1\n";exit} - "cannot open" -} - -sleep 1 -send -- "ls /usr/sbin\r" +send -- "cat /sbin/iptables\r" expect { timeout {puts "TESTING ERROR 2\n";exit} - "cannot open" + "Permission denied" } sleep 1 diff --git a/test/test.profile b/test/test.profile index 716419fd0..1d69cc960 100644 --- a/test/test.profile +++ b/test/test.profile @@ -1,5 +1,4 @@ - blacklist /sbin -blacklist /usr/sbin + blacklist /sbin/iptables blacklist /etc/shadow blacklist /bin/rmdir blacklist ${PATH}/umount -- cgit v1.2.3-54-g00ecf