feat(kao): add support for bao kao testing framework#363
Open
danielRep wants to merge 1 commit into
Open
Conversation
6f43b3a to
2ef3a2a
Compare
Signed-off-by: Daniel Oliveira <drawnpoetry@gmail.com> Signed-off-by: Diogo Costa <diogoandreveigacosta@gmail.com> Signed-off-by: Miguel Silva <miguelafsilva5@gmail.com>
| irq_set_handler(TIMER_IRQ_ID, test_interrupt_timer_callback); | ||
| timer_set(TIMER_INTERVAL); | ||
| irq_enable(TIMER_IRQ_ID); | ||
| irq_set_prio(TIMER_IRQ_ID, IRQ_MAX_PRIO); |
Member
There was a problem hiding this comment.
Suggested change
| irq_set_prio(TIMER_IRQ_ID, IRQ_MAX_PRIO); | |
| irq_set_prio(TIMER_IRQ_ID, TIMER_IRQ_PRIO); |
should follow the baremetal nomenclature
| irq_set_handler(UART_IRQ_ID, uart_rx_handler); | ||
| uart_enable_rxirq(); | ||
| irq_enable(UART_IRQ_ID); | ||
| irq_set_prio(UART_IRQ_ID, IRQ_MAX_PRIO); |
Member
There was a problem hiding this comment.
Suggested change
| irq_set_prio(UART_IRQ_ID, IRQ_MAX_PRIO); | |
| irq_set_prio(UART_IRQ_ID, UART_IRQ_PRIO); |
should follow the baremetal nomenclature
| cpu_num: 6 | ||
| regions: | ||
| - base: 0x90100000 | ||
| size: 0x100000 |
Member
There was a problem hiding this comment.
Suggested change
| size: 0x100000 | |
| size: 0x80000 |
correct memory region size
| interrupts: | ||
| - 173 | ||
| arch: | ||
| gspr_num: 1 |
Member
There was a problem hiding this comment.
Suggested change
| gspr_num: 1 | |
| gpsr_num: 1 |
typo
| - 173 | ||
| arch: | ||
| gspr_num: 1 | ||
| gspr_groups: |
Member
There was a problem hiding this comment.
Suggested change
| gspr_groups: | |
| gpsr_groups: |
typo.
Also, the config generator needs to generate a cast. the output should be
.arch = {
.gpsr_num = 1,
.gpsr_groups = (unsigned long int[]){1},
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR integrates Bao Kao (abbreviated as bkao, "to put to the test"), an end-to-end testing (and benchmarking) framework for the Bao Hypervisor. Bao Kao automates the full pipeline from source build to on-target execution: it fetches toolchains, builds guest workloads, generates Bao configuration files based on targeted setup from YAML descriptors, assembles a bootable image (with optional firmware), launches it on the target platform (emulated or physical), and captures serial output to determine pass/fail.
Two new submodules are introduced:
Platforms supported:
Note
This PR supersedes #154. We have refactored completely the framework, removing nix support and leveraging only python to implement bao kao.
Source Tree Structure
Tests Available
Tests are defined using the
BAO_TEST(suite, test, setup, description)macro and discovered automatically at runtime by scanningtests/tests/src/*.c. Each test is tagged with a suite, a setup (which selects the VM configuration to use), and an ID used for selective execution.IDs are computed as
(file_index × 100) + test_index_within_file, where:tests/tests/src/
So with the current files (boot.c, irq.c):
Guest types supported in test configs: baremetal, freertos, linux. For now, we only target a baremetal setup.
How to Run (TLDR)
Via bao Makefile targets:
Run all tests for a platform:
make tests PLATFORM=<platform>Run all benchmarks for a platform:
make benchs PLATFORM=<platform>Other options only via calling bkao-py directly:
Run specific tests or benchmarks by ID:
python3 tests/bkao/src/bkao.py -t 100 101 -p <platform>python3 tests/bkao/src/bkao.py -b 100 -p <platform>Run all tests except some:
python3 bkao.py -t -x 200,201 -p <platform>Skip firmware and toolchain rebuild (faster iteration):
python3 bkao.py -t -p <platform> --no-firmware-build --no-toolchain-buildUse custom hypervisor sources:
python3 bkao.py -t -p <platform> --hyp-srcs /path/to/baoSet verbosity (0=final report only, 1=failures, 2=all):
python3 bkao.py -t -p <platform> -l 2Pass platform-specific args - only virtual platforms (e.g. GIC version):
python3 bkao.py -t -p qemu-aarch64-virt --plat-virt-args "GICV3"Bao Kao Process Pipeline
For each test or benchmark, bkao executes the following pipeline:
tests/tests/src/*.cforBAO_TESTmacros,benchs/src/benchmarks/for benchmark dirs, andplatforms/*.pyfor platform builders.[TESTF-C]tokens for pass/fail.