Няма описание
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_libvirt.expect 833B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/expect -f
  2. log_file -noappend "/tmp/test_libvirt_expect.log"
  3. namespace eval VZ5 {
  4. variable HOSTNAME "[lindex $argv 0]"
  5. variable KVER "[lindex $argv 1]"
  6. }
  7. variable VMNAME "[lindex $argv 2]"
  8. set where [file dirname [info script]]
  9. source [file join $where testlib.expect]
  10. proc VZ5::destroy {} {
  11. system virsh destroy $::VMNAME
  12. send_log "ERROR EXIT DESTROY\n"
  13. system reset
  14. exit 1
  15. }
  16. proc VZ5::abort {} {
  17. set timeout 5
  18. send_log "\nERROR ABORT\n"
  19. send "\r"
  20. expect "root@test:~#" {} timeout VZ5::destroy
  21. send "shutdown -h now\r"
  22. expect eof {} timeout VZ5::destroy
  23. send_log "ERROR EXIT"
  24. system reset
  25. exit 1
  26. }
  27. spawn virsh start --console $VMNAME
  28. login
  29. test_base
  30. test_kernel_version $::VZ5::KVER
  31. test_swap
  32. test_ssh
  33. test_vz5_netconfig
  34. test_ping
  35. test_vda_rw
  36. test_apt
  37. test_reboot
  38. test_virsh_reboot
  39. shutdown
  40. exit 0