[test] Refactor system tests to use pytest as runner

System tests, living in `test/systemtest`, test the whole end-to-end
design of OpenTitan: they initialize the target (e.g. a simulation, an
FPGA, or later an ASIC), load test software as needed, and check for
outputs or other expected behavior. To do so, multiple components need
to work together. For example, a simulation process, components for data
transfer (such as OpenOCD), components which interact with (simulated or
real) external interfaces, etc. Pytest provides a very convenient way to
handle such situations through their fixtures. Our current system tests
make use of this functionality.

What we haven't been using in the past is the ability of pytest to serve
as test runner: select tests, collect their output and results, etc.
(Instead, a shell script was used.)

This PR refactors the system tests to make use of pytest as test runner,
with one main consequence: Tests are now "opinionated", they don't take
configuration parameters through command line arguments any more. Tests
expect build outputs in the distribution directory (`build-bin`) to be
in the well-known layout for this directory.

Notes:
* This commit lays the groundwork to add tests running on an FPGA target
  in a similar way as the verilated tests, which should explain some of
  the structuring of the code.
* The ability to run the debug "compliance test" built into OpenOCD,
  which was present in the `test/systemtest/openocd_verilator_test.py`
  file, has been removed temporarily. This test was unmaintained, and
  will be brought back in revised form at a later time.
* Equally, the "FPGA test runner" available in
  `test/systemtest/functional_fpga_test.py` has been rarely used (as a
  poll on Slack showed) and is also removed.
  It will be brought back in modified form in a future commit.

Signed-off-by: Philipp Wagner <phw@lowrisc.org>
16 files changed
tree: 3fe241e9efcd55cc0904d10422a318e2240a50f5
  1. .github/
  2. ci/
  3. doc/
  4. hw/
  5. site/
  6. sw/
  7. test/
  8. util/
  9. .clang-format
  10. .dockerignore
  11. .flake8
  12. .gitignore
  13. .style.yapf
  14. _index.md
  15. apt-requirements.txt
  16. azure-pipelines.yml
  17. check_tool_requirements.core
  18. CLA
  19. COMMITTERS
  20. CONTRIBUTING.md
  21. LICENSE
  22. meson.build
  23. meson_init.sh
  24. meson_options.txt
  25. python-requirements.txt
  26. README.md
  27. tool_requirements.py
  28. toolchain.txt
README.md

OpenTitan

OpenTitan logo

About the project

OpenTitan is an open source silicon Root of Trust (RoT) project. OpenTitan will make the silicon RoT design and implementation more transparent, trustworthy, and secure for enterprises, platform providers, and chip manufacturers. OpenTitan is administered by lowRISC CIC as a collaborative project to produce high quality, open IP for instantiation as a full-featured product. See the OpenTitan site and OpenTitan docs for more information about the project.

About this repository

This repository contains hardware, software and utilities written as part of the OpenTitan project. It is structured as monolithic repository, or “monorepo”, where all components live in one repository. It exists to enable collaboration across partners participating in the OpenTitan project.

Documentation

The project contains comprehensive documentation of all IPs and tools. You can access it online at docs.opentitan.org.

How to contribute

Have a look at CONTRIBUTING for guidelines on how to contribute code to this repository.

Licensing

Unless otherwise noted, everything in this repository is covered by the Apache License, Version 2.0 (see LICENSE for full text).