Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove redundant kargs assertions #3247

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions test/e2e-shared-tests/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/openshift/machine-config-operator/pkg/daemon/constants"
"github.com/openshift/machine-config-operator/test/framework"
"github.com/openshift/machine-config-operator/test/helpers"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
kubeErrs "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/apimachinery/pkg/util/wait"
Expand All @@ -21,22 +20,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func assertKernelArgsEqual(t *testing.T, cs *framework.ClientSet, target corev1.Node, startKargs string, expectedKargs []string) {
t.Helper()

kargs := getKernelArgs(t, cs, target)

for _, karg := range expectedKargs {
assert.Contains(t, kargs, karg, "Missing karg %s", karg)
}

assert.Equal(t, kargs, startKargs)
}

func getKernelArgs(t *testing.T, cs *framework.ClientSet, target corev1.Node) string {
return helpers.ExecCmdOnNode(t, cs, target, "cat", "/proc/cmdline")
}

func waitForConfigDriftMonitorStart(t *testing.T, cs *framework.ClientSet, node corev1.Node) {
t.Helper()

Expand Down
11 changes: 1 addition & 10 deletions test/e2e-shared-tests/mcd_config_drift.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (c configDriftTest) getMachineConfig(t *testing.T) *mcfgv1.MachineConfig {
[]ign3types.SSHAuthorizedKey{},
[]string{},
false,
[]string{"foo=bar", "foo=baz"},
[]string{},
"",
"",
)
Expand All @@ -164,12 +164,6 @@ func (c configDriftTest) Teardown(t *testing.T) {

// Runs the Config Drift Test
func (c configDriftTest) Run(t *testing.T) {
// Get our kernel args for future verification
kargs := getKernelArgs(t, c.ClientSet, c.node)

// Check that we have our kernel args pre-test
assertKernelArgsEqual(t, c.ClientSet, c.node, kargs, c.mc.Spec.KernelArguments)

testCases := []struct {
name string
rebootExpected bool
Expand Down Expand Up @@ -238,9 +232,6 @@ func (c configDriftTest) Run(t *testing.T) {

testCase.testFunc(t)

// Ensure that we have our kernel args post-test
assertKernelArgsEqual(t, c.ClientSet, c.node, kargs, c.mc.Spec.KernelArguments)

// Verify our reboot expectations
if testCase.rebootExpected {
helpers.AssertNodeReboot(t, c.ClientSet, c.node, initialUptime)
Expand Down