testcommands.exp 709 B

12345678910111213141516171819202122232425262728293031
  1. set timeout 30
  2. set test_name "testcommands"
  3. if {![info exists env(QUAGGA_TEST_COMMANDS)]} {
  4. # sadly, the test randomly fails when configure parameters differ from
  5. # what was used to create testcommands.refout. this can be fixed by
  6. # shipping a matching vtysh_cmd.c, which we'll add after 0.99.23
  7. unresolved "$test_name"
  8. exit 0
  9. }
  10. spawn sh -c "./testcommands -e 0 < $env(srcdir)/testcommands.in | diff -au - $env(srcdir)/testcommands.refout"
  11. expect {
  12. eof {
  13. }
  14. timeout {
  15. exp_close
  16. fail "$test_name: timeout"
  17. }
  18. }
  19. catch wait result
  20. set os_error [lindex $result 2]
  21. set exit_status [lindex $result 3]
  22. if { $os_error == 0 && $exit_status == 0 } {
  23. pass "$test_name"
  24. } else {
  25. fail "$test_name"
  26. }