Skip to content

Commit 070590a

Browse files
JackThomson2Firecracker CI
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 5149dfe commit 070590a

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-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 nonci 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",

resources/hiding_ci/build_and_install_kernel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ apply_series_mbox() {
6969
apply_series_link() {
7070
patch_url=$(cat $1)
7171
echo "Fetching mbox from:" $patch_url
72-
wget -O lore.mbox.gz "$patch_url/t.mbox.gz"
72+
curl --output lore.mbox.gz "$patch_url/t.mbox.gz"
7373
gunzip lore.mbox
7474
apply_series_mbox lore.mbox
7575
rm lore.mbox
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.nonci
12+
def test_build_hiding_kernel():
13+
"""
14+
In the test we will run our kernel build script to check it succeeds an 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+
)

0 commit comments

Comments
 (0)