Skip to content

Commit

Permalink
test/e2e: check that kernel-rt-core pacakge is installed
Browse files Browse the repository at this point in the history
It seems the kernel-rt-core package may change uname -a
content. In older package it included substring PREEMPT RT
which we were using to determine that current booted kernel
in rt kernel. This changed recently to PREEMPT_RT, due to
which tests started failing.

To test if node is on rt-kernel, check that kernel-rt-core
package is installed.
  • Loading branch information
sinnykumari committed Jul 31, 2020
1 parent 7f08777 commit 373ddae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/e2e/mcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ func TestKernelType(t *testing.T) {
assert.Equal(t, infraNode.Annotations[constants.CurrentMachineConfigAnnotationKey], renderedConfig)
assert.Equal(t, infraNode.Annotations[constants.MachineConfigDaemonStateAnnotationKey], constants.MachineConfigDaemonStateDone)

kernelInfo := execCmdOnNode(t, cs, infraNode, "uname", "-a")
if !strings.Contains(kernelInfo, "PREEMPT RT") {
kernelInfo := execCmdOnNode(t, cs, infraNode, "chroot", "/rootfs", "rpm", "-qa", "kernel-rt-core")
if !strings.Contains(kernelInfo, "kernel-rt-core") {
t.Fatalf("Node %s doesn't have expected kernel", infraNode.Name)
}
t.Logf("Node %s has expected kernel", infraNode.Name)
Expand All @@ -210,8 +210,8 @@ func TestKernelType(t *testing.T) {

assert.Equal(t, infraNode.Annotations[constants.CurrentMachineConfigAnnotationKey], oldInfraRenderedConfig)
assert.Equal(t, infraNode.Annotations[constants.MachineConfigDaemonStateAnnotationKey], constants.MachineConfigDaemonStateDone)
kernelInfo = execCmdOnNode(t, cs, infraNode, "uname", "-a")
if strings.Contains(kernelInfo, "PREEMPT RT") {
kernelInfo = execCmdOnNode(t, cs, infraNode, "chroot", "/rootfs", "rpm", "-qa", "kernel-rt-core")
if strings.Contains(kernelInfo, "kernel-rt-core") {
t.Fatalf("Node %s did not rollback successfully", infraNode.Name)
}
t.Logf("Node %s has successfully rolled back", infraNode.Name)
Expand Down

0 comments on commit 373ddae

Please sign in to comment.