@@ -234,12 +234,14 @@ proc ::AlgorandGoal::RestartNode { TEST_ALGO_DIR {SYSTEMD_MANAGED ""} } {
234234 expect {
235235 timeout { close; ::AlgorandGoal::Abort "Did not receive appropriate message during node restart" }
236236 "^The node was successfully stopped.*Algorand node successfully started!*" {puts "Node restarted successfully"; close}
237+ eof { close; ::AlgorandGoal::Abort "Did not receive appropriate message before node restart eof" }
237238 }
238239 } else {
239240 spawn goal node restart -d $TEST_ALGO_DIR
240241 expect {
241242 timeout { close; ::AlgorandGoal::Abort "Did not receive appropriate message during node restart" }
242243 "^This node is using systemd and should be managed with systemctl*" { puts "Goal showed correct error message for systemd" ; close}
244+ eof { close; ::AlgorandGoal::Abort "Did not receive appropriate message before node restart eof" }
243245 }
244246 }
245247 } EXCEPTION] } {
@@ -333,22 +335,27 @@ proc ::AlgorandGoal::CreateWallet { WALLET_NAME WALLET_PASSWORD TEST_PRIMARY_NOD
333335
334336 expect {
335337 timeout {::AlgorandGoal::Abort "Timed out CreateWallet password" }
338+ eof {::AlgorandGoal::Abort "EOF CreateWallet password" }
336339 "Please choose a password for wallet*" { send "$WALLET_PASSWORD\r" }
337340 }
338341 expect {
339342 timeout {::AlgorandGoal::Abort "Timed out CreateWallet confirmation" }
343+ eof {::AlgorandGoal::Abort "EOF CreateWallet confirmation" }
340344 "Please confirm*" { send "$WALLET_PASSWORD\r"}
341345 }
342346 expect {
343347 timeout {::AlgorandGoal::Abort "Timed out CreateWallet see it now" }
348+ eof {::AlgorandGoal::Abort "EOF CreateWallet see it now" }
344349 "Would you like to see it now? (Y/n):" { send "y\r" }
345350 }
346351 expect {
347352 timeout {::AlgorandGoal::Abort "Timed out CreateWallet keep info safe" }
353+ eof {::AlgorandGoal::Abort "EOF CreateWallet keep info safe" }
348354 "Keep this information safe -- never share it with anyone!" {}
349355 }
350356 expect {
351357 timeout {::AlgorandGoal::Abort "Timed out CreateWallet pass phrase" }
358+ eof {::AlgorandGoal::Abort "EOF CreateWallet pass phrase" }
352359 -re {([a-z ]+)} {set WALLET_PASS_PHRASE $expect_out(1,string); close;}
353360 }
354361 } EXCEPTION ] } {
@@ -364,6 +371,7 @@ proc ::AlgorandGoal::VerifyWallet { WALLET_NAME TEST_PRIMARY_NODE_DIR } {
364371 spawn goal wallet list -d $TEST_PRIMARY_NODE_DIR
365372 expect {
366373 timeout { ::AlgorandGoal::Abort "Timed out seeing expected input for spawn goal wallet list" }
374+ eof { ::AlgorandGoal::Abort "EOF seeing expected input for spawn goal wallet list" }
367375 "*$WALLET_NAME*" {close}
368376 }
369377 } EXCEPTION ] } {
@@ -376,12 +384,14 @@ proc ::AlgorandGoal::RecoverWallet { NEW_WALLET_NAME WALLET_PASSPHRASE NEW_WALLE
376384 if { [catch {
377385 spawn goal wallet new -r $NEW_WALLET_NAME -d $TEST_PRIMARY_NODE_DIR
378386 expect {
379- timeout { puts "TIMEOUT" }
387+ timeout { ::AlgorandGoal::Abort "TIMEOUT" }
388+ eof { ::AlgorandGoal::Abort "EOF" }
380389 {Please type your recovery mnemonic below, and hit return when you are done:*} { send "$WALLET_PASSPHRASE\r" }
381390 }
382391 for { set index 1} {$index <= 5} {incr index} {
383392 expect {
384- timeout { puts "TIMEOUT" }
393+ timeout { ::AlgorandGoal::Abort "TIMEOUT" }
394+ eof { ::AlgorandGoal::Abort "EOF" }
385395 {Please choose a password for wallet* } { send "$NEW_WALLET_PASSWORD\r"}
386396 {Please confirm the password:*} { send "$NEW_WALLET_PASSWORD\r"}
387397 {Creating wallet...*} {puts $expect_out(buffer) }
@@ -403,6 +413,7 @@ proc ::AlgorandGoal::CreateAccountForWallet { WALLET_NAME WALLET_PASSWORD TEST_P
403413 while 1 {
404414 expect {
405415 timeout { break; ::AlgorandGoal::Abort "Timed out seeing new account created for wallet $WALLET_NAME" }
416+ eof { break; ::AlgorandGoal::Abort "EOF seeing new account created for wallet $WALLET_NAME" }
406417 "Please enter the password for wallet*" { send "$WALLET_PASSWORD\r" }
407418 -re {Created new account with address ([a-zA-Z0-9]+)} {set ACCOUNT_ADDRESS $expect_out(1,string) ;close; break }
408419 }
@@ -422,6 +433,7 @@ proc ::AlgorandGoal::VerifyAccount { WALLET_NAME WALLET_PASSWORD ACCOUNT_ADDRESS
422433 while 1 {
423434 expect {
424435 timeout {break; ::AlgorandGoal::Abort "Timed out seeing expected account: $ACCOUNT_ADDRESS"}
436+ eof {break; ::AlgorandGoal::Abort "EOF seeing expected account: $ACCOUNT_ADDRESS"}
425437 "Please enter the password for wallet*" { send "$WALLET_PASSWORD\r" }
426438 -re {\t([A-Z0-9]+)\t([A-Z0-9]+)} {set RETURN_ACCOUNT_ADDRESS $expect_out(1,string); break }
427439 }
@@ -487,6 +499,7 @@ proc ::AlgorandGoal::GetAccountRewards { WALLET_NAME ACCOUNT_ADDRESS TEST_PRIMAR
487499 spawn goal account rewards -w $WALLET_NAME -a $ACCOUNT_ADDRESS -d $TEST_PRIMARY_NODE_DIR
488500 expect {
489501 timeout { ::AlgorandGoal::Abort "Timed out retrieving account rewards for wallet $WALLET_NAME and account $ACCOUNT_ADDRESS" }
502+ eof { ::AlgorandGoal::Abort "EOF retrieving account rewards for wallet $WALLET_NAME and account $ACCOUNT_ADDRESS" }
490503 -re {\d+} {set ACCOUNT_EARNINGS $expect_out(0,string)}
491504 }
492505 puts "Wallet: $WALLET_NAME, Account: $ACCOUNT_ADDRESS, Rewards: $ACCOUNT_EARNINGS"
@@ -667,6 +680,7 @@ proc ::AlgorandGoal::LimitOrder {TEAL_DRIVER SWAP_N SWAP_D MIN_TRD OWNER FEE TIM
667680 spawn python $TEAL_DRIVER "limit-order" --swapn $SWAP_N --swapd $SWAP_D --mintrd $MIN_TRD --own $OWNER --fee $FEE --timeout $TIME_OUT --asset $ASSET_ID
668681 expect {
669682 timeout { ::AlgorandGoal::Abort "Timed out limit order" }
683+ eof { ::AlgorandGoal::Abort "EOF limit order" }
670684 -re {^.+$} { puts $limitf $expect_out(buffer); close $limitf; close }
671685 }
672686 } EXCEPTION ] } {
@@ -741,6 +755,7 @@ proc ::AlgorandGoal::RawSend { TXN_FILE TEST_PRIMARY_NODE_DIR } {
741755 spawn goal clerk rawsend -f $TXN_FILE -d $TEST_PRIMARY_NODE_DIR
742756 expect {
743757 timeout { close; ::AlgorandGoal::Abort "Timed out rawsend $TXN_FILE" }
758+ eof { close; ::AlgorandGoal::Abort "EOF rawsend $TXN_FILE" }
744759 -re {Transaction ([A-Z0-9]{52}) committed} {set TRANSACTION_ID $expect_out(1,string); close }
745760 -re {Rejected transactions written to (.+rej)} {::AlgorandGoal::Abort "RawSend rejected."}
746761 }
@@ -809,6 +824,7 @@ proc ::AlgorandGoal::CheckNetworkAddressForCors { NET_ADDRESS } {
809824 spawn curl -X OPTIONS -H "Origin: http://algorand.com" --head $NET_ADDRESS
810825 expect {
811826 timeout { close; ::AlgorandGoal::Abort "Timeout failure in CheckNetworkAddressForCors" }
827+ eof { close; ::AlgorandGoal::Abort "EOF in CheckNetworkAddressForCors" }
812828 "Access-Control-Allow-Origin" { puts "success" ; close }
813829 eof {
814830 return -code error "EOF without Access-Control-Allow-Origin in output"
@@ -826,6 +842,7 @@ proc ::AlgorandGoal::GetLedgerSupply { TEST_PRIMARY_NODE_DIR } {
826842 spawn goal ledger supply -d $TEST_PRIMARY_NODE_DIR
827843 expect {
828844 timeout { ::AlgorandGoal::Abort "Get Ledger Supply timed out" }
845+ eof { ::AlgorandGoal::Abort "Get Ledger Supply EOF" }
829846 -re {Round: (\d+)} {set ROUND $expect_out(1,string); exp_continue }
830847 -re {Total Money: (\d+)} {set TOTAL_MONEY $expect_out(1,string); exp_continue }
831848 -re {Online Money: (\d+)} {set ONLINE_MONEY $expect_out(1,string) }
@@ -844,6 +861,7 @@ proc ::AlgorandGoal::CreateOneOfTwoMultisigForWallet { ADDRESS_1 ADDRESS_2 WALLE
844861 spawn goal account multisig new $ADDRESS_1 $ADDRESS_2 -T 1 -d $TEST_PRIMARY_NODE_DIR -w $WALLET_NAME
845862 expect {
846863 timeout { ::AlgorandGoal::Abort "Timed out creating a multisig account from $ADDRESS_1 and $ADDRESS_2" }
864+ eof { ::AlgorandGoal::Abort "EOF creating a multisig account from $ADDRESS_1 and $ADDRESS_2" }
847865 "Please enter the password for wallet*" { send "$WALLET_PASSWORD\r" }
848866 -re {Created new account with address ([a-zA-Z0-9]+)} {
849867 set MULTISIG_ADDRESS $expect_out(1,string);
@@ -862,6 +880,7 @@ proc ::AlgorandGoal::VerifyMultisigInfoForOneOfTwoMultisig { MULTISIG_ADDRESS AD
862880 spawn goal account multisig info --address $MULTISIG_ADDRESS -d $TEST_PRIMARY_NODE_DIR -w $WALLET_NAME
863881 expect {
864882 timeout { ::AlgorandGoal::Abort "Timed out querying info about multisig account $MULTISIG_ADDRESS" }
883+ eof { ::AlgorandGoal::Abort "EOF querying info about multisig account $MULTISIG_ADDRESS" }
865884 -re {Version: (\d+)\s+Threshold: (\d+)\s+Public keys:\s+([a-zA-Z0-9]+)\s+([a-zA-Z0-9]+)\s+} {
866885 set VERSION $expect_out(1,string);
867886 set THRESHOLD $expect_out(2,string);
@@ -882,7 +901,11 @@ proc ::AlgorandGoal::VerifyMultisigInfoForOneOfTwoMultisig { MULTISIG_ADDRESS AD
882901proc ::AlgorandGoal::DeleteMultisigAccount { MULTISIG_ADDRESS TEST_PRIMARY_NODE_DIR } {
883902 if { [ catch {
884903 spawn goal account multisig delete --address $MULTISIG_ADDRESS -d $TEST_PRIMARY_NODE_DIR
885- expect {*}
904+ expect eof
905+ set status [wait]
906+ if {$status != 0} {
907+ ::AlgorandGoal::Abort "DeleteMultisigAccount failed with exit code $status"
908+ }
886909 } EXCEPTION ] } {
887910 ::AlgorandGoal::Abort "ERROR in DeleteMultisigAccount: $EXCEPTION"
888911 }
@@ -1049,6 +1072,7 @@ proc ::AlgorandGoal::Report { TEST_PRIMARY_NODE_DIR } {
10491072 spawn goal report -d $TEST_PRIMARY_NODE_DIR
10501073 expect {
10511074 timeout { ::AlgorandGoal::Abort "goal report timed out" }
1075+ eof { ::AlgorandGoal::Abort "goal report EOF" }
10521076 "source code available at https://github.com/algorand/go-algorand" {puts "goal -v ok"}
10531077 -re {Genesis ID from genesis.json: *} {puts "genesis ID from genesis.json ok"}
10541078 -re {Last committed block: (\d+)} {puts "status check ok"}
0 commit comments