Skip to content

Commit 010c9b8

Browse files
committed
feat(kao): add support for bao kao testing framework
Signed-off-by: Daniel Oliveira <drawnpoetry@gmail.com> Signed-off-by: Diogo Costa <diogoandreveigacosta@gmail.com> Signed-off-by: Miguel Silva <miguelafsilva5@gmail.com>
1 parent 02f612a commit 010c9b8

105 files changed

Lines changed: 53300 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test-bkao.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Bao Kao Testing Framework
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
10+
jobs:
11+
12+
run-tests:
13+
runs-on: ubuntu-latest
14+
container:
15+
image: baoproject/bao:latest
16+
options: --user root
17+
strategy:
18+
matrix:
19+
platform: [
20+
"qemu-aarch64-virt",
21+
"qemu-riscv64-virt",
22+
"fvp-a",
23+
"fvp-r"
24+
]
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
submodules: recursive
29+
30+
- name: Mark workspace as safe for Git
31+
run: git config --global --add safe.directory $GITHUB_WORKSPACE
32+
33+
- name: Checkout private benchmarks submodule
34+
env:
35+
TOKEN: ${{ secrets.BENCHMARKS_TOKEN }}
36+
run: |
37+
git config --global url."https://x-access-token:${TOKEN}@github.com/".insteadOf "git@github.com:"
38+
git submodule update --init tests/benchs
39+
40+
- name: Run bao kao tests
41+
run: make tests PLATFORM=${{ matrix.platform }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
bin/*
22
build/*
3+
**/wrkdir/
34
*.o
45
*.elf
56
*.bin

.gitmodules

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
[submodule "ci"]
22
path = ci
33
url = git@github.com:bao-project/bao-ci.git
4+
[submodule "tests/kao"]
5+
path = tests/kao
6+
url = git@github.com:bao-project/bao-kao.git
7+
[submodule "tests/benchs"]
8+
path = tests/benchs
9+
url = git@github.com:osyxtechnologies/bao-benchmarks.git
10+
update = none

Makefile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ configs_dir=$(cur_dir)/configs
6868
CONFIG_REPO?=$(configs_dir)
6969
scripts_dir:=$(cur_dir)/scripts
7070
ci_dir:=$(cur_dir)/ci
71+
tests_dir:=$(cur_dir)/tests
72+
kao_dir:=$(tests_dir)/kao/src
7173
src_dirs:=
7274

7375
-include $(ci_dir)/ci.mk
@@ -76,7 +78,7 @@ targets:=$(MAKECMDGOALS)
7678
ifeq ($(targets),)
7779
targets:=all
7880
endif
79-
non_build_targets+=ci clean
81+
non_build_targets+=ci clean tests benchs
8082
build_targets:=$(strip $(foreach target, $(targets), \
8183
$(if $(findstring $(target),$(non_build_targets)),,$(target))))
8284

@@ -437,3 +439,17 @@ $(call ci, format, $(all_c_files))
437439
ci: license-check format-check
438440

439441
endif
442+
443+
-include $(tests_dir)/tests.mk
444+
445+
.PHONY: tests
446+
447+
tests:
448+
@echo "Running bao-kao tests for $(PLATFORM)..."
449+
@python3 $(kao_dir)/kao.py -t -p $(PLATFORM)
450+
451+
.PHONY: benchs
452+
453+
benchs:
454+
@echo "Running bao-kao benchmarks for $(PLATFORM)..."
455+
@python3 $(kao_dir)/kao.py -b -p $(PLATFORM)

tests/benchs

Submodule benchs added at a9db838

tests/kao

Submodule kao added at 8b5fc44
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Bao Hypervisor VM Configuration
2+
# This YAML describes the fields needed to generate a C config file (config.c)
3+
4+
vms:
5+
- vm1:
6+
name: "baremetal"
7+
build_options: ""
8+
config:
9+
image:
10+
base_addr: 0x90000000
11+
entry: 0x90000000
12+
platform:
13+
cpu_num: 4
14+
regions:
15+
- base: 0x90000000
16+
size: 0x4000000
17+
devs:
18+
- pa: 0x1c090000
19+
va: 0x1c090000
20+
size: 0x10000
21+
interrupts:
22+
- 37
23+
- interrupts:
24+
- 27
25+
arch:
26+
gic:
27+
gicd_addr: 0x2F000000
28+
gicr_addr: 0x2F100000
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Bao Hypervisor VM Configuration
2+
# This YAML describes the fields needed to generate a C config file (config.c)
3+
4+
vms:
5+
- vm1:
6+
name: "baremetal"
7+
build_options: "MEM_BASE=0x10000000"
8+
config:
9+
image:
10+
load_addr: 0x10000000
11+
phys_addr: 0x10000000
12+
size: 102400
13+
entry: 0x10000000
14+
platform:
15+
cpu_num: 4
16+
regions:
17+
- base: 0x10000000
18+
size: 0x4000000
19+
devs:
20+
- pa: 0x9c0A0000
21+
va: 0x9c0A0000
22+
size: 0x10000
23+
interrupts:
24+
- 38
25+
- interrupts:
26+
- 27
27+
arch:
28+
gic:
29+
gicd_addr: 0xAF000000
30+
gicr_addr: 0xAF100000
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
3+
# Bao Hypervisor VM Configuration
4+
# This YAML describes the fields needed to generate a C config file (config.c)
5+
6+
vms:
7+
- vm1:
8+
name: "baremetal"
9+
build_options:
10+
config:
11+
image:
12+
base_addr: 0x50000000
13+
entry: 0x50000000
14+
platform:
15+
cpu_num: 4
16+
regions:
17+
- base: 0x50000000
18+
size: 0x4000000
19+
devs:
20+
- pa: 0x9000000
21+
va: 0x9000000
22+
size: 0x10000
23+
interrupts:
24+
- 33
25+
- interrupts:
26+
- 27
27+
arch:
28+
gic:
29+
gicd_addr: 0x08000000
30+
gicr_addr: 0x080A0000
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Bao Hypervisor VM Configuration
2+
# This YAML describes the fields needed to generate a C config file (config.c)
3+
4+
vms:
5+
- vm1:
6+
name: "baremetal"
7+
build_options:
8+
config:
9+
image:
10+
base_addr: 0x80200000
11+
entry: 0x80200000
12+
platform:
13+
cpu_num: 4
14+
regions:
15+
- base: 0x80200000
16+
size: 0x4000000
17+
devs:
18+
- pa: 0x10000000
19+
va: 0x10000000
20+
size: 0x1000
21+
interrupts:
22+
- 10
23+
arch:
24+
irqc:
25+
plic:
26+
base: 0xc000000

0 commit comments

Comments
 (0)