You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some "tests.py" with two test classes I called MuxTest and NoMuxTest:
#!/usr/bin/env python3
from avocado import Test
class MuxTest(Test):
"""
:avocado: tags=mux
:param dut: IP address or hostname of DUT
"""
def test_hw(self):
dut = self.params.get('dut', default='localhost')
self.log.debug("Running with dut `%s` ", dut)
class NoMuxTest(Test):
"""
:avocado: tags=nomux
"""
def test_nomux(self):
self.log.debug("Running nomux test")
I want to run tests from MuxTest several times with different options (for dut parameter), while tests from NoMuxTest should be run only once (they don't have any parameters for change).
I'm able to do it with python avocado interface using Job/TestSuite:
It works like expected. When running dict_variants.py I get:
$ ./dict_variants.py
JOB ID : 37bc94579fe96aad053439615ce4f76ffb91406a
JOB LOG : /home/wiselord/avocado/job-results/job-2023-06-16T13.21-37bc945/job.log
(mux-1/3) mtda.py:MuxTest.test_hw;rpi-arm-v7l: STARTED
(mux-1/3) mtda.py:MuxTest.test_hw;rpi-arm-v7l: PASS (0.01 s)
(mux-2/3) mtda.py:MuxTest.test_hw;de0-nano-soc: STARTED
(mux-2/3) mtda.py:MuxTest.test_hw;de0-nano-soc: PASS (0.01 s)
(mux-3/3) mtda.py:MuxTest.test_hw;stm32mp15x: STARTED
(mux-3/3) mtda.py:MuxTest.test_hw;stm32mp15x: PASS (0.01 s)
(nomux-1/1) mtda.py:NoMuxTest.test_nomux: STARTED
(nomux-1/1) mtda.py:NoMuxTest.test_nomux: PASS (0.01 s)
RESULTS : PASS 4 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME : 1.98 s
So, mtda.py:MuxTest.test_hw is run 3 times with different parameters, while mtda.py:NoMuxTest.test_nomux is run only once, as I wanted.
My question is the following:
Is it possible to achieve the same behaviour using avocado's CLI (e.g. by executing "avocado run mtda.py ...")?
I tried to experiment, but either variants are applied for both tests (so, I have 6 runs totally), or to none of them (so I have 2 simple runs with default parameters).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello all.
I have some "tests.py" with two test classes I called MuxTest and NoMuxTest:
I want to run tests from MuxTest several times with different options (for
dut
parameter), while tests from NoMuxTest should be run only once (they don't have any parameters for change).I'm able to do it with python avocado interface using Job/TestSuite:
dict_variants.py:
It works like expected. When running
dict_variants.py
I get:So,
mtda.py:MuxTest.test_hw
is run 3 times with different parameters, whilemtda.py:NoMuxTest.test_nomux
is run only once, as I wanted.My question is the following:
Is it possible to achieve the same behaviour using avocado's CLI (e.g. by executing "avocado run mtda.py ...")?
I tried to experiment, but either variants are applied for both tests (so, I have 6 runs totally), or to none of them (so I have 2 simple runs with default parameters).
Beta Was this translation helpful? Give feedback.
All reactions