75 lines
1.1 KiB
Plaintext
Executable File
75 lines
1.1 KiB
Plaintext
Executable File
#!/usr/bin/env expect
|
|
set timeout 30
|
|
set tty [lindex $argv 0]
|
|
log_file expect_output.log
|
|
exp_internal 0
|
|
spawn screen $tty
|
|
|
|
send "\n"
|
|
expect {
|
|
timeout {exit 2}
|
|
-re "compat>"
|
|
}
|
|
|
|
send "net tcp\n"
|
|
expect {
|
|
timeout {exit 3}
|
|
-re "(?s)mn_socket\\(TCP\\) = 0.*compat>"
|
|
}
|
|
|
|
send "net connect\n"
|
|
expect {
|
|
timeout {exit 4}
|
|
-re "(?s)net_test_writable 0 - 0.*"
|
|
}
|
|
|
|
foreach {cmd code} {
|
|
"wolfssl connect" 11
|
|
"wolfssl write" 12
|
|
"wolfssl read" 13
|
|
} {
|
|
send "$cmd\n"
|
|
expect {
|
|
timeout {exit $code}
|
|
-re "(?s)ERROR: run \"wolfssl init\" first.*compat>"
|
|
}
|
|
}
|
|
|
|
send "wolfssl init\n"
|
|
expect {
|
|
timeout {exit 5}
|
|
-re "compat>"
|
|
}
|
|
|
|
send "wolfssl connect\n"
|
|
expect {
|
|
timeout {exit 6}
|
|
-re "(?s)wolfSSL_connect\\(\\) = 1.*compat>"
|
|
}
|
|
|
|
send "wolfssl write\n"
|
|
expect {
|
|
timeout {exit 7}
|
|
-re "(?s)wolfSSL_write\\(\\) = \\d+L.*compat>"
|
|
}
|
|
|
|
send "wolfssl read\n"
|
|
expect {
|
|
timeout {exit 8}
|
|
-re "compat>"
|
|
}
|
|
|
|
send "wolfssl clear\n"
|
|
expect {
|
|
timeout {exit 9}
|
|
-re "compat>"
|
|
}
|
|
|
|
send "net close\n"
|
|
expect {
|
|
timeout {exit 10}
|
|
-re "(?s)mn_close\\(\\) = 0.*compat>"
|
|
}
|
|
|
|
exit 0
|