diff options
Diffstat (limited to 'meta/lib/oeqa/runtime/files/wifi_hidden_connect.exp')
-rwxr-xr-x | meta/lib/oeqa/runtime/files/wifi_hidden_connect.exp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/files/wifi_hidden_connect.exp b/meta/lib/oeqa/runtime/files/wifi_hidden_connect.exp new file mode 100755 index 00000000000..0e0f45f8ce1 --- /dev/null +++ b/meta/lib/oeqa/runtime/files/wifi_hidden_connect.exp @@ -0,0 +1,47 @@ +#!/usr/bin/expect +set timeout 100 +set login 0 +set ip [lindex $argv 0] +set cmd [lindex $argv 1] +set service [lindex $argv 2] +set ssid [lindex $argv 3] +set password [lindex $argv 4] + +spawn ssh root@$ip -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR "$cmd" + expect { + "Agent registered" + { + sleep 1; send "connect $service\n"; exp_continue + } + "Operation timeout" + { + sleep 1; send "connect $service\n"; exp_continue + } + "Input/output error" + { + sleep 1; send "connect $service\n"; exp_continue + } + "Hidden SSID name?" + { + sleep 1; send "$ssid\n"; exp_continue + } + "Retry (yes/no)?" + { + sleep 1; send "yes\n"; exp_continue + } + "Passphrase?" + { + sleep 1; send "$password\n"; exp_continue + } + "Connected wifi*" + { + send "exit\n"; exit 2 + } + "connmanctl*" + { + if {$login==0} {set login 1;send "agent on\n"; exp_continue} else {exp_continue} + } + eof + {} + } + |