Skip to content
Merged
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
27 changes: 0 additions & 27 deletions test/e2e-iri/iri_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"encoding/pem"
"fmt"
"net/http"
"os"
"reflect"
"strings"
"testing"
Expand All @@ -22,7 +21,6 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"

configv1 "github.com/openshift/api/config/v1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1"
ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common"
Expand Down Expand Up @@ -302,31 +300,6 @@ func TestIRIController_VerifyIRIRegistryOnAllTheMasterNodes_NoCert(t *testing.T)
}
}

func skipIfNoBaremetal(t *testing.T) {
infra, err := framework.NewClientSet("").Infrastructures().Get(context.Background(), "cluster", v1.GetOptions{})
require.NoError(t, err)
if infra.Status.PlatformStatus.Type != configv1.BareMetalPlatformType {
t.Skip("Skipping non-baremetal platforms")
}
}

// Currently some tests are not supported in the OpenShift CI
// environment (due the proxy settings)
func skipIfOpenShiftCI(t *testing.T) {
items := []string{
// Specific to OpenShift CI.
"OPENSHIFT_CI",
// Common to all CI systems.
"CI",
}

for _, item := range items {
if _, ok := os.LookupEnv(item); ok {
t.Skip("Skipping OpenShift CI environment")
}
}
}

func TestIRIController_VerifyIRIRegistryOnApiInt_WithCert(t *testing.T) {
skipIfOpenShiftCI(t)
skipIfNoBaremetal(t)
Expand Down
27 changes: 27 additions & 0 deletions test/e2e-iri/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import (
"testing"

"github.com/openshift/api/features"
"github.com/stretchr/testify/require"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

configv1 "github.com/openshift/api/config/v1"
"github.com/openshift/machine-config-operator/test/framework"
)

Expand Down Expand Up @@ -42,3 +44,28 @@ func skipIRITests() (bool, error) {

return false, nil
}

func skipIfNoBaremetal(t *testing.T) {
infra, err := framework.NewClientSet("").Infrastructures().Get(context.Background(), "cluster", v1.GetOptions{})
require.NoError(t, err)
if infra.Status.PlatformStatus.Type != configv1.BareMetalPlatformType {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
t.Skip("Skipping non-baremetal platforms")
}
}

// Currently some tests are not supported in the OpenShift CI
// environment (due the proxy settings)
func skipIfOpenShiftCI(t *testing.T) {
items := []string{
// Specific to OpenShift CI.
"OPENSHIFT_CI",
// Common to all CI systems.
"CI",
}

for _, item := range items {
if _, ok := os.LookupEnv(item); ok {
t.Skip("Skipping OpenShift CI environment")
}
}
}