virt: Make Cartesian config more verbose

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Update cartesian config unittest

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds formal definition for Cartesian config

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds named variants to Cartesian config.

******** example:
variants name=tests:
  - wait:
       run = "wait"
       variants:
         - long:
            time = short_time
         - short: long
            time = logn_time
  - test2:
       run = "test1"

variants name=virt_system:
  - linux:
  - windows_XP:

variants name=host_os:
  - linux:
       image = linux
  - windows_XP:
       image = windows

tests>wait.short:
    shutdown = destroy

only host_os>linux

******** output:
dict    1:  host_os>linux.virt_system>linux.tests>wait.long
    dep = []
    host_os = linux
    image = linux
    name = host_os>linux.virt_system>linux.tests>wait.long
    run = wait
    shortname = host_os>linux.virt_system>linux.tests>wait.long
    tests = wait
    time = short_time
    virt_system = linux
dict    2:  host_os>linux.virt_system>linux.tests>wait.short
    dep = ['host_os>linux.virt_system>linux.tests>wait.long']
    host_os = linux
    image = linux
    name = host_os>linux.virt_system>linux.tests>wait.short
    run = wait
    shortname = host_os>linux.virt_system>linux.tests>wait.short
    shutdown = destroy
    tests = wait
    time = logn_time
    virt_system = linux
dict    3:  host_os>linux.virt_system>linux.tests>test2
    dep = []
    host_os = linux
    image = linux
    name = host_os>linux.virt_system>linux.tests>test2
    run = test1
    shortname = host_os>linux.virt_system>linux.tests>test2
    tests = test2
    virt_system = linux
dict    4:  host_os>linux.virt_system>windows_XP.tests>wait.long
    dep = []
    host_os = linux
    image = linux
    name = host_os>linux.virt_system>windows_XP.tests>wait.long
    run = wait
    shortname = host_os>linux.virt_system>windows_XP.tests>wait.long
    tests = wait
    time = short_time
    virt_system = windows_XP
dict    5:  host_os>linux.virt_system>windows_XP.tests>wait.short
    dep = ['host_os>linux.virt_system>windows_XP.tests>wait.long']
    host_os = linux
    image = linux
    name = host_os>linux.virt_system>windows_XP.tests>wait.short
    run = wait
    shortname = host_os>linux.virt_system>windows_XP.tests>wait.short
    shutdown = destroy
    tests = wait
    time = logn_time
    virt_system = windows_XP
dict    6:  host_os>linux.virt_system>windows_XP.tests>test2
    dep = []
    host_os = linux
    image = linux
    name = host_os>linux.virt_system>windows_XP.tests>test2
    run = test1
    shortname = host_os>linux.virt_system>windows_XP.tests>test2
    tests = test2
    virt_system = windows_XP

For filtering of named variants is used character ">" because there was
problem with conflict with = in expression key = value. The char ">"
could be changed to something better but it should be different from "="
for optimization of speed.

Additionally named variant adds keys to final dictionary in case of
example is it (virt_system = linux). It should reduce size of config file.
Keys defined in config and keys defined by named variants are in same
name space.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Update Cartesian config unittest named variants

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds possibility filter defaults variant from variants

If default variant is not filtered by only or no filters then
only default variant is chosen. This behavior was used for optimizing
of speed of Cartesian config.
If variants don't have default variant then everything works as usual.
Default variant must be in variants with with_default exactly one times.
The default variant could be filtered by only, no filter. If default
variant is filtered from variants then variants works same as usual variants with
default variant.

For calling Cartesian config from command line is used option -d/--defaults:
   ../virttest/cartesian_config.py -d cfg/cc.cfg

For calling Cartesian config from python:
   c = Parser(args[0], defaults=options.defaults, debug=options.debug)

*********  example:
variants name=tests:
  - wait:
       run = "wait"
       variants:
         - long:
            time = short_time
         - short: long
            time = logn_time
  - test2:
       run = "test1"

variants name=virt_system, with_default:
  - @linux:
  - windows:

variants name=host_os, with_default:
  - linux:
       image = linux
       variants with_default:
            - ubuntu:
            - @fedora:
  - windows:
       image = windows
       variants:
            - @XP:
            - WIN7:

only host_os>windows

In this case is chosen from host_os variants windows variant.
host_os>windows was choosen because default variant linux was filtered.
Next step is select one variant from guest_os. There will be chosen only
default variant linux because not filtered and virt_system variant is
with with_default. There is no default variant in tests variants because
that all of tests will be chosen.

********  output:
dict    1:  host_os>windows.tests>wait.long
    dep = []
    host_os = windows
    image = windows
    name = host_os>windows.XP.virt_system>linux.tests>wait.long
    run = wait
    shortname = host_os>windows.tests>wait.long
    tests = wait
    time = short_time
    virt_system = linux
dict    2:  host_os>windows.tests>wait.short
    dep = ['host_os>windows.XP.virt_system>linux.tests>wait.long']
    host_os = windows
    image = windows
    name = host_os>windows.XP.virt_system>linux.tests>wait.short
    run = wait
    shortname = host_os>windows.tests>wait.short
    tests = wait
    time = logn_time
    virt_system = linux
dict    3:  host_os>windows.tests>test2
    dep = []
    host_os = windows
    image = windows
    name = host_os>windows.XP.virt_system>linux.tests>test2
    run = test1
    shortname = host_os>windows.tests>test2
    tests = test2
    virt_system = linux
dict    4:  host_os>windows.WIN7.tests>wait.long
    dep = []
    host_os = windows
    image = windows
    name = host_os>windows.WIN7.virt_system>linux.tests>wait.long
    run = wait
    shortname = host_os>windows.WIN7.tests>wait.long
    tests = wait
    time = short_time
    virt_system = linux
dict    5:  host_os>windows.WIN7.tests>wait.short
    dep = ['host_os>windows.WIN7.virt_system>linux.tests>wait.long']
    host_os = windows
    image = windows
    name = host_os>windows.WIN7.virt_system>linux.tests>wait.short
    run = wait
    shortname = host_os>windows.WIN7.tests>wait.short
    tests = wait
    time = logn_time
    virt_system = linux
dict    6:  host_os>windows.WIN7.tests>test2
    dep = []
    host_os = windows
    image = windows
    name = host_os>windows.WIN7.virt_system>linux.tests>test2
    run = test1
    shortname = host_os>windows.WIN7.tests>test2
    tests = test2
    virt_system = linux

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Update Cartesian config unittest default variants.

Signed-off-by: Jiří Župka <jzupka@redhat.com>