From 5035659fe3533972d79055d8ab828b0ea24d51ba Mon Sep 17 00:00:00 2001 From: netblue30 Date: Mon, 23 Nov 2015 08:47:25 -0500 Subject: feature testing --- test/configure | 6 +++ test/features/2.5.exp | 104 +++++++++++++++++++++++++++++++++++++++++++++ test/features/features.txt | 4 +- test/features/test.sh | 6 ++- 4 files changed, 118 insertions(+), 2 deletions(-) create mode 100755 test/features/2.5.exp (limited to 'test') diff --git a/test/configure b/test/configure index 1dd80ee9a..2827582f3 100755 --- a/test/configure +++ b/test/configure @@ -15,6 +15,12 @@ brctl addbr br3 ifconfig br3 10.10.50.1/24 up brctl addbr br4 ifconfig br4 10.10.60.1/24 up +ip link add link eth0 name eth0.5 type vlan id 5 +/sbin/ifconfig eth0.5 10.10.205.10/24 up +ip link add link eth0 name eth0.6 type vlan id 6 +/sbin/ifconfig eth0.6 10.10.206.10/24 up +ip link add link eth0 name eth0.7 type vlan id 7 +/sbin/ifconfig eth0.7 10.10.207.10/24 up # build a very small chroot diff --git a/test/features/2.5.exp b/test/features/2.5.exp new file mode 100755 index 000000000..4ba1f5a28 --- /dev/null +++ b/test/features/2.5.exp @@ -0,0 +1,104 @@ +#!/usr/bin/expect -f +# +# interface +# + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +# +# N +# +send -- "firejail --noprofile --interface=eth0.5\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "/sbin/ifconfig\r" +expect { + timeout {puts "TESTING ERROR 1.4\n";exit} + "eth0.5" +} +expect { + timeout {puts "TESTING ERROR 1.5n";exit} + "Link" +} +expect { + timeout {puts "TESTING ERROR 1.6\n";exit} + "10.10.205.10" +} +expect { + timeout {puts "TESTING ERROR 1.7\n";exit} + "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" +} +after 100 +send -- "exit\r" +sleep 1 + +# +# O +# +send -- "firejail --noprofile --overlay --interface=eth0.6\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "/sbin/ifconfig\r" +expect { + timeout {puts "TESTING ERROR 3.4\n";exit} + "eth0.6" +} +expect { + timeout {puts "TESTING ERROR 3.5n";exit} + "Link" +} +expect { + timeout {puts "TESTING ERROR 3.6\n";exit} + "10.10.206.10" +} +expect { + timeout {puts "TESTING ERROR 3.7\n";exit} + "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" +} +after 100 +send -- "exit\r" +sleep 1 + +# +# C +# +send -- "firejail --noprofile --chroot=/tmp/chroot --interface=eth0.7\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "/sbin/ifconfig\r" +expect { + timeout {puts "TESTING ERROR 5.4\n";exit} + "eth0.7" +} +expect { + timeout {puts "TESTING ERROR 5.5n";exit} + "Link" +} +expect { + timeout {puts "TESTING ERROR 5.6\n";exit} + "10.10.207.10" +} +expect { + timeout {puts "TESTING ERROR 5.7\n";exit} + "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" +} +after 100 +send -- "exit\r" +sleep 1 + + +puts "\nall done\n" diff --git a/test/features/features.txt b/test/features/features.txt index 62f4d8adc..9ac7b944e 100644 --- a/test/features/features.txt +++ b/test/features/features.txt @@ -59,7 +59,9 @@ C - chroot filesystem - ping disabled for C by default seccomp filter - transfer test not implemented for C - test --ip: N, O, C -2.5 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn) +2.5 interface + +2.6 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn) - N, O, C diff --git a/test/features/test.sh b/test/features/test.sh index 42b59f383..8047bbd0c 100755 --- a/test/features/test.sh +++ b/test/features/test.sh @@ -4,6 +4,7 @@ # Feature testing # +# Default features echo "TESTING: 1.1 disable /boot" ./1.1.exp @@ -28,7 +29,7 @@ echo "TESTING: 1.8 disable /etc/firejail and ~/.config/firejail" echo "TESTING: 1.10 disable /selinux" ./1.10.exp - +# networking features echo "TESTING: 2.1 hostname" ./2.1.exp @@ -40,3 +41,6 @@ echo "TESTING: 2.3 mac-vlan" echo "TESTING: 2.4 bridge" ./2.4.exp + +echo "TESTING: 2.5 interface" +./2.5.exp -- cgit v1.2.3-54-g00ecf