Skip to content

Commit 08ee93c

Browse files
JackThomson2roypat
authored andcommitted
test: Add test for kernel build
Adding a new integration test to assert that the kernel build script will succeed. Signed-off-by: Jack Thomson <[email protected]>
1 parent 8441941 commit 08ee93c

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

.buildkite/pipeline_pr.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@
6868
for step in kani_grp["steps"]:
6969
step["label"] = "🔍 Kani"
7070

71+
if any(x.parent.name == "hiding_ci" for x in changed_files):
72+
pipeline.build_group_per_arch(
73+
"🕵️ Build Secret Hiding Kernel",
74+
pipeline.devtool_test(
75+
pytest_opts="-m secret_hiding integration_tests/build/test_hiding_kernel.py",
76+
),
77+
depends_on_build=False,
78+
)
79+
7180
if run_all_tests(changed_files):
7281
pipeline.build_group(
7382
"📦 Build",

tests/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ which tests are run in which context:
340340
in separate pipelines according to various cron schedules.
341341
- Tests marked as `no_block_pr` are run in the "optional" PR CI pipeline. This
342342
pipeline is not required to pass for merging a PR.
343+
- Tests marked as `secret_hiding` are secret hiding specifc tests. They don't
344+
run by default.
343345
344346
All tests without markers are run for every pull request, and are required to
345347
pass for the PR to be merged.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
"""A test which checks that the secret hiding enable kernel builds successfully."""
4+
5+
import pytest
6+
7+
from framework import utils
8+
9+
10+
@pytest.mark.timeout(600)
11+
@pytest.mark.secret_hiding
12+
def test_build_hiding_kernel():
13+
"""
14+
In the test we will run our kernel build script to check it succeeds and builds the hidden kernel
15+
"""
16+
17+
# We have some extra deps for building the kernel that are not in the dev contaner
18+
utils.check_output(
19+
"apt install -y build-essential libncurses-dev bison flex libssl-dev libelf-dev bc dwarves libncurses5-dev kmod fakeroot"
20+
)
21+
22+
# We have to configure git otherwise patch application fails
23+
# the git log still credits the original author
24+
utils.check_output('git config --global user.name "Firecracker CI"')
25+
utils.check_output('git config --global user.email "[email protected]"')
26+
27+
utils.check_output(
28+
"cd ../resources/hiding_ci; ./build_and_install_kernel.sh --no-install --tidy"
29+
)

tests/pytest.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ addopts =
55
-vv
66
--durations=10
77
--showlocals
8-
-m 'not nonci and not no_block_pr'
8+
-m 'not nonci and not no_block_pr and not secret_hiding'
99
--json-report --json-report-file=../test_results/test-report.json
1010

1111
markers =
1212
no_block_pr: tests whose failure does not block PR merging.
1313
nonci: mark test as nonci.
14+
secret_hiding: tests related to secret hiding.
1415

1516
; Overwrite the default norecursedirs, which includes 'build'.
1617
norecursedirs = .*

0 commit comments

Comments
 (0)