qemu_guest_agent.cfg 10.7 KB
Newer Older
1
- qemu_guest_agent: install setup image_copy unattended_install.cdrom single_driver_install.with_vioserial
2
    only Fedora, RHEL, Windows
3
    no Fedora.8, Fedora.9, Fedora.10, Fedora.11, Fedora.12, Fedora.13, Fedora.14, Fedora.15
4 5
    type = qemu_guest_agent
    gagent_name = "org.qemu.guest_agent.0"
6
    gagent_install_cmd = "yum install -y qemu-guest-agent"
7 8 9 10
    gagent_start_cmd = "systemctl start qemu-guest-agent.service"
    gagent_restart_cmd = "systemctl restart qemu-guest-agent.service"
    gagent_stop_cmd = "systemctl stop qemu-guest-agent.service"
    gagent_status_cmd = "systemctl status qemu-guest-agent.service"
11
    gagent_pkg_check_cmd = "rpm -q qemu-guest-agent"
12 13
    black_list_change_cmd = "sed -i 's/%s//g' /etc/sysconfig/qemu-ga"
    black_list_check_cmd = "grep -nr 'BLACKLIST_RPC=.*%s' /etc/sysconfig/qemu-ga"
14
    Windows:
15 16 17
        gagent_src_type = url
        cdroms += " virtio"
        cdrom_virtio = isos/windows/virtio-win.iso
18
        ga_username = "Administrator"
19 20 21 22
        i386:
            qemu_ga_pkg = qemu-ga-x86.msi
        x86_64:
            qemu_ga_pkg = qemu-ga-x64.msi
23
        gagent_host_path = "/tmp/${qemu_ga_pkg}"
24
        gagent_download_cmd = "wget https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-qemu-ga/${qemu_ga_pkg} -O ${gagent_host_path}"
25 26
        gagent_guest_dir = "C:\qemu-ga"
        gagent_install_cmd = "start /wait %s /quiet"
27
        gagent_uninstall_cmd = wmic product where name='Qemu guest agent' call uninstall
28
        gagent_start_cmd = "net start qemu-ga"
29
        gagent_restart_cmd = "service qemu-ga restart"
30
        gagent_stop_cmd = "net stop qemu-ga"
31 32
        gagent_status_cmd = sc query qemu-ga |findstr "RUNNING"
        gagent_pkg_check_cmd = wmic product get name |findstr "QEMU guest agent"
33
        gagent_remove_service_cmd = "net stop qemu-ga & del /f C:\qemu-ga\${qemu_ga_pkg} & echo done"
34 35
    RHEL.6:
        gagent_start_cmd = "service qemu-ga start"
36
        gagent_stop_cmd = "service qemu-ga stop"
37
        gagent_status_cmd = "service qemu-ga status"
38
        gagent_restart_cmd = "service qemu-ga restart"
39 40 41
    variants:
        - gagent_install:
            gagent_check_type = install
42 43 44 45
        - gagent_install_uninstall:
            only Windows
            gagent_check_type = install_uninstall
            repeat_times = 50
46 47 48
        - gagent_stop_start:
            gagent_check_type = stop_start
            repeat_times = 100
49 50 51 52 53 54 55 56 57
        - gagent_pkg_update:
            only Windows
            type = qemu_guest_agent_update
            gagent_check_type = pkg_update
            monitor_type = qmp
            start_vm = no
            cdrom_virtio_downgrade = isos/windows/virtio-win-downgrade.iso
            qga_url = "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-qemu-ga"
            qga_pattern = "qemu-ga-win-\d\.\d\.\d-\d.el\dev"
58 59 60 61 62 63
        - check_sync:
            gagent_check_type = sync
        - check_powerdown:
            gagent_check_type = powerdown
        - check_reboot:
            gagent_check_type = reboot
64 65
            # This config would be overriden in guest-os.cfg.
            gagent_guest_reboot_pattern = "Restarting system"
66 67
            Windows:
                gagent_guest_reboot_pattern = ""
68 69
        - check_halt:
            gagent_check_type = halt
70 71
            # This config would be overriden in guest-os.cfg.
            gagent_guest_shutdown_pattern = "System halted"
72 73
            Windows:
                gagent_guest_shutdown_pattern = ""
74 75 76 77 78 79 80
        - check_sync_delimited:
            gagent_check_type = sync_delimited
        - check_set_user_password:
            gagent_check_type = set_user_password
            image_snapshot = yes
            variants:
                - no_crypto:
81
                    new_password = "Abc_123"
82
                - crypto:
83
                    no Windows
84 85 86 87 88 89 90 91
                    new_password = "123456"
                    crypted = "yes"
        - check_get_vcpus:
            no Windows
            gagent_check_type = get_vcpus
        - check_set_vcpus:
            no Windows
            gagent_check_type = set_vcpus
92 93
        - check_get_time:
            gagent_check_type = get_time
94
            get_guest_time_cmd = `command -v python python3 | head -1` -c "import time; print(int(time.time()))"
95 96
            Windows:
                get_guest_time_cmd = python -c "import time; print(int(time.time()))"
97 98 99 100 101
        - check_memory_leak:
            only Windows
            gagent_check_type = memory_leak
            repeats = 1000000
            test_command = guest-info
102
            memory_usage_cmd = "tasklist | findstr /I qemu-ga.exe"
103 104 105
        - check_set_time:
            image_snapshot = yes
            gagent_check_type = set_time
106
            get_guest_time_cmd = `command -v python python3 | head -1` -c "import time; print(int(time.time()))"
107 108
            Windows:
                get_guest_time_cmd = python -c "import time; print(int(time.time()))"
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
            move_time_cmd = "date --rfc-3339=seconds --utc; date --set='now - 1 week' > /dev/null; date --rfc-3339=seconds --utc"
        - check_fstrim:
            no Windows
            gagent_check_type = fstrim
            start_vm = no
            disk_size = 1024
            pre_command = "set -e; modprobe -r scsi_debug; modprobe scsi_debug dev_size_mb=${disk_size} lbpws=1; set +e"
            post_command = "modprobe -r scsi_debug"
            mount_point = "/var/test"
            mount_disk_cmd = "mkdir -p ${mount_point} && mount -o discard DISK ${mount_point}"
            format_disk_cmd = "yes|mkfs.ext4 DISK"
            write_disk_cmd = "dd if=/dev/zero of=${mount_point}/file bs=1M count=800 oflag=direct"
            delete_file_cmd = "rm ${mount_point}/file -f; sync"
        - check_get_interfaces:
            no Windows
            gagent_check_type = get_interfaces
125 126
        - check_fsfreeze:
            gagent_fs_test_cmd = "rm -f /tmp/foo; echo foo > /tmp/foo"
127 128 129 130 131 132 133 134 135 136 137
            Windows:
                gagent_fs_test_cmd = "echo 'fsfreeze test' > C:\test_file.txt"
                write_cmd_timeout = 8
            variants:
                - @default:
                    gagent_check_type = fsfreeze
                - vss_test:
                    only Windows
                    gagent_check_type = fsfreeze_vss_test
                    gagent_fs_test_cmd = "start /b WIN_UTILS:\fsfreeze-write.py"
                    freeze_timeout = 10
138 139
        - check_reboot_shutdown_fsfreeze:
            gagent_check_type = reboot_shutdown
140
        - check_snapshot:
141
            # fsfreeze series commands can't run on windows guest.
142
            no Windows
143 144 145 146
            type = qemu_guest_agent_snapshot
            gagent_check_type = fsfreeze
            gagent_fs_test_cmd = "rm -f /tmp/foo; echo foo > /tmp/foo"
            gagent_fs_check_cmd = "grep foo /tmp/foo"
147 148
        - check_suspend:
            type = qemu_guest_agent_suspend
149
            services_up_timeout = 30
150 151
            extra_params += " -global PIIX4_PM.disable_s3=0"
            extra_params += " -global PIIX4_PM.disable_s4=0"
152 153 154 155 156
            # params: s3_support_chk_cmd, s3_bg_program_setup_cmd,
            # s3_bg_program_chk_cmd, s3_bg_program_kill_cmd, s3_log_chk_cmd,
            # s3_start_cmd, s4_support_chk_cmd, s4_bg_program_setup_cmd,
            # s4_bg_program_chk_cmd, s4_bg_program_kill_cmd, s4_log_chk_cmd,
            # s4_start_cmd and services_up_timeout are set in guest-os.cfg
157 158 159
            Windows:
                # Windows guest only works with qxl driver.
                vga = "qxl"
160 161 162
        - check_guest_file:
            file_path = "/tmp/"
            cmd_read = "cat"
163
            black_list = "guest-file-[a-zA-Z]*"
164
            cmd_del = "rm -rf"
165 166 167
            Windows:
                file_path = "C:\"
                cmd_read = "type"
168 169 170 171 172 173
                cmd_del = "del /f /q"
            variants:
                - seek:
                    gagent_check_type = file_seek
                - write:
                    gagent_check_type = file_write
174 175
                - read:
                    gagent_check_type = file_read
176 177
                - with_fsfreeze:
                    gagent_check_type = with_fsfreeze
178 179 180 181 182 183 184 185 186
        - check_guest_exec:
            gagent_check_type = guest_exec
            black_list = "guest-exec guest-exec-status"
            guest_cmd = "echo"
            guest_cmd_args = "This is a test."
            guest_cmd_timeout = 60
            Windows:
                guest_cmd = "ping"
                guest_cmd_args = "www.redhat.com -n 2"
187 188
        - check_thaw_unfrozen:
            gagent_check_type = thaw_unfrozen
189 190
        - check_freeze_frozen:
            gagent_check_type = freeze_frozen
191 192 193 194 195 196 197 198 199 200
        - check_hotplug_frozen:
            gagent_check_type = hotplug_frozen
            images += " stg0"
            boot_drive_stg0 = no
            image_name_stg0 = images/storage0
            image_size_stg0 = 1G
            force_create_image_stg0 = yes
            disk_write_cmd = "dd if=/dev/zero of=%s/file bs=1M count=4"
            Windows:
                disk_write_cmd = "cd %s:\ && echo test > a.txt"
201 202 203 204 205 206 207 208 209
        - check_path_fsfreeze_hook:
            no Windows
            gagent_check_type = path_fsfreeze_hook
            gagent_help_cmd = "qemu-ga --help | grep 'fsfreeze-hook' | tail -1"
            gagent_path_cmd = "rpm -ql qemu-guest-agent"
            virtio_serial:
                gagent_start_cmd = "qemu-ga -m virtio-serial -p /dev/virtio-ports/org.qemu.guest_agent.0 -F -d"
            isa_serial:
                gagent_start_cmd = "pgrep qemu-ga || qemu-ga -d -m isa-serial -p /dev/ttyS1 -F"
210 211 212
        - gagent_query_chardev:
            no isa_serial
            gagent_check_type = query_chardev
213 214 215 216 217 218 219 220 221
        - gagent_check_after_init:
            no Windows
            gagent_check_type = after_init
        - gagent_frozen_io:
            only Windows
            gagent_check_type = frozen_io
            iozone_cmd = "start /b for /l %i in (1,1,1000) do "
            iozone_cmd += "WIN_UTILS:\Iozone\iozone.exe -azR -r 64k -s 1G -M -i 0 -i 1 -b iozone.xls"
            iozone_cmd += " -f C:\testfile > C:\frozen_io_log.txt"
222 223 224
        - gagent_vss_status:
            only Windows
            gagent_check_type = vss_status
225 226 227 228 229 230
    variants:
        - virtio_serial:
            gagent_serial_type = virtio
            virtio_ports += " org.qemu.guest_agent.0"
            virtio_port_type_org.qemu.guest_agent.0 = "serialport"
        - isa_serial:
231 232
            # Windows guests don't support isa serial, disable it directly.
            no Windows
233 234
            # isa-serial is only supported on x86
            only i386, x86_64
235
            gagent_serial_type = isa
236
            serials += " org.qemu.guest_agent.0"
237
            gagent_start_cmd = "pgrep qemu-ga || qemu-ga -d -m isa-serial -p /dev/ttyS1"
238
            gagent_status_cmd = "pgrep qemu-ga"
239
            gagent_restart_cmd = "pgrep qemu-ga |xargs kill -s 9 && qemu-ga -d -m isa-serial -p /dev/ttyS1"