Skip to content

Commit

Permalink
fix new references in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jkyros committed Jul 22, 2023
1 parent ce9ee2f commit eadee47
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 32 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/build/build_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"time"

ign3types "github.com/coreos/ignition/v2/config/v3_2/types"
ign3types "github.com/coreos/ignition/v2/config/v3_4/types"
buildv1 "github.com/openshift/api/build/v1"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/build/fixtures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
"time"

ign3types "github.com/coreos/ignition/v2/config/v3_2/types"
ign3types "github.com/coreos/ignition/v2/config/v3_4/types"
"github.com/davecgh/go-spew/spew"
"github.com/ghodss/yaml"
buildv1 "github.com/openshift/api/build/v1"
Expand Down
34 changes: 4 additions & 30 deletions pkg/controller/common/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func TestParseAndConvert(t *testing.T) {
testIgn3Config.Ignition.Version = "3.1.0"
// turn it into a raw []byte
rawIgn = helpers.MarshalOrDie(testIgn3Config)
// check that it was parsed successfully back to 3.2
// check that it was parsed successfully back to the default version
convertedIgn, err = ParseAndConvertConfig(rawIgn)
require.Nil(t, err)
testIgn3Config.Ignition.Version = InternalMCOIgnitionVersion
Expand All @@ -217,7 +217,7 @@ func TestParseAndConvert(t *testing.T) {
testIgn3Config.Ignition.Version = "3.0.0"
// turn it into a raw []byte
rawIgn = helpers.MarshalOrDie(testIgn3Config)
// check that it was parsed successfully back to 3.2
// check that it was parsed successfully back to the default version
convertedIgn, err = ParseAndConvertConfig(rawIgn)
require.Nil(t, err)
testIgn3Config.Ignition.Version = InternalMCOIgnitionVersion
Expand All @@ -227,7 +227,7 @@ func TestParseAndConvert(t *testing.T) {
testIgn3Config.Ignition.Version = "3.3.0"
// turn it into a raw []byte
rawIgn = helpers.MarshalOrDie(testIgn3Config)
// check that it was parsed successfully back to 3.2
// check that it was parsed successfully back to the default version
convertedIgn, err = ParseAndConvertConfig(rawIgn)
require.Nil(t, err)
testIgn3Config.Ignition.Version = InternalMCOIgnitionVersion
Expand All @@ -237,38 +237,12 @@ func TestParseAndConvert(t *testing.T) {
testIgn3Config.Ignition.Version = "3.4.0"
// turn it into a raw []byte
rawIgn = helpers.MarshalOrDie(testIgn3Config)
// check that it was parsed successfully back to 3.2
// check that it was parsed successfully back to the default version
convertedIgn, err = ParseAndConvertConfig(rawIgn)
require.Nil(t, err)
testIgn3Config.Ignition.Version = InternalMCOIgnitionVersion
assert.Equal(t, testIgn3Config, convertedIgn)

/*
// Make a an Ign 3.4 cfg with kargs
testIgn3Config.Ignition.Version = "3.4.0"
var ign34 ign3_4types.Config
// Parse this up to 3.4 specifically so we can test a downgrade that
// is using kargs
ign34, _, err = ign3_4.ParseCompatibleVersion(rawIgn)
require.Nil(t, err)
ign34.KernelArguments = ign3_4types.KernelArguments{
ShouldExist: []ign3_4types.KernelArgument{"one", "two", "three"},
ShouldNotExist: []ign3_4types.KernelArgument{"four", "five", "six"},
}
// turn it into a raw []byte
rawIgn = helpers.MarshalOrDie(ign34)
// check that it was parsed successfully back to 3.2
// this should strip out the kernel args
convertedIgn, err = ParseAndConvertConfig(rawIgn)
require.Nil(t, err)
testIgn3Config.Ignition.Version = "3.2.0"
// we compare to testign3Config because kargs should get stripped out
assert.Equal(t, testIgn3Config, convertedIgn)
*/

// Make a bad Ign3 cfg
testIgn3Config.Ignition.Version = "21.0.0"
rawIgn = helpers.MarshalOrDie(testIgn3Config)
Expand Down

0 comments on commit eadee47

Please sign in to comment.