firejail/test/network/interface.exp
2022-01-07 12:23:47 -05:00

63 lines
1.2 KiB
Text
Executable file

#!/usr/bin/expect -f
# This file is part of Firejail project
# Copyright (C) 2014-2022 Firejail Authors
# License GPL v2
#
# interface
#
set timeout 10
spawn $env(SHELL)
match_max 100000
set overlay [lindex $argv 0]
set chroot [lindex $argv 1]
#
# N
#
# todo: seems to be unable to find interface eth0.7
#send -- "firejail --noprofile --interface=eth0.5 --interface=eth0.6 --interface=eth0.7\r"
send -- "firejail --noprofile --interface=eth0.5 --interface=eth0.6\r"
expect {
timeout {puts "TESTING ERROR 0\n";exit}
"Child process initialized"
}
sleep 1
send -- "/sbin/ifconfig\r"
expect {
timeout {puts "TESTING ERROR 1\n";exit}
"eth0.5"
}
expect {
timeout {puts "TESTING ERROR 2\n";exit}
"Link" {puts "old net-tools\n";}
"flags" {puts "new net-tools\n";}
}
expect {
timeout {puts "TESTING ERROR 3\n";exit}
"10.10.205.10"
}
after 100
send -- "/sbin/ifconfig\r"
expect {
timeout {puts "TESTING ERROR 5\n";exit}
"eth0.6"
}
expect {
timeout {puts "TESTING ERROR 6\n";exit}
"Link" {puts "old net-tools\n";}
"flags" {puts "new net-tools\n";}
}
expect {
timeout {puts "TESTING ERROR 7\n";exit}
"10.10.206.10"
}
after 100
send -- "exit\r"
sleep 1
puts "\nall done\n"