From 6d39f22968c7cf2a51cb162664589770c84aac69 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 18 Oct 2015 11:07:49 -0400 Subject: testing --- test/hostname.exp | 25 +++++++++++++++++++++++++ test/name.exp | 25 ------------------------- test/net_mtu.exp | 30 ++++++++++++++++++++++++++++++ test/noroot.exp | 7 ------- test/option-join.exp | 6 +----- test/quiet.exp | 17 +++++++++++++++++ test/test.sh | 12 +++++++++--- 7 files changed, 82 insertions(+), 40 deletions(-) create mode 100755 test/hostname.exp delete mode 100755 test/name.exp create mode 100755 test/net_mtu.exp create mode 100755 test/quiet.exp (limited to 'test') diff --git a/test/hostname.exp b/test/hostname.exp new file mode 100755 index 000000000..42f78dd12 --- /dev/null +++ b/test/hostname.exp @@ -0,0 +1,25 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --name=baluba --noprofile\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ping -c 3 baluba;pwd\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "3 packets transmitted, 3 received" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "home" +} +sleep 1 + +puts "all done\n" diff --git a/test/name.exp b/test/name.exp deleted file mode 100755 index 42f78dd12..000000000 --- a/test/name.exp +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/expect -f - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --name=baluba --noprofile\r" -expect { - timeout {puts "TESTING ERROR 1\n";exit} - "Child process initialized" -} -sleep 1 - -send -- "ping -c 3 baluba;pwd\r" -expect { - timeout {puts "TESTING ERROR 2\n";exit} - "3 packets transmitted, 3 received" -} -expect { - timeout {puts "TESTING ERROR 3\n";exit} - "home" -} -sleep 1 - -puts "all done\n" diff --git a/test/net_mtu.exp b/test/net_mtu.exp new file mode 100755 index 000000000..2940241c1 --- /dev/null +++ b/test/net_mtu.exp @@ -0,0 +1,30 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +# check ip address +send -- "firejail --net=br0 --mtu=1000\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ip link show\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "eth0" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "mtu 1000" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "state UP" +} + +puts "\nall done\n" + diff --git a/test/noroot.exp b/test/noroot.exp index d16c28dbe..37d55fe78 100755 --- a/test/noroot.exp +++ b/test/noroot.exp @@ -51,13 +51,6 @@ expect { } puts "\n" -send -- "cat /etc/hostname\r" -expect { - timeout {puts "TESTING ERROR 3\n";exit} - "noroot-sandbox" -} -puts "\n" - send -- "ping 0\r" expect { timeout {puts "TESTING ERROR 4\n";exit} diff --git a/test/option-join.exp b/test/option-join.exp index ad8ba73e0..6250e87a2 100755 --- a/test/option-join.exp +++ b/test/option-join.exp @@ -17,10 +17,6 @@ expect { timeout {puts "TESTING ERROR 1\n";exit} "Switching to pid" } -expect { - timeout {puts "TESTING ERROR 2 (join) \n";exit} - "@svntesting" -} sleep 1 @@ -40,4 +36,4 @@ expect { } sleep 1 -puts "\n" +puts "\nall done\n" diff --git a/test/quiet.exp b/test/quiet.exp new file mode 100755 index 000000000..fa46aebf2 --- /dev/null +++ b/test/quiet.exp @@ -0,0 +1,17 @@ +#!/usr/bin/expect -f + +set timeout 4 +spawn $env(SHELL) +match_max 100000 + +# check ip address +send -- "firejail --net=br0 --quiet\r" +expect { + "Child process initialized" {puts "TESTING ERROR 1\n";exit} + "Interface" {puts "TESTING ERROR 1\n";exit} +} +sleep 1 +send -- "\r" + +puts "\nall done\n" + diff --git a/test/test.sh b/test/test.sh index 80aa7f3e8..7d43a5786 100755 --- a/test/test.sh +++ b/test/test.sh @@ -125,9 +125,6 @@ ls -al > tmpreadonly sleep 5 rm -f tmpreadonly -echo "TESTING: name" -./name.exp - echo "TESTING: zsh" ./shell_zsh.exp @@ -354,6 +351,9 @@ echo "TESTING: read/write /var/lock" echo "TESTING: read/write /dev/shm" ./fs_dev_shm.exp +echo "TESTING: quiet" +./quiet.exp + echo "TESTING: local network" ./net_local.exp @@ -366,6 +366,12 @@ echo "TESTING: network IP" echo "TESTING: network MAC" ./net_mac.exp +echo "TESTING: network MTU" +./net_mtu.exp + +echo "TESTING: network hostname" +./hostname.exp + echo "TESTING: network bad IP" ./net_badip.exp -- cgit v1.2.3-70-g09d2