未验证 提交 8f509cfa 编写于 作者: C Cleber Rosa

Merge remote-tracking branch 'ldoktor/mux-selftest'

Signed-off-by: NCleber Rosa <crosa@redhat.com>
......@@ -41,55 +41,11 @@ mux yaml file::
$ avocado run /bin/true /bin/false --mux-yaml mux-environment.yaml
JOB ID : bd6aa3b852d4290637b5e771b371537541043d1d
JOB LOG : $HOME/avocado/job-results/job-2016-01-11T21.56-bd6aa3b/job.log
(1/48) /bin/true;1: PASS (0.01 s)
(2/48) /bin/true;2: PASS (0.01 s)
(3/48) /bin/true;3: PASS (0.01 s)
(4/48) /bin/true;4: PASS (0.01 s)
(5/48) /bin/true;5: PASS (0.01 s)
(6/48) /bin/true;6: PASS (0.01 s)
(7/48) /bin/true;7: PASS (0.01 s)
(8/48) /bin/true;8: PASS (0.01 s)
(9/48) /bin/true;9: PASS (0.01 s)
(10/48) /bin/true;10: PASS (0.01 s)
(11/48) /bin/true;11: PASS (0.01 s)
(12/48) /bin/true;12: PASS (0.01 s)
(13/48) /bin/true;13: PASS (0.01 s)
(14/48) /bin/true;14: PASS (0.01 s)
(15/48) /bin/true;15: PASS (0.01 s)
(16/48) /bin/true;16: PASS (0.01 s)
(17/48) /bin/true;17: PASS (0.01 s)
(18/48) /bin/true;18: PASS (0.01 s)
(19/48) /bin/true;19: PASS (0.01 s)
(20/48) /bin/true;20: PASS (0.01 s)
(21/48) /bin/true;21: PASS (0.01 s)
(22/48) /bin/true;22: PASS (0.01 s)
(23/48) /bin/true;23: PASS (0.01 s)
(24/48) /bin/true;24: PASS (0.01 s)
(25/48) /bin/false;1: FAIL (0.01 s)
(26/48) /bin/false;2: FAIL (0.01 s)
(27/48) /bin/false;3: FAIL (0.01 s)
(28/48) /bin/false;4: FAIL (0.01 s)
(29/48) /bin/false;5: FAIL (0.01 s)
(30/48) /bin/false;6: FAIL (0.01 s)
(31/48) /bin/false;7: FAIL (0.01 s)
(32/48) /bin/false;8: FAIL (0.01 s)
(33/48) /bin/false;9: FAIL (0.01 s)
(34/48) /bin/false;10: FAIL (0.01 s)
(35/48) /bin/false;11: FAIL (0.01 s)
(36/48) /bin/false;12: FAIL (0.01 s)
(37/48) /bin/false;13: FAIL (0.01 s)
(38/48) /bin/false;14: FAIL (0.01 s)
(39/48) /bin/false;15: FAIL (0.01 s)
(40/48) /bin/false;16: FAIL (0.01 s)
(41/48) /bin/false;17: FAIL (0.01 s)
(42/48) /bin/false;18: FAIL (0.01 s)
(43/48) /bin/false;19: FAIL (0.01 s)
(44/48) /bin/false;20: FAIL (0.01 s)
(45/48) /bin/false;21: FAIL (0.01 s)
(46/48) /bin/false;22: FAIL (0.01 s)
(47/48) /bin/false;23: FAIL (0.01 s)
(48/48) /bin/false;24: FAIL (0.01 s)
RESULTS : PASS 24 | ERROR 0 | FAIL 24 | SKIP 0 | WARN 0 | INTERRUPT 0
(1/4) /bin/true;first-c49a: PASS (0.01 s)
(2/4) /bin/true;second-f05f: PASS (0.01 s)
(3/4) /bin/false;first-c49a: FAIL (0.04 s)
(4/4) /bin/false;second-f05f: FAIL (0.04 s)
RESULTS : PASS 2 | ERROR 0 | FAIL 2 | SKIP 0 | WARN 0 | INTERRUPT 0
JOB TIME : 0.19 s
JOB HTML : $HOME/avocado/job-results/job-2016-01-11T21.56-bd6aa3b/html/results.html
......@@ -114,54 +70,10 @@ result, using the option ``--replay-test-status``. See the example below::
JOB ID : 2e1dc41af6ed64895f3bb45e3820c5cc62a9b6eb
SRC JOB ID : bd6aa3b852d4290637b5e771b371537541043d1d
JOB LOG : $HOME/avocado/job-results/job-2016-01-12T00.38-2e1dc41/job.log
(1/48) /bin/true;1: SKIP
(2/48) /bin/true;2: SKIP
(3/48) /bin/true;3: SKIP
(4/48) /bin/true;4: SKIP
(5/48) /bin/true;5: SKIP
(6/48) /bin/true;6: SKIP
(7/48) /bin/true;7: SKIP
(8/48) /bin/true;8: SKIP
(9/48) /bin/true;9: SKIP
(10/48) /bin/true;10: SKIP
(11/48) /bin/true;11: SKIP
(12/48) /bin/true;12: SKIP
(13/48) /bin/true;13: SKIP
(14/48) /bin/true;14: SKIP
(15/48) /bin/true;15: SKIP
(16/48) /bin/true;16: SKIP
(17/48) /bin/true;17: SKIP
(18/48) /bin/true;18: SKIP
(19/48) /bin/true;19: SKIP
(20/48) /bin/true;20: SKIP
(21/48) /bin/true;21: SKIP
(22/48) /bin/true;22: SKIP
(23/48) /bin/true;23: SKIP
(24/48) /bin/true;24: SKIP
(25/48) /bin/false;1: FAIL (0.01 s)
(26/48) /bin/false;2: FAIL (0.01 s)
(27/48) /bin/false;3: FAIL (0.01 s)
(28/48) /bin/false;4: FAIL (0.01 s)
(29/48) /bin/false;5: FAIL (0.01 s)
(30/48) /bin/false;6: FAIL (0.01 s)
(31/48) /bin/false;7: FAIL (0.01 s)
(32/48) /bin/false;8: FAIL (0.01 s)
(33/48) /bin/false;9: FAIL (0.01 s)
(34/48) /bin/false;10: FAIL (0.01 s)
(35/48) /bin/false;11: FAIL (0.01 s)
(36/48) /bin/false;12: FAIL (0.01 s)
(37/48) /bin/false;13: FAIL (0.01 s)
(38/48) /bin/false;14: FAIL (0.01 s)
(39/48) /bin/false;15: FAIL (0.01 s)
(40/48) /bin/false;16: FAIL (0.01 s)
(41/48) /bin/false;17: FAIL (0.01 s)
(42/48) /bin/false;18: FAIL (0.01 s)
(43/48) /bin/false;19: FAIL (0.01 s)
(44/48) /bin/false;20: FAIL (0.01 s)
(45/48) /bin/false;21: FAIL (0.01 s)
(46/48) /bin/false;22: FAIL (0.01 s)
(47/48) /bin/false;23: FAIL (0.01 s)
(48/48) /bin/false;24: FAIL (0.01 s)
(1/4) /bin/true;first-c49a: SKIP
(2/4) /bin/true;second-f05f: SKIP
(3/4) /bin/false;first-c49a: FAIL (0.03 s)
(4/4) /bin/false;second-f05f: FAIL (0.04 s)
RESULTS : PASS 0 | ERROR 0 | FAIL 24 | SKIP 24 | WARN 0 | INTERRUPT 0
JOB TIME : 0.29 s
JOB HTML : $HOME/avocado/job-results/job-2016-01-12T00.38-2e1dc41/html/results.html
......
......@@ -498,7 +498,7 @@ Let's take a second look at the first example::
After filters are applied (simply removes non-matching variants), leaves
are gathered and all variants are generated::
$ avocado variants -m examples/mux-environment.yaml
$ avocado variants -m selftests/.data/mux-environment.yaml
Variants generated:
Variant 1: /hw/cpu/intel, /hw/disk/scsi, /distro/fedora, /env/debug
Variant 2: /hw/cpu/intel, /hw/disk/scsi, /distro/fedora, /env/prod
......
# This is an advanced example which includes other files with filters. Note it
# is important to inject this into the default path (/run), otherwise the
# filters won't work properly (simply use `avocado variants -m complex.yaml`)
os: !mux
!include : os/linux.yaml
!include : os/windows.yaml
hw:
!include : hw/hw.yaml
cpu: !mux
intel:
cpu_CFLAGS: '-march=core2'
amd:
cpu_CFLAGS: '-march=athlon64'
arm:
!filter-only : /run/hw/disk/virtio
!filter-only : /run/os/linux
cpu_CFLAGS: '-mabi=apcs-gnu -march=armv8-a -mtune=arm8'
disk: !mux
scsi:
disk_type: 'scsi'
virtio:
disk_type: 'virtio'
os_type: linux
username: root
shutdown_command: shutdown -h now
distros:
redhat: !mux
fedora:
version: !mux
20:
21:
flavor: !mux
workstation:
cloud:
rhel: !mux
5:
6:
os_type: windows
username: Administrator
versions: !mux
xp:
shutdown_command: shutdown /s /f /t 0
# Very simple example with 2 variants and no values in them
!mux
first:
second:
# This demonstrates different value types as well as a clash
by_type: !mux
string:
value: "this is string"
int:
value: 1
float:
value: -1.1
key: value
some:
path:
containing:
value: |
this will produce `self.params.get("value")` clashes as
Avocado can't determine which of those values do you need.
You have to use `self.params.get("value", path="*/by_type/*")`
or `self.params.get("value", path="*/some/path/*")` to
distinguish which `value` you have in mind.
......@@ -13,14 +13,14 @@ basedir = os.path.abspath(basedir)
AVOCADO = os.environ.get("UNITTEST_AVOCADO_CMD", "./scripts/avocado")
DEBUG_OUT = """Variant mint-debug-amd-virtio-5e02: amd@examples/mux-environment.yaml, virtio@examples/mux-environment.yaml, mint@examples/mux-environment.yaml, debug@examples/mux-environment.yaml
/distro/mint:init => systemv@examples/mux-environment.yaml:/distro/mint
/env/debug:opt_CFLAGS => -O0 -g@examples/mux-environment.yaml:/env/debug
/hw/cpu/amd:cpu_CFLAGS => -march=athlon64@examples/mux-environment.yaml:/hw/cpu/amd
/hw/cpu/amd:joinlist => ['first_item']@examples/mux-selftest.yaml:/hw/cpu + ['second', 'third']@examples/mux-selftest.yaml:/hw/cpu/amd
/hw/disk/virtio:disk_type => virtio@examples/mux-environment.yaml:/hw/disk/virtio
/hw/disk:corruptlist => nonlist@examples/mux-selftest.yaml:/hw/disk
/hw:corruptlist => ['upper_node_list']@examples/mux-selftest.yaml:/hw
DEBUG_OUT = """Variant mint-debug-amd-virtio-07c6: amd@selftests/.data/mux-environment.yaml, virtio@selftests/.data/mux-environment.yaml, mint@selftests/.data/mux-environment.yaml, debug@selftests/.data/mux-environment.yaml
/distro/mint:init => systemv@selftests/.data/mux-environment.yaml:/distro/mint
/env/debug:opt_CFLAGS => -O0 -g@selftests/.data/mux-environment.yaml:/env/debug
/hw/cpu/amd:cpu_CFLAGS => -march=athlon64@selftests/.data/mux-environment.yaml:/hw/cpu/amd
/hw/cpu/amd:joinlist => ['first_item']@selftests/.data/mux-selftest.yaml:/hw/cpu + ['second', 'third']@selftests/.data/mux-selftest.yaml:/hw/cpu/amd
/hw/disk/virtio:disk_type => virtio@selftests/.data/mux-environment.yaml:/hw/disk/virtio
/hw/disk:corruptlist => nonlist@selftests/.data/mux-selftest.yaml:/hw/disk
/hw:corruptlist => ['upper_node_list']@selftests/.data/mux-selftest.yaml:/hw
"""
......@@ -56,10 +56,10 @@ class MultiplexTests(unittest.TestCase):
def test_mplex_debug(self):
cmd_line = ('%s variants -c -d -m '
'/:examples/mux-selftest.yaml '
'/:examples/mux-environment.yaml '
'/:examples/mux-selftest.yaml '
'/:examples/mux-environment.yaml' % AVOCADO)
'/:selftests/.data/mux-selftest.yaml '
'/:selftests/.data/mux-environment.yaml '
'/:selftests/.data/mux-selftest.yaml '
'/:selftests/.data/mux-environment.yaml' % AVOCADO)
expected_rc = exit_codes.AVOCADO_ALL_OK
result = self.run_and_check(cmd_line, expected_rc)
self.assertIn(DEBUG_OUT, result.stdout)
......
......@@ -203,7 +203,7 @@ class ReplayTests(unittest.TestCase):
ignored)
"""
cmdline = ("%s run --replay %s --job-results-dir %s "
"--sysinfo=off -m examples/mux-selftest.yaml"
"--sysinfo=off -m selftests/.data/mux-selftest.yaml"
% (AVOCADO, self.jobid, self.tmpdir))
self.run_and_check(cmdline, exit_codes.AVOCADO_ALL_OK)
......
......@@ -25,7 +25,7 @@ def combine(leaves_pools):
class TestMuxTree(unittest.TestCase):
# Share tree with all tests
tree = yaml_to_mux.create_from_yaml(['/:' + PATH_PREFIX +
'examples/mux-selftest.yaml'])
'selftests/.data/mux-selftest.yaml'])
def test_node_order(self):
self.assertIsInstance(self.tree, mux.MuxTreeNode)
......@@ -166,7 +166,7 @@ class TestMuxTree(unittest.TestCase):
def test_advanced_yaml(self):
tree2 = yaml_to_mux.create_from_yaml(['/:' + PATH_PREFIX +
'examples/mux-selftest-advanced.'
'selftests/.data/mux-selftest-advanced.'
'yaml'])
exp = ['intel', 'amd', 'arm', 'scsi', 'virtio', 'fedora', '6',
'7', 'gentoo', 'mint', 'prod', 'new_node', 'on']
......@@ -233,7 +233,7 @@ class TestMultiplex(unittest.TestCase):
"Not multiplex capable")
def setUp(self):
self.mux_tree = yaml_to_mux.create_from_yaml(['/:' + PATH_PREFIX +
'examples/mux-selftest.'
'selftests/.data/mux-selftest.'
'yaml'])
self.mux_full = tuple(mux.MuxTree(self.mux_tree))
......@@ -252,7 +252,7 @@ class TestMultiplex(unittest.TestCase):
def test_create_variants(self):
from_file = yaml_to_mux.create_from_yaml(
["/:" + PATH_PREFIX + 'examples/mux-selftest.yaml'])
["/:" + PATH_PREFIX + 'selftests/.data/mux-selftest.yaml'])
from_file = mux.MuxTree(from_file)
self.assertEqual(self.mux_full, tuple(from_file))
......@@ -260,7 +260,7 @@ class TestMultiplex(unittest.TestCase):
def test_filter_only(self):
exp = (['intel', 'scsi'], ['intel', 'virtio'])
act = yaml_to_mux.create_from_yaml(["/:" + PATH_PREFIX +
'examples/mux-selftest.yaml'])
'selftests/.data/mux-selftest.yaml'])
act = mux.apply_filters(act, ('/hw/cpu/intel', '/distro/fedora',
'/hw'))
act = tuple(mux.MuxTree(act))
......@@ -268,7 +268,7 @@ class TestMultiplex(unittest.TestCase):
def test_filter_out(self):
act = yaml_to_mux.create_from_yaml(["/:" + PATH_PREFIX +
'examples/mux-selftest.yaml'])
'selftests/.data/mux-selftest.yaml'])
act = mux.apply_filters(act, None, ('/hw/cpu/intel', '/distro/fedora',
'/distro'))
act = tuple(mux.MuxTree(act))
......@@ -285,7 +285,7 @@ class TestAvocadoParams(unittest.TestCase):
def setUp(self):
yamls = yaml_to_mux.create_from_yaml(["/:" + PATH_PREFIX +
'examples/mux-selftest-params.yaml'])
'selftests/.data/mux-selftest-params.yaml'])
self.yamls = iter(mux.MuxTree(yamls))
self.params1 = varianter.AvocadoParams(self.yamls.next(), 'Unittest1',
['/ch0/*', '/ch1/*'], {})
......@@ -412,12 +412,12 @@ class TestMultipleLoaders(unittest.TestCase):
Verifies that `create_from_yaml` does not affects the main yaml.Loader
"""
nondebug = yaml_to_mux.create_from_yaml(['/:' + PATH_PREFIX +
'examples/mux-selftest.'
'selftests/.data/mux-selftest.'
'yaml'])
self.assertEqual(type(nondebug), mux.MuxTreeNode)
self.assertEqual(type(nondebug.children[0]), mux.MuxTreeNode)
debug = yaml_to_mux.create_from_yaml(['/:' + PATH_PREFIX +
'examples/mux-selftest.'
'selftests/.data/mux-selftest.'
'yaml'],
debug=True)
self.assertEqual(type(debug), mux.MuxTreeNodeDebug)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册