1
0
liminix/tests/pppoe/getaddress.expect
Daniel Barlow 6649ebeccd firewall: use watch-outputs to track changes in zone->interface map
includes a horrible hack to work around (claimed (by me)) deficiencies
in the nftables parser
2025-02-28 00:43:20 +00:00

37 lines
939 B
Plaintext

set timeout 60
spawn socat unix-connect:vm/console -
expect "s6-linux-init"
send "\r\n"
expect "#"
send "PS1=\$(echo 'I1JFQURZIyA=' | base64 -d); stty -echo\n"
expect "#READY#"
set FINISHED 0
set EXIT "1"
while { $FINISHED < 10 } {
send "ip address show dev ppp0 | grep ppp0\n"
expect {
"192.168.100.1" { set FINISHED 20; set EXIT 0; }
"can't find device" { send_user "waiting ..." ; sleep 3 }
"DOWN" { send_user "waiting ..." ; sleep 3 }
}
set FINISHED [ expr $FINISHED + 1 ]
}
expect "#READY#"
send "nft list set ip table-ip wan || touch /non/existent\n"
expect {
"ppp0" { puts "ppp0 found " }
"{ }" { puts "missing ifname"; exit 1 }
"No such file or directory" { exit 1 }
}
expect "#READY#"
send "nft list set ip table-ip lan || touch /non/existent\n"
expect {
"lan" { puts "lan found" }
"{ }" { puts "missing ifname"; exit 1 }
"No such file or directory" { exit 1 }
}
expect "#READY#"
exit $EXIT