No Description
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 1012B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. variable VM_IFNAME "[lindex $argv 3]"
  9. variable VM_IPV4 "[lindex $argv 4]"
  10. variable VM_IPV6 "[lindex $argv 5]"
  11. set where [file dirname [info script]]
  12. source [file join $where testlib.expect]
  13. proc VZ5::destroy {} {
  14. system virsh destroy $::VMNAME
  15. send_log "ERROR EXIT DESTROY\n"
  16. system reset
  17. exit 1
  18. }
  19. proc VZ5::abort {} {
  20. set timeout 5
  21. send_log "\nERROR ABORT\n"
  22. send "\r"
  23. expect "root@test:~#" {} timeout VZ5::destroy
  24. send "shutdown -h now\r"
  25. expect eof {} timeout VZ5::destroy
  26. send_log "ERROR EXIT"
  27. system reset
  28. exit 1
  29. }
  30. spawn virsh start --console $VMNAME
  31. login
  32. test_base
  33. test_kernel_version $::VZ5::KVER
  34. test_swap
  35. test_ssh
  36. test_netconfig_ipv4 "$VM_IFNAME" "$VM_IPV4"
  37. test_netconfig_ipv6 "$VM_IFNAME" "$VM_IPV6"
  38. test_ping
  39. test_vda_rw
  40. test_apt
  41. test_reboot
  42. test_virsh_reboot
  43. shutdown
  44. exit 0