Skip to content

Commit 2052162

Browse files
authored
fix: add fips tests and downgrade 2004 containerd (#8380)
1 parent fa16129 commit 2052162

4 files changed

Lines changed: 35 additions & 22 deletions

File tree

e2e/config/vhd.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ var (
6060
Distro: datamodel.AKSUbuntuContainerd2204Gen2,
6161
Gallery: imageGalleryLinux,
6262
}
63+
VHDUbuntu2004FIPSContainerd = &Image{
64+
Name: "2004fipscontainerd",
65+
OS: OSUbuntu,
66+
Arch: "amd64",
67+
Distro: datamodel.AKSUbuntuFipsContainerd2004,
68+
Gallery: imageGalleryLinux,
69+
UnsupportedLocalDns: true,
70+
// Secure TLS Bootstrapping isn't currently supported on FIPS-enabled VHDs
71+
UnsupportedSecureTLSBootstrapping: true,
72+
UnsupportedGen2: true,
73+
}
6374
VHDUbuntu2204FIPSContainerd = &Image{
6475
Name: "2204fipscontainerd",
6576
OS: OSUbuntu,

e2e/scenario_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,23 @@ func Test_Ubuntu2204FIPS(t *testing.T) {
686686
})
687687
}
688688

689+
func Test_Ubuntu2004FIPS(t *testing.T) {
690+
RunScenario(t, &Scenario{
691+
Description: "Tests that a node using the Ubuntu 2004 FIPS Gen1 VHD can be properly bootstrapped",
692+
Config: Config{
693+
Cluster: ClusterKubenet,
694+
VHD: config.VHDUbuntu2004FIPSContainerd,
695+
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
696+
},
697+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
698+
},
699+
Validator: func(ctx context.Context, s *Scenario) {
700+
ValidateSSHServiceEnabled(ctx, s)
701+
},
702+
},
703+
})
704+
}
705+
689706
func Test_Ubuntu2204Gen2FIPS(t *testing.T) {
690707
RunScenario(t, &Scenario{
691708
Description: "Tests that a node using the Ubuntu 2204 FIPS Gen2 VHD can be properly bootstrapped",

parts/common/components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@
11371137
"versionsV2": [
11381138
{
11391139
"renovateTag": "name=moby-containerd, repository=production, os=ubuntu, release=20.04",
1140-
"latestVersion": "1.7.31-ubuntu20.04u1"
1140+
"latestVersion": "1.7.30-ubuntu20.04u3"
11411141
}
11421142
]
11431143
}

vhdbuilder/packer/test/linux-vhd-content-test.sh

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -607,33 +607,18 @@ testLtsKernel() {
607607
if [[ "$os_sku" == "Ubuntu" && ${enable_fips,,} != "true" ]] ; then
608608
echo "OS is Ubuntu, FIPS is not enabled, check LTS kernel version"
609609
# Check the Ubuntu version and set the expected kernel version
610-
# CVM builds use linux-image-azure-fde-lts-* (different flavor), skip exact pin check
611-
local is_cvm=false
612-
if grep -q "cvm" <<< "$FEATURE_FLAGS"; then
613-
is_cvm=true
614-
fi
615-
616-
if [ "$os_version" = "22.04" ] && [ "$is_cvm" = "false" ]; then
617-
# Pinned to exact version to avoid regression in 5.15.0-1103-azure
618-
expected_kernel="5.15.0-1102-azure"
619-
elif [ "$os_version" = "22.04" ] || [ "$os_version" = "24.04" ]; then
620-
expected_kernel=$([ "$os_version" = "22.04" ] && echo "5.15" || echo "6.8")
610+
if [ "$os_version" = "22.04" ]; then
611+
expected_kernel="5.15"
612+
elif [ "$os_version" = "24.04" ]; then
613+
expected_kernel="6.8"
621614
else
622-
echo "LTS kernel not installed for: $os_version, skipping check"
623-
echo "$test:Finish"
624-
return
615+
echo "LTS kernel not installed for: $os_version"
625616
fi
626617

627618
kernel=$(uname -r)
628619
echo "Current kernel version: $kernel"
629620
# shellcheck disable=SC3010
630-
if [ "$os_version" = "22.04" ] && [ "$is_cvm" = "false" ]; then
631-
if [[ "$kernel" == "$expected_kernel" ]]; then
632-
echo "Kernel version matches pinned version ($expected_kernel)."
633-
else
634-
err $test "Kernel version does not match pinned version. Expected exactly $expected_kernel, found $kernel."
635-
fi
636-
elif [[ "$kernel" == *"$expected_kernel"* ]]; then
621+
if [[ "$kernel" == *"$expected_kernel"* ]]; then
637622
echo "Kernel version is as expected ($expected_kernel)."
638623
else
639624
err $test "Kernel version is not as expected. Expected $expected_kernel, found $kernel."

0 commit comments

Comments
 (0)