1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #!/usr/bin/expect -f
-
- log_file -noappend "/tmp/test_libvirt_expect.log"
- namespace eval VZ5 {
- variable HOSTNAME "[lindex $argv 0]"
- variable KVER "[lindex $argv 1]"
- }
- variable VMNAME "[lindex $argv 2]"
- variable VM_IFNAME "[lindex $argv 3]"
- variable VM_IPV4 "[lindex $argv 4]"
- variable VM_IPV6 "[lindex $argv 5]"
-
- set where [file dirname [info script]]
- source [file join $where testlib.expect]
-
-
- proc VZ5::destroy {} {
- system virsh destroy $::VMNAME
- send_log "ERROR EXIT DESTROY\n"
- system reset
- exit 1
- }
- proc VZ5::abort {} {
- set timeout 5
- send_log "\nERROR ABORT\n"
- send "\r"
- expect "root@test:~#" {} timeout VZ5::destroy
- send "shutdown -h now\r"
- expect eof {} timeout VZ5::destroy
- send_log "ERROR EXIT"
- system reset
- exit 1
- }
-
- spawn virsh start --console $VMNAME
-
- login
-
- test_base
- test_kernel_version $::VZ5::KVER
- test_swap
- test_ssh
- test_netconfig_ipv4 "$VM_IFNAME" "$VM_IPV4"
- test_netconfig_ipv6 "$VM_IFNAME" "$VM_IPV6"
- test_ping
- test_vda_rw
- test_apt
- test_reboot
- test_virsh_reboot
-
- shutdown
-
- exit 0
|