From 91235785e06ac890514fd51fa44aa14e7c2e108e Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 2 Mar 2023 08:19:41 -0500 Subject: network testing --- test/network/net_none.exp | 52 +++++++++-------------------------------------- 1 file changed, 10 insertions(+), 42 deletions(-) (limited to 'test/network/net_none.exp') diff --git a/test/network/net_none.exp b/test/network/net_none.exp index aa071862e..6932c7e8a 100755 --- a/test/network/net_none.exp +++ b/test/network/net_none.exp @@ -11,63 +11,31 @@ match_max 100000 send -- "firejail --net=none\r" expect { timeout {puts "TESTING ERROR 0\n";exit} - "eth0" {puts "TESTING ERROR 0.1\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } -sleep 1 +after 500 -# test default gw -send -- "bash\r" -sleep 1 -send -- "stty -echo\r" -after 100 - -send -- "netstat -rn; echo done\r" +send -- "cat /proc/1/net/dev | wc -l\r" expect { timeout {puts "TESTING ERROR 1\n";exit} - "0.0.0.0" {puts "TESTING ERROR 1.1\n";exit} - "done" + "3" } -sleep 1 - -# check again devices -send -- "cat /proc/1/net/dev;echo done\r" -expect { - timeout {puts "TESTING ERROR 2\n";exit} - "eth0" {puts "TESTING ERROR 2.1\n";exit} - "done" -} -send -- "exit\r" -sleep 1 send -- "exit\r" -sleep 1 +after 500 + # profile send -- "firejail --profile=net_none.profile\r" expect { - timeout {puts "TESTING ERROR 3\n";exit} - "eth0" {puts "TESTING ERROR 3.1\n";exit} + timeout {puts "TESTING ERROR 2\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } -sleep 1 +after 500 -# test default gw -send -- "bash\r" -sleep 1 -send -- "netstat -rn; echo done\r" +send -- "cat /proc/1/net/dev | wc -l\r" expect { - timeout {puts "TESTING ERROR 4\n";exit} - "0.0.0.0" {puts "TESTING ERROR 4.1\n";exit} - "done" -} -sleep 1 - -# check again devices -send -- "cat /proc/1/net/dev;echo done\r" -expect { - timeout {puts "TESTING ERROR 5\n";exit} - "eth0" {puts "TESTING ERROR 5.1\n";exit} - "done" + timeout {puts "TESTING ERROR 3\n";exit} + "3" } send -- "exit\r" after 100 -- cgit v1.2.3-54-g00ecf