qemu_guest_agent.cfg 12.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
        - gagent_stop_start:
47
            no isa_serial
48 49
            gagent_check_type = stop_start
            repeat_times = 100
50 51 52 53 54 55
        - gagent_pkg_update:
            only Windows
            type = qemu_guest_agent_update
            gagent_check_type = pkg_update
            monitor_type = qmp
            start_vm = no
56
            image_snapshot = yes
57 58 59
            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"
60 61 62 63 64 65
            variants:
                - @default:
                - without_driver:
                    driver_uninstall = yes
                    driver_name = vioser
                    device_name = "VirtIO Serial Driver"
66 67 68 69 70 71
        - check_sync:
            gagent_check_type = sync
        - check_powerdown:
            gagent_check_type = powerdown
        - check_reboot:
            gagent_check_type = reboot
72 73
            # This config would be overriden in guest-os.cfg.
            gagent_guest_reboot_pattern = "Restarting system"
74 75
            Windows:
                gagent_guest_reboot_pattern = ""
76 77
        - check_halt:
            gagent_check_type = halt
78 79
            # This config would be overriden in guest-os.cfg.
            gagent_guest_shutdown_pattern = "System halted"
80 81
            Windows:
                gagent_guest_shutdown_pattern = ""
82 83 84 85 86 87 88
        - check_sync_delimited:
            gagent_check_type = sync_delimited
        - check_set_user_password:
            gagent_check_type = set_user_password
            image_snapshot = yes
            variants:
                - no_crypto:
89
                    new_password = "Abc_123"
90
                - crypto:
91
                    no Windows
92 93 94 95
                    new_password = "123456"
                    crypted = "yes"
        - check_get_vcpus:
            gagent_check_type = get_vcpus
96 97 98
            get_cpu_cmd = "lscpu |awk -F: '/^CPU\(s\)/{print $2}'"
            Windows:
                get_cpu_cmd = 'wmic cpu get NumberOfCores|findstr /r "[0-9]"'
99 100 101
        - check_set_vcpus:
            no Windows
            gagent_check_type = set_vcpus
102 103
        - check_get_time:
            gagent_check_type = get_time
104
            get_guest_time_cmd = `command -v python python3 | head -1` -c "import time; print(int(time.time()))"
105 106
            Windows:
                get_guest_time_cmd = python -c "import time; print(int(time.time()))"
107 108 109 110 111
        - check_memory_leak:
            only Windows
            gagent_check_type = memory_leak
            repeats = 1000000
            test_command = guest-info
112
            memory_usage_cmd = "tasklist | findstr /I qemu-ga.exe"
113 114 115
        - check_set_time:
            image_snapshot = yes
            gagent_check_type = set_time
116
            get_guest_time_cmd = `command -v python python3 | head -1` -c "import time; print(int(time.time()))"
117 118
            Windows:
                get_guest_time_cmd = python -c "import time; print(int(time.time()))"
119
            move_time_cmd = "date --rfc-3339=seconds --utc; date --set='now - 1 week' > /dev/null; date --rfc-3339=seconds --utc"
120 121 122 123 124 125 126 127 128 129 130
        - check_time_sync:
            only Windows
            gagent_check_type = time_sync
            image_snapshot = yes
            rtc_drift = none
            get_guest_time_cmd = python -c "import time; print(int(time.time()))"
            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
131 132 133 134 135 136 137 138 139 140 141
        - 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"
142 143 144 145 146 147 148 149 150 151 152 153 154
            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"
155 156
        - check_get_interfaces:
            gagent_check_type = get_interfaces
157
            image_snapshot = yes
158 159
        - check_fsfreeze:
            gagent_fs_test_cmd = "rm -f /tmp/foo; echo foo > /tmp/foo"
160 161 162 163 164 165 166 167 168 169 170
            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
171 172
        - check_reboot_shutdown_fsfreeze:
            gagent_check_type = reboot_shutdown
173 174 175
        - check_snapshot:
            type = qemu_guest_agent_snapshot
            gagent_check_type = fsfreeze
176 177
        - check_suspend:
            type = qemu_guest_agent_suspend
178
            services_up_timeout = 30
179 180
            extra_params += " -global PIIX4_PM.disable_s3=0"
            extra_params += " -global PIIX4_PM.disable_s4=0"
181 182 183 184 185
            # 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
186 187 188
            Windows:
                # Windows guest only works with qxl driver.
                vga = "qxl"
189 190 191
        - check_guest_file:
            file_path = "/tmp/"
            cmd_read = "cat"
192
            black_list = "guest-file-[a-zA-Z]*"
193
            cmd_del = "rm -rf"
194 195 196
            Windows:
                file_path = "C:\"
                cmd_read = "type"
197 198 199 200 201 202
                cmd_del = "del /f /q"
            variants:
                - seek:
                    gagent_check_type = file_seek
                - write:
                    gagent_check_type = file_write
203 204
                - read:
                    gagent_check_type = file_read
205 206
                - with_fsfreeze:
                    gagent_check_type = with_fsfreeze
207 208 209 210 211 212 213 214 215
        - 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"
216 217
        - check_thaw_unfrozen:
            gagent_check_type = thaw_unfrozen
218 219
        - check_freeze_frozen:
            gagent_check_type = freeze_frozen
220 221 222 223 224 225 226 227 228 229
        - 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"
230 231 232 233 234 235 236 237 238
        - 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"
239 240 241 242 243 244
        - check_fsinfo:
            gagent_check_type = fsinfo
            blk_extra_params = "serial=GAGENT_TEST"
            cmd_get_disk = cat /proc/mounts |awk '$2~/^\%s$/{print $1,$3}'
            Windows:
                cmd_get_disk = wmic volume where "DriveLetter='%s'" get FileSystem,DeviceID |findstr /v /i FileSystem
245 246 247
        - check_nonexistent_cmd:
            gagent_check_type = nonexistent_cmd
            wrong_cmd = "system_reset"
248 249 250
        - gagent_query_chardev:
            no isa_serial
            gagent_check_type = query_chardev
251 252 253 254 255 256 257 258 259
        - 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"
260 261 262
        - gagent_vss_status:
            only Windows
            gagent_check_type = vss_status
263 264 265 266
        - gagent_with_migrate:
            only virtio_serial
            gagent_check_type = with_migrate
            mig_speed = 512M
267 268 269
    variants:
        - virtio_serial:
            gagent_serial_type = virtio
270 271
            serials += " org.qemu.guest_agent.0"
            serial_type_org.qemu.guest_agent.0 = "virtserialport"
272
        - isa_serial:
273 274
            # isa-serial is only supported on x86
            only i386, x86_64
275
            gagent_serial_type = isa
276
            serials += " org.qemu.guest_agent.0"
277
            gagent_start_cmd = "pgrep qemu-ga || qemu-ga -d -m isa-serial -p /dev/ttyS1"
278
            gagent_status_cmd = "pgrep qemu-ga"
279
            gagent_restart_cmd = "pgrep qemu-ga |xargs kill -s 9 && qemu-ga -d -m isa-serial -p /dev/ttyS1"
280 281 282 283
            Windows:
                gagent_start_cmd = "cd C:\Program Files\Qemu-ga & start /b qemu-ga.exe -m isa-serial -p COM2"
                gagent_status_cmd = "tasklist |findstr /i /r qemu-ga.exe.*Console"
                gagent_restart_cmd = "taskkill /f /t /im qemu-ga.exe & ${gagent_start_cmd}"