Skip to content

Commit

Permalink
chore: add tests for util-linux extensions
Browse files Browse the repository at this point in the history
Add tests for utils-linux extensions.

Ref: siderolabs/extensions#216

Signed-off-by: Noel Georgi <git@frezbo.dev>
  • Loading branch information
frezbo committed Sep 5, 2023
1 parent 7c514a1 commit 3fbed80
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CLOUD_IMAGES_EXTRA_ARGS ?= ""

ARTIFACTS := _out
TOOLS ?= ghcr.io/siderolabs/tools:v1.6.0-alpha.0
PKGS ?= v1.6.0-alpha.0-8-gcca80b7
PKGS ?= v1.6.0-alpha.0-10-gd3d7d29
EXTRAS ?= v1.5.0
# renovate: datasource=github-tags depName=golang/go
GO_VERSION ?= 1.21
Expand Down
2 changes: 1 addition & 1 deletion hack/release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This also ensures that the linux-firmware is not tied to a specific Talos versio
[notes.updates]
title = "Component Updates"
description = """\
Linux: 6.1.46
Linux: 6.1.51
CoreDNS: v1.11.1
Kubernetes: v1.28.1
Expand Down
2 changes: 1 addition & 1 deletion internal/integration/api/extensions_nvidia.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (suite *ExtensionsSuiteNVIDIA) TestExtensionsNVIDIA() {

for _, pod := range podList.Items {
if pod.Status.Phase != corev1.PodSucceeded {
return retry.ExpectedErrorf("pod is not completed yet: %s", pod.Status.Phase)
return retry.ExpectedErrorf("%s is not completed yet: %s", pod.Name, pod.Status.Phase)
}
}

Expand Down
44 changes: 44 additions & 0 deletions internal/integration/api/extensions_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,50 @@ func (suite *ExtensionsSuiteQEMU) TestExtensionsZFS() {
checkZFSVolumePathPopulatedByUdev()
}

// TestExtensionsUtilLinuxTools verifies util-linux-tools are working.
func (suite *ExtensionsSuiteQEMU) TestExtensionsUtilLinuxTools() {
_, err := suite.Clientset.CoreV1().Pods("kube-system").Create(suite.ctx, &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "util-linux-tools-test",
},
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: "util-linux-tools-test",
Image: "alpine",
Command: []string{
"tail",
"-f",
"/dev/null",
},
SecurityContext: &corev1.SecurityContext{
Privileged: pointer.To(true),
},
},
},
HostNetwork: true,
HostPID: true,
},
}, metav1.CreateOptions{})
defer suite.Clientset.CoreV1().Pods("kube-system").Delete(suite.ctx, "util-linux-tools-test", metav1.DeleteOptions{}) //nolint:errcheck

suite.Require().NoError(err)

// wait for the pod to be ready
suite.Require().NoError(suite.WaitForPodToBeRunning(suite.ctx, 10*time.Minute, "kube-system", "util-linux-tools-test"))

stdout, stderr, err := suite.ExecuteCommandInPod(
suite.ctx,
"kube-system",
"util-linux-tools-test",
"nsenter --mount=/proc/1/ns/mnt -- /usr/local/sbin/fstrim --version",
)
suite.Require().NoError(err)

suite.Require().Equal("", stderr)
suite.Require().Contains(stdout, "fstrim from util-linux")
}

func init() {
allSuites = append(allSuites, &ExtensionsSuiteQEMU{})
}
2 changes: 1 addition & 1 deletion pkg/machinery/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

const (
// DefaultKernelVersion is the default Linux kernel version.
DefaultKernelVersion = "6.1.46-talos"
DefaultKernelVersion = "6.1.51-talos"

// DefaultKernelModulesPath is the default path to the kernel modules.
DefaultKernelModulesPath = "/lib/modules" + "/" + DefaultKernelVersion
Expand Down
2 changes: 1 addition & 1 deletion pkg/machinery/gendata/data/pkgs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.6.0-alpha.0-8-gcca80b7
v1.6.0-alpha.0-10-gd3d7d29

0 comments on commit 3fbed80

Please sign in to comment.