qemu_guest_agent.cfg 14.4 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 15 16 17
    #only for rhel8,virt module stream is rhel or 8.1,8.2,8.3 and so on
    virt_module_stream = rhel
    # Please update your file share web server url before test
    download_root_url = <your_server_url>
18
    Windows:
19 20 21
        gagent_src_type = url
        cdroms += " virtio"
        cdrom_virtio = isos/windows/virtio-win.iso
22
        ga_username = "Administrator"
23 24 25 26
        i386:
            qemu_ga_pkg = qemu-ga-x86.msi
        x86_64:
            qemu_ga_pkg = qemu-ga-x64.msi
27
        gagent_host_path = "/tmp/${qemu_ga_pkg}"
28
        gagent_download_cmd = "wget https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-qemu-ga/${qemu_ga_pkg} -O ${gagent_host_path}"
29 30
        gagent_guest_dir = "C:\qemu-ga"
        gagent_install_cmd = "start /wait %s /quiet"
31
        gagent_uninstall_cmd = wmic product where name='Qemu guest agent' call uninstall
32
        gagent_start_cmd = "net start qemu-ga"
33
        gagent_restart_cmd = "service qemu-ga restart"
34
        gagent_stop_cmd = "net stop qemu-ga"
35 36
        gagent_status_cmd = sc query qemu-ga |findstr "RUNNING"
        gagent_pkg_check_cmd = wmic product get name |findstr "QEMU guest agent"
37
        gagent_remove_service_cmd = "net stop qemu-ga & del /f C:\qemu-ga\${qemu_ga_pkg} & echo done"
38 39
    RHEL.6:
        gagent_start_cmd = "service qemu-ga start"
40
        gagent_stop_cmd = "service qemu-ga stop"
41
        gagent_status_cmd = "service qemu-ga status"
42
        gagent_restart_cmd = "service qemu-ga restart"
43 44 45
    variants:
        - gagent_install:
            gagent_check_type = install
46 47 48 49
        - gagent_install_uninstall:
            only Windows
            gagent_check_type = install_uninstall
            repeat_times = 50
50
        - gagent_stop_start:
51
            no isa_serial
52 53
            gagent_check_type = stop_start
            repeat_times = 100
54 55 56 57 58 59
        - gagent_pkg_update:
            only Windows
            type = qemu_guest_agent_update
            gagent_check_type = pkg_update
            monitor_type = qmp
            start_vm = no
60
            image_snapshot = yes
61 62 63
            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"
64 65 66 67 68 69
            variants:
                - @default:
                - without_driver:
                    driver_uninstall = yes
                    driver_name = vioser
                    device_name = "VirtIO Serial Driver"
70 71 72 73 74 75
        - check_sync:
            gagent_check_type = sync
        - check_powerdown:
            gagent_check_type = powerdown
        - check_reboot:
            gagent_check_type = reboot
76 77
            # This config would be overriden in guest-os.cfg.
            gagent_guest_reboot_pattern = "Restarting system"
78 79
            Windows:
                gagent_guest_reboot_pattern = ""
80 81
        - check_halt:
            gagent_check_type = halt
82 83
            # This config would be overriden in guest-os.cfg.
            gagent_guest_shutdown_pattern = "System halted"
84 85
            Windows:
                gagent_guest_shutdown_pattern = ""
86 87 88 89 90 91 92
        - check_sync_delimited:
            gagent_check_type = sync_delimited
        - check_set_user_password:
            gagent_check_type = set_user_password
            image_snapshot = yes
            variants:
                - no_crypto:
93
                    new_password = "Abc_123"
94
                - crypto:
95
                    no Windows
96 97 98 99
                    new_password = "123456"
                    crypted = "yes"
        - check_get_vcpus:
            gagent_check_type = get_vcpus
100 101 102
            get_cpu_cmd = "lscpu |awk -F: '/^CPU\(s\)/{print $2}'"
            Windows:
                get_cpu_cmd = 'wmic cpu get NumberOfCores|findstr /r "[0-9]"'
103 104 105
        - check_set_vcpus:
            no Windows
            gagent_check_type = set_vcpus
106 107 108
        - check_set_mem_blocks:
            no Windows
            gagent_check_type = set_mem_blocks
109 110
        - check_get_time:
            gagent_check_type = get_time
111
            get_guest_time_cmd = `command -v python python3 | head -1` -c "import time; print(int(time.time()))"
112
            Windows:
113
                get_guest_time_cmd = python2.7 -c "import time; print(int(time.time()))"
114 115 116 117 118
        - check_memory_leak:
            only Windows
            gagent_check_type = memory_leak
            repeats = 1000000
            test_command = guest-info
119
            memory_usage_cmd = "tasklist | findstr /I qemu-ga.exe"
120 121 122
        - check_set_time:
            image_snapshot = yes
            gagent_check_type = set_time
123
            get_guest_time_cmd = `command -v python python3 | head -1` -c "import time; print(int(time.time()))"
124
            Windows:
125
                get_guest_time_cmd = python2.7 -c "import time; print(int(time.time()))"
126
            move_time_cmd = "date --rfc-3339=seconds --utc; date --set='now - 1 week' > /dev/null; date --rfc-3339=seconds --utc"
127 128 129 130 131
        - check_time_sync:
            only Windows
            gagent_check_type = time_sync
            image_snapshot = yes
            rtc_drift = none
132
            get_guest_time_cmd = python2.7 -c "import time; print(int(time.time()))"
133 134 135 136 137
            time_service_config = w32tm /config /manualpeerlist:"clock.redhat.com" /syncfromflags:manual /reliable:yes /update
            time_service_status_cmd = sc query w32time |findstr "RUNNING"
            time_service_stop_cmd = net stop w32time
            time_service_start_cmd = net start w32time
            pause_time = 180
138 139 140 141 142 143 144 145 146 147 148
        - check_fstrim:
            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"
149 150 151 152 153 154 155 156 157 158 159 160 161
            Windows:
                # for windows guest, only support win8+
                no Win7,Win2008
                start_vm = yes
                driver_name = vioscsi
                images += " stg"
                image_name_stg = "images/storage"
                image_format_stg = "qcow2"
                image_size_stg = 5G
                drv_extra_params = "discard=on"
                force_create_image_stg = yes
                remove_image_stg = yes
                delete_file_cmd = "del /f /q"
162 163
        - check_get_interfaces:
            gagent_check_type = get_interfaces
164
            image_snapshot = yes
165 166
        - check_fsfreeze:
            gagent_fs_test_cmd = "rm -f /tmp/foo; echo foo > /tmp/foo"
167 168 169 170 171 172 173 174 175 176 177
            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
178 179
        - check_reboot_shutdown_fsfreeze:
            gagent_check_type = reboot_shutdown
180 181 182
        - check_snapshot:
            type = qemu_guest_agent_snapshot
            gagent_check_type = fsfreeze
183 184
        - check_suspend:
            type = qemu_guest_agent_suspend
185
            services_up_timeout = 30
186 187
            extra_params += " -global PIIX4_PM.disable_s3=0"
            extra_params += " -global PIIX4_PM.disable_s4=0"
188 189 190 191 192
            # 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
193 194 195
            Windows:
                # Windows guest only works with qxl driver.
                vga = "qxl"
196 197 198
        - check_guest_file:
            file_path = "/tmp/"
            cmd_read = "cat"
199
            black_list = "guest-file-[a-zA-Z]*"
200
            cmd_del = "rm -rf"
201 202 203
            Windows:
                file_path = "C:\"
                cmd_read = "type"
204 205 206 207 208 209
                cmd_del = "del /f /q"
            variants:
                - seek:
                    gagent_check_type = file_seek
                - write:
                    gagent_check_type = file_write
210 211
                - read:
                    gagent_check_type = file_read
212 213
                - with_fsfreeze:
                    gagent_check_type = with_fsfreeze
214 215 216
                - with_selinux:
                    no Windows
                    gagent_check_type = with_selinux
217 218 219 220 221 222 223 224 225
        - 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"
226 227
        - check_thaw_unfrozen:
            gagent_check_type = thaw_unfrozen
228 229
        - check_freeze_frozen:
            gagent_check_type = freeze_frozen
230 231 232 233 234 235 236 237 238 239
        - 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"
240 241
        - check_path_fsfreeze_hook:
            no Windows
242
            no RHEL.6, RHEL.7
243
            gagent_check_type = path_fsfreeze_hook
244 245
            cmd_get_help_info = "qemu-ga --help | grep 'fsfreeze-hook' | tail -1"
            cmd_get_man_page = "export LC_ALL="en_US.UTF-8"; man qemu-ga |col -b > %s"
246 247 248 249
            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"
250 251 252 253 254
        - check_fsfreeze_hook_script:
            no isa_serial
            no Windows
            gagent_check_type = fsfreeze_hook_script
            image_snapshot = yes
255 256 257
        - check_fsinfo:
            gagent_check_type = fsinfo
            blk_extra_params = "serial=GAGENT_TEST"
258
            cmd_get_disk = cat /proc/mounts |grep -v rootfs |awk '$2~/^\%s$/{print $1,$3}'
259 260
            Windows:
                cmd_get_disk = wmic volume where "DriveLetter='%s'" get FileSystem,DeviceID |findstr /v /i FileSystem
261 262 263
        - check_nonexistent_cmd:
            gagent_check_type = nonexistent_cmd
            wrong_cmd = "system_reset"
264 265 266 267 268 269
        - check_umount_frozen:
            gagent_check_type = umount_frozen
            images += " stg0"
            image_name_stg0 = images/storage0
            image_size_stg0 = 1G
            force_create_image_stg0 = yes
270 271 272 273
        - gagent_check_blacklist:
            only Linux
            gagent_check_type = blacklist
            black_list_change_cmd = "sed -i 's/BLACKLIST_RPC=.*/BLACKLIST_RPC=guest-info/g' /etc/sysconfig/qemu-ga"
274 275 276 277 278 279 280 281 282
        - gagent_check_log:
            only isa_serial
            gagent_check_type = log
            black_list = "guest-file-[a-zA-Z]*"
            get_log_cmd = cat /var/log/qemu-ga/qemu-ga.log |grep "read data"
            tmp_file = "/tmp/qga_test"
            Windows:
                get_log_cmd = type c:\qga.log |findstr /c:"read data"
                tmp_file = "C:\qga_test.txt"
283 284 285
        - gagent_query_chardev:
            no isa_serial
            gagent_check_type = query_chardev
286 287 288 289 290 291 292 293 294
        - 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"
295 296 297
        - gagent_vss_status:
            only Windows
            gagent_check_type = vss_status
298 299 300 301
        - gagent_with_migrate:
            only virtio_serial
            gagent_check_type = with_migrate
            mig_speed = 512M
302 303 304
        - gagent_user_logoff:
            only Windows
            gagent_check_type = user_logoff
305 306 307
    variants:
        - virtio_serial:
            gagent_serial_type = virtio
308 309
            serials += " org.qemu.guest_agent.0"
            serial_type_org.qemu.guest_agent.0 = "virtserialport"
310
        - isa_serial:
311 312
            # isa-serial is only supported on x86
            only i386, x86_64
313
            gagent_serial_type = isa
314
            serials += " org.qemu.guest_agent.0"
315
            gagent_start_cmd = "pgrep qemu-ga || qemu-ga -d -m isa-serial -p /dev/ttyS1 -l /var/log/qemu-ga/qemu-ga.log -v"
316
            gagent_status_cmd = "pgrep qemu-ga"
317
            gagent_restart_cmd = "pgrep qemu-ga |xargs kill -s 9 &&  ${gagent_start_cmd}"
318
            Windows:
319
                gagent_start_cmd = "cd C:\Program Files\Qemu-ga & start /b qemu-ga.exe -m isa-serial -p COM2 -l c:\qga.log -v"
320 321
                gagent_status_cmd = "tasklist |findstr /i /r qemu-ga.exe.*Console"
                gagent_restart_cmd = "taskkill /f /t /im qemu-ga.exe & ${gagent_start_cmd}"