Skip to content

Commit 8860680

Browse files
committed
Enhance avocado_guest test to run host tests in guest
avocado_guest test runs any avocado-misc host test in the guest. This patch adds test repo branch parameter, and adds logic to parse test results and fails accordingly. Signed-off-by: Narasimhan V <16101053+narasimhan-v@users.noreply.github.com>
1 parent c93b4c3 commit 8860680

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

generic/tests/avocado_guest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ def run(test, params, env):
1313
vm.verify_alive()
1414
timeout = int(params.get("test_timeout", 3600))
1515
testlist = []
16-
avocadoinstalltype = params.get("avocadoinstalltype", "pip")
16+
avocadoinstalltype = params.get("avocadoinstalltype", "git")
1717
avocadotestrepo = params.get(
1818
"avocadotestrepo",
1919
"https://github.com/avocado-framework-tests/avocado-misc-tests.git",
2020
)
21+
avocadotestbranch = params.get("avocadotestbranch", "master")
2122
avocadotest = params.get("avocadotest", "cpu/ebizzy.py")
2223
avocadomux = params.get("avocadomux", "")
2324
avocadotestargs = params.get("avocadotestargs", "")
@@ -35,9 +36,12 @@ def run(test, params, env):
3536
testlist,
3637
timeout=timeout,
3738
testrepo=avocadotestrepo,
39+
testbranch=avocadotestbranch,
3840
installtype=avocadoinstalltype,
3941
reinstall=False,
4042
add_args=avocadotestargs,
4143
ignore_result=False,
4244
)
43-
avocado_obj.run_avocado()
45+
result = avocado_obj.run_avocado()
46+
if not result:
47+
test.fail("Avocado test failed. Please look into debug.log")

0 commit comments

Comments
 (0)