From fc116c063938d5e141d5fbc38e8013d9832ef315 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 15 Sep 2016 09:59:11 -0400 Subject: testing --- test/root/net_interface.exp | 93 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100755 test/root/net_interface.exp (limited to 'test/root/net_interface.exp') diff --git a/test/root/net_interface.exp b/test/root/net_interface.exp new file mode 100755 index 000000000..2f87024d8 --- /dev/null +++ b/test/root/net_interface.exp @@ -0,0 +1,93 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2016 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "ip link add link eth0 name eth0.100 type vlan id 100\r" +sleep 1 +send -- "ip link add link eth0 name eth0.101 type vlan id 101\r" +sleep 1 +send -- "ip link add link eth0 name eth0.102 type vlan id 102\r" +sleep 1 +send -- "ip link add link eth0 name eth0.103 type vlan id 103\r" +sleep 1 +send -- "ip link add link eth0 name eth0.104 type vlan id 104\r" +sleep 1 +puts "\n" + +send -- "/sbin/ifconfig eth0.100 10.200.0.1/24\r" +sleep 1 +send -- "/sbin/ifconfig eth0.101 10.200.1.1/24\r" +sleep 1 +send -- "/sbin/ifconfig eth0.102 10.200.2.1/24\r" +sleep 1 +send -- "/sbin/ifconfig eth0.103 10.200.3.1/24\r" +sleep 1 +send -- "/sbin/ifconfig eth0.104 10.200.4.1/24\r" +sleep 1 +puts "\n" + + + +send -- "firejail --noprofile --interface=eth0.100 --interface=eth0.101 --interface=eth0.102 --interface=eth0.103 --interface=eth0.104\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "maximum 4 interfaces are allowed" +} +sleep 1 + +send -- "firejail --noprofile --interface=eth0.100 --interface=eth0.101 --interface=eth0.102 --interface=eth0.103\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "eth0.100" +} +expect { + timeout {puts "TESTING ERROR 1.1\n";exit} + "UP" +} +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "eth0.101" +} +expect { + timeout {puts "TESTING ERROR 2.2\n";exit} + "UP" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "eth0.102" +} +expect { + timeout {puts "TESTING ERROR 3.1\n";exit} + "UP" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "eth0.103" +} +expect { + timeout {puts "TESTING ERROR 4.1\n";exit} + "UP" +} +sleep 1 +send -- "exit\r" +sleep 1 + +send -- "firejail --noprofile --interface=eth0.104\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "eth0.104" +} +expect { + timeout {puts "TESTING ERROR 5.1\n";exit} + "UP" +} +send -- "exit\r" +after 100 + +puts "all done\n" + -- cgit v1.2.3-70-g09d2