eeasy_run.expect 854 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/expect
  2. set TIMEOUT 20
  3. set SLEEP_DURATION 0.5
  4. set hostname "192.168.1.16"
  5. set username "root"
  6. set password "123456asj"
  7. exec rm -f output.txt
  8. set OUTPUT_FILE "output.txt"
  9. log_file -a $OUTPUT_FILE
  10. proc make {} {
  11. spawn make clean
  12. expect "clean completed"
  13. spawn make -j24
  14. expect "make completed"
  15. spawn make test -j24
  16. expect "test completed"
  17. }
  18. proc board {} {
  19. global hostname username password
  20. spawn telnet $hostname
  21. expect "login: "
  22. send "$username\r"
  23. expect "Password: "
  24. send "$password\r"
  25. expect "# "
  26. send "umount -l /share \r"
  27. expect "# "
  28. send "mount -o nolock 192.168.1.234:/data/eeasy/asj_v3 /share\r"
  29. expect "# "
  30. send "cd /share\r"
  31. expect "# "
  32. send "sh run.sh\r"
  33. expect "# "
  34. send "exit\n"
  35. expect eof
  36. }
  37. make
  38. board
  39. log_file
  40. # exec code output.txt