#!/usr/bin/expect5.31 -f --

# kliensoldali expect script plug adatatvitel tesztelesehez


set timeout 10
set i 1
set f 0
global env

exp_version -exit 5.0


spawn nc -o ered $env(FW_NAME) $env(FW_LISTEN_PORT)
send "hello\n"
expect "hello" {
send_user " hello_received_from_Server\n"
}
for {set i 1} { $i < $env(MAX_MESSAGES_PLUG_NORM_TEST) } {incr i} {
    expect "msg.$i" {
	send_user "message_.$i._received\n" 
	set f 1
    }
    if {$f!=1} {
	send_user "message_.$i._NOT_received"
	set f 0
    }
}
expect timeout {
send_user "no_Data_from_Server\n"
}

