autotest / virt-test

Linux Virtualization Tests
Other
97 stars 139 forks source link

Add suffix & join to cartesian_config.py #2262

Closed Andrei-Stepanov closed 9 years ago

Andrei-Stepanov commented 9 years ago


virttest|master ⇒ cd   
~|⇒ cat 1.cfg 
a = zero

variants:
  - one:
      # General
      suffix _one
      a = 11

variants:
  - two:
      # More specific
      suffix _two
      a = 21

# Most specifig
a = 51
suffix _bot

# Rule: add suffixes from specific to general
# a_bot = 51
# a_bot_two = 21
# a_bot_two_one = 11
~|⇒          
~|⇒ 
~|⇒ cat 2.cfg 
a = zero

variants:
  - first:
      # General
      suffix _first
      a = 1
      variants:
          - second:
              a = 22
              b = 22
              variants:
                - third:
                      a = 333
                      b = 333
                      c = 333
                      # More specific
                      suffix _third

# Most specific
suffix _b
a = 777

# Rule: add suffixes from specific to general

# Result:
#    a_b = 777
#    a_b_first_third = 333
#    b_b_first_third = 333
#    c_b_first_third = 333

~|⇒ 
~|⇒ 
~|⇒ 
~|⇒ 
~|⇒ cat 3.cfg 
a = zero

variants:
  - one:
      # General
      suffix _one

variants:
  - three:
      # More specific
      suffix _three
      a = 33

# Most specific
a = 777
suffix _b

# Rule: add suffixes from specific to general
# Result:
# dict    1:  three.one
#     a_b = 777
#     a_b_three = 33
#     a_b_three_one = zero
~|⇒ 

# cat t.cfg 
## Autogenerated by phase_cartesian_tests_cfg ##
include virt-test/qemu/cfg/guest-os.cfg
#only Client-RHEL6-x64-latest.Guest-RHEL6-x64-latest

variants:
  -win:
    only Windows
    suffix _vm1
  - lin:
    suffix _vm2
    only Linux

join lin.Linux.Fedora.19.i386 win.Windows.Win2003
[root@astepano1 qe-tests]# 
[root@astepano1 qe-tests]# 
[root@astepano1 qe-tests]# 
[root@astepano1 qe-tests]# 
[root@astepano1 qe-tests]# ./virt-test/virttest/cartesian_config.py t.cfg 
dict    1:  lin.Fedora.19.i386.win.Win2003.i386
dict    2:  lin.Fedora.19.i386.win.Win2003.x86_64
[root@astepano1 qe-tests]# 
[root@astepano1 qe-tests]# 
[root@astepano1 qe-tests]# 
[root@astepano1 qe-tests]# ./virt-test/virttest/cartesian_config.py t.cfg -c
dict    1:  lin.Fedora.19.i386.win.Win2003.i386
    _name_map_file = {'t.cfg': 'win', 'guest-os.cfg': 'Windows.Win2003.i386'}
    _short_name_map_file = {'t.cfg': 'win', 'guest-os.cfg': 'Windows.Win2003.i386'}
    cdrom_cd1_vm1 = isos/windows/winutils.iso
    cdrom_check_cdrom_pattern_vm1 = \d\s+(\w).*CD-ROM
    cdrom_check_cdrom_pattern_vm2 = /dev/cdrom-\w+|/dev/cdrom\d*
    cdrom_get_cdrom_cmd_vm1 = echo list volume > check_cdrom && echo exit >> check_cdrom && diskpart /s check_cdrom
    cdrom_get_cdrom_cmd_vm2 = ls /dev/cdrom*
    cdrom_test_cmd_vm1 = dir %s:\
    cdrom_test_cmd_vm2 = dd if=%s of=/dev/null bs=1 count=1
    cpu_chk_cmd_vm1 = echo %NUMBER_OF_PROCESSORS%
    cpu_chk_cmd_vm2 = ls /sys/devices/system/cpu | egrep -c "cpu[0-9]+$"
    dep = []
    file_transfer_client_vm1 = rss
    file_transfer_client_vm2 = scp
    file_transfer_port_vm1 = 10023
    file_transfer_port_vm2 = 22
    guest_port_file_transfer_vm1 = 10023
    guest_port_remote_shell_vm1 = 10022
    image_name_vm1 = images/win2003-32
    image_name_vm2 = images/f19-32
    image_size_vm1 = 30G
    mem_chk_cmd_vm1 = wmic memphysical
    mem_chk_cmd_vm2 = dmidecode -t 17 | awk -F: '/Size/ {print $2}'
    mem_chk_cur_cmd_vm1 = wmic memphysical
    mem_chk_cur_cmd_vm2 = grep MemTotal /proc/meminfo
    mem_chk_re_str_vm2 = [^\$]([0-9]+)
    name = lin.Linux.Fedora.19.i386.win.Windows.Win2003.i386
    os_type_vm1 = windows
    os_type_vm2 = linux
    os_variant_vm1 = win2k3
    os_variant_vm2 = fedora19
    password_vm1 = 1q2w3eP
    password_vm2 = 123456
    reboot_command_vm1 = shutdown /r /f /t 0
    reboot_command_vm2 = shutdown -r now
    redirs_vm1 =  file_transfer
    rtc_base_vm1 = localtime
    shell_client_vm1 = nc
    shell_client_vm2 = ssh
    shell_linesep_vm1 = \r\n
    shell_port_vm1 = 10022
    shell_port_vm2 = 22
    shell_prompt_vm1 = ^\w:\\.*>\s*$
    shell_prompt_vm2 = ^\[.*\][\#\$]\s*$
    shortname = lin.Fedora.19.i386.win.Win2003.i386
    shutdown_command_vm1 = shutdown /s /f /t 0
    shutdown_command_vm2 = shutdown -h now
    status_test_command_vm1 = echo %errorlevel%
    status_test_command_vm2 = echo $?
    use_libvirt_cdrom_switch_vm1 = yes
    username_vm1 = Administrator
    username_vm2 = root
    vfd_size_vm1 = 2880k
    vm_arch_name_vm1 = i686
    vm_arch_name_vm2 = i386
dict    2:  lin.Fedora.19.i386.win.Win2003.x86_64
    _name_map_file = {'t.cfg': 'win', 'guest-os.cfg': 'Windows.Win2003.x86_64'}
    _short_name_map_file = {'t.cfg': 'win', 'guest-os.cfg': 'Windows.Win2003.x86_64'}
    cdrom_cd1_vm1 = isos/windows/winutils.iso
    cdrom_check_cdrom_pattern_vm1 = \d\s+(\w).*CD-ROM
    cdrom_check_cdrom_pattern_vm2 = /dev/cdrom-\w+|/dev/cdrom\d*
    cdrom_get_cdrom_cmd_vm1 = echo list volume > check_cdrom && echo exit >> check_cdrom && diskpart /s check_cdrom
    cdrom_get_cdrom_cmd_vm2 = ls /dev/cdrom*
    cdrom_test_cmd_vm1 = dir %s:\
    cdrom_test_cmd_vm2 = dd if=%s of=/dev/null bs=1 count=1
    cpu_chk_cmd_vm1 = echo %NUMBER_OF_PROCESSORS%
    cpu_chk_cmd_vm2 = ls /sys/devices/system/cpu | egrep -c "cpu[0-9]+$"
    dep = []
    file_transfer_client_vm1 = rss
    file_transfer_client_vm2 = scp
    file_transfer_port_vm1 = 10023
    file_transfer_port_vm2 = 22
    guest_port_file_transfer_vm1 = 10023
    guest_port_remote_shell_vm1 = 10022
    image_name_vm1 = images/win2003-64
    image_name_vm2 = images/f19-32
    image_size_vm1 = 30G
    mem_chk_cmd_vm1 = wmic memphysical
    mem_chk_cmd_vm2 = dmidecode -t 17 | awk -F: '/Size/ {print $2}'
    mem_chk_cur_cmd_vm1 = wmic memphysical
    mem_chk_cur_cmd_vm2 = grep MemTotal /proc/meminfo
    mem_chk_re_str_vm2 = [^\$]([0-9]+)
    name = lin.Linux.Fedora.19.i386.win.Windows.Win2003.x86_64
    os_type_vm1 = windows
    os_type_vm2 = linux
    os_variant_vm1 = win2k3
    os_variant_vm2 = fedora19
    password_vm1 = 1q2w3eP
    password_vm2 = 123456
    reboot_command_vm1 = shutdown /r /f /t 0
    reboot_command_vm2 = shutdown -r now
    redirs_vm1 =  file_transfer
    rtc_base_vm1 = localtime
    shell_client_vm1 = nc
    shell_client_vm2 = ssh
    shell_linesep_vm1 = \r\n
    shell_port_vm1 = 10022
    shell_port_vm2 = 22
    shell_prompt_vm1 = ^\w:\\.*>\s*$
    shell_prompt_vm2 = ^\[.*\][\#\$]\s*$
    shortname = lin.Fedora.19.i386.win.Win2003.x86_64
    shutdown_command_vm1 = shutdown /s /f /t 0
    shutdown_command_vm2 = shutdown -h now
    status_test_command_vm1 = echo %errorlevel%
    status_test_command_vm2 = echo $?
    use_libvirt_cdrom_switch_vm1 = yes
    username_vm1 = Administrator
    username_vm2 = root
    vfd_size_vm1 = 2880k
    vm_arch_name_vm1 = x86_64
    vm_arch_name_vm2 = i386
[root@astepano1 qe-tests]#