Skip to content

Conversation

@miguelafsilva5
Copy link
Member

@miguelafsilva5 miguelafsilva5 commented Jun 5, 2024

PR Description

This PR integrates a test framework into bao-hypervisor. This is done by adding 2 submodules:

  • bao-tests : This repo contains the python scripts responsible for building the system, connect to the board under test, and log the test results. It also contains the C code required to declare and implement tests.
  • bao-nix : This repo is comprised of several nix packages used to build the whole system stack (toolchains, firmware, bao, guests, etc)

Furthermore, this PR includes a directory dedicated to the implementation of test setups (recipes).
More info on how to use is available in tests/README.md.

This PR is currently working for qemu-aarch64-virt and qemu-riscv64-virt

@DavidMCerdeira DavidMCerdeira force-pushed the main branch 2 times, most recently from 59a293c to 8837766 Compare July 16, 2024 10:47
@miguelafsilva5 miguelafsilva5 force-pushed the feat/test-framework branch 7 times, most recently from 6a6ab29 to ae3afc5 Compare July 17, 2024 13:48
@miguelafsilva5 miguelafsilva5 marked this pull request as ready for review July 17, 2024 13:50
@Diogo21Costa Diogo21Costa force-pushed the feat/test-framework branch 4 times, most recently from a441e4a to ec89631 Compare November 10, 2025 19:54
@miguelafsilva5
Copy link
Member Author

@Diogo21Costa is it possible to run the framework on the docker like we do with the CI? With the CI we do, for example:
make -C ci/docker format
It would be be nice if we could do something along those lines:
make tests/docker PLATFORM=plat RECIPE=recipe
Without having to open the docker command line and run the commands from there.

@miguelafsilva5
Copy link
Member Author

@Diogo21Costa I've been testing the TF following the readme with docker. Only qemu-aarch64-virt and qemu-riscv64-virt worked.
I'm leaving my dumps
fvp-a:

Traceback (most recent call last):
  File "/home/mafs/TF/bao-hypervisor/tests/bao-tests/framework/test_framework.py", line 416, in <module>
    deploy_test(platfrm, args.gicv, guest_os,
  File "/home/mafs/TF/bao-hypervisor/tests/bao-tests/framework/test_framework.py", line 313, in deploy_test
    logger.connect_to_platform_port(diff_ports, args.echo)
  File "/home/mafs/TF/bao-hypervisor/tests/bao-tests/framework/connection.py", line 157, in connect_to_platform_port
    self.open_connection(port)
  File "/home/mafs/TF/bao-hypervisor/tests/bao-tests/framework/connection.py", line 255, in open_connection
    ser = serial.Serial(port_name,
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/b01lghv79qpiz96zdifyi8hiix798c0g-python3.11-pyserial-3.5/lib/python3.11/site-packages/serial/serialutil.py", line 244, in __init__
    self.open()
  File "/nix/store/b01lghv79qpiz96zdifyi8hiix798c0g-python3.11-pyserial-3.5/lib/python3.11/site-packages/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 5] could not open port /dev/pts/1: [Errno 5] Input/output error: '/dev/pts/1'
make: *** [/home/mafs/TF/bao-hypervisor/tests/tests.mk:38: framework] Error 1

fvp-r:

Traceback (most recent call last):
  File "/home/mafs/TF/bao-hypervisor/tests/bao-tests/framework/test_framework.py", line 416, in <module>
    deploy_test(platfrm, args.gicv, guest_os,
  File "/home/mafs/TF/bao-hypervisor/tests/bao-tests/framework/test_framework.py", line 268, in deploy_test
    vm_regions = extract_vm_regions(config_file_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mafs/TF/bao-hypervisor/tests/bao-tests/framework/test_framework.py", line 212, in extract_vm_regions
    with open(config_file_path, encoding="utf-8") as file_handle:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/mafs/TF/bao-hypervisor/tests/recipes/configs/fvp-r.c'
make: *** [/home/mafs/TF/bao-hypervisor/tests/tests.mk:38: framework] Error 1

@miguelafsilva5
Copy link
Member Author

Nix recipes should also be up to date according to bao-demos/update/misc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants