diff --git a/avocado/plugins/multiplex.py b/avocado/plugins/multiplex.py index ba0ff2c1eff8635c2fff63b4af3118bb58be5880..6b74e6c9c1006b0dd47d510fe39d008790796305 100644 --- a/avocado/plugins/multiplex.py +++ b/avocado/plugins/multiplex.py @@ -35,12 +35,10 @@ class Multiplex(CLICmd): super(Multiplex, self).__init__(*args, **kwargs) def configure(self, parser): - if multiplexer.MULTIPLEX_CAPABLE is False: - return - parser = super(Multiplex, self).configure(parser) - parser.add_argument('multiplex', nargs='+', - help='Path(s) to a multiplex file(s)') + if multiplexer.MULTIPLEX_CAPABLE: + parser.add_argument("-m", '--multiplex', nargs='*', + help='Path(s) to a multiplex file(s)') parser.add_argument('--filter-only', nargs='*', default=[], help='Filter only path(s) from multiplexing') diff --git a/docs/source/MultiplexConfig.rst b/docs/source/MultiplexConfig.rst index 2cb492e2bb9221b57fb8d11f7cc646d1013bf603..2d7e3d491815185cf3e7cbc3dd80e0092cc0d639 100644 --- a/docs/source/MultiplexConfig.rst +++ b/docs/source/MultiplexConfig.rst @@ -59,7 +59,7 @@ is disabled, so the value of node name is always as written in the yaml file (unlike values, where `yes` converts to `True` and such). Nodes are organized in parent-child relationship and together they create -a tree. To view this structure use ``avocado multiplex --tree ``:: +a tree. To view this structure use ``avocado multiplex --tree -m ``:: ┗━━ run ┣━━ hw @@ -422,7 +422,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 multiplex examples/mux-environment.yaml + $ avocado multiplex -m examples/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 diff --git a/docs/source/WritingTests.rst b/docs/source/WritingTests.rst index 54f3d9f44b23953fdb97b1e705f036e82e5d7be2..61a3b99564b78ee5cb8ccead1ae0a0ed369af88c 100644 --- a/docs/source/WritingTests.rst +++ b/docs/source/WritingTests.rst @@ -174,9 +174,9 @@ it's injected directly into the specified path and it's up to the test/framework developer to get the value from this location (using path or adding the path to ``mux-path``). To understand the difference execute those commands:: - $ avocado multiplex -t examples/tests/sleeptest.py.data/sleeptest.yaml - $ avocado multiplex -t duration:examples/tests/sleeptest.py.data/sleeptest.yaml - $ avocado multiplex -t /my/location:examples/tests/sleeptest.py.data/sleeptest.yaml + $ avocado multiplex -t -m examples/tests/sleeptest.py.data/sleeptest.yaml + $ avocado multiplex -t -m duration:examples/tests/sleeptest.py.data/sleeptest.yaml + $ avocado multiplex -t -m /my/location:examples/tests/sleeptest.py.data/sleeptest.yaml Note that, as your multiplex file specifies all parameters for sleeptest, you can't leave the test ID empty:: diff --git a/selftests/functional/test_multiplex.py b/selftests/functional/test_multiplex.py index ce8c6b31316fc1b8a863919005140521e2088f00..7155a574d52463db2b9719d8bf253a3f68f13fda 100644 --- a/selftests/functional/test_multiplex.py +++ b/selftests/functional/test_multiplex.py @@ -43,18 +43,18 @@ class MultiplexTests(unittest.TestCase): return result def test_mplex_plugin(self): - cmd_line = './scripts/avocado multiplex examples/tests/sleeptest.py.data/sleeptest.yaml' + cmd_line = './scripts/avocado multiplex -m examples/tests/sleeptest.py.data/sleeptest.yaml' expected_rc = exit_codes.AVOCADO_ALL_OK self.run_and_check(cmd_line, expected_rc) def test_mplex_plugin_nonexistent(self): - cmd_line = './scripts/avocado multiplex nonexist' + cmd_line = './scripts/avocado multiplex -m nonexist' expected_rc = exit_codes.AVOCADO_JOB_FAIL result = self.run_and_check(cmd_line, expected_rc) self.assertIn('No such file or directory', result.stderr) def test_mplex_debug(self): - cmd_line = ('./scripts/avocado multiplex -c -d ' + cmd_line = ('./scripts/avocado multiplex -c -d -m ' '/:examples/mux-selftest.yaml ' '/:examples/mux-environment.yaml ' '/:examples/mux-selftest.yaml '