Skip to content
Open
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TEST_IMAGE := quay.io/skupper/skupper-tests
TEST_BINARIES_FOLDER := ${PWD}/test/integration/bin
DOCKER := docker
LDFLAGS := -X github.com/skupperproject/skupper/pkg/version.Version=${VERSION}
PLATFORMS ?= linux/amd64,linux/arm64
PLATFORMS ?= linux/amd64,linux/arm64,linux/s390x
GOOS ?= linux
GOARCH ?= amd64

Expand Down
2 changes: 1 addition & 1 deletion test/images/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ SKOPEO = skopeo
# That is required for their use with Openshift 3.11
FORMAT_OPTIONS = --format docker
TRANSFORM_OPTIONS = --format v2s2
PLATFORM = linux/amd64,linux/arm64
PLATFORM = linux/amd64,linux/arm64,linux/s390x

# Repositories
MAIN_REPO = quay.io/skupper
Expand Down
4 changes: 4 additions & 0 deletions test/integration/acceptance/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"strconv"
"testing"
"time"
"runtime"

"github.com/skupperproject/skupper/test/integration/acceptance/gateway"
"github.com/skupperproject/skupper/test/integration/examples/tcp_echo"
Expand Down Expand Up @@ -49,6 +50,9 @@ func TestGateway(t *testing.T) {
// port reaching out tcp-echo-cluster service using a
// dynamic port
func testLocalGatewayService(t *testing.T) {
if runtime.GOARCH == "s390x" {
t.Skip("Skipping test on s390x architecture as skupper router binary is unavailable for 1.x versions")
}
testLocalGateway(t, "")
}

Expand Down
11 changes: 11 additions & 0 deletions test/integration/examples/bookinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,22 @@ import (
"testing"

"github.com/skupperproject/skupper/test/integration/examples/bookinfo"
"github.com/skupperproject/skupper/test/utils/base"
"github.com/skupperproject/skupper/test/utils/arch"
_ "k8s.io/client-go/plugin/pkg/client/auth"
)

func TestBookinfo(t *testing.T) {
// Get the cluster context
cluster := base.GetClusterContext()

// Skip test if the cluster architecture is s390x
if err := arch.SkipOnlyS390x(t, cluster); err != nil {
t.Fatal(err)
}

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

bookinfo.Run(ctx, t, testRunner)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import (
"log"
"os"
"testing"
"runtime"

"github.com/skupperproject/skupper/test/utils/base"
"github.com/skupperproject/skupper/test/utils/constants"
"github.com/skupperproject/skupper/test/utils/k8s"
"github.com/skupperproject/skupper/test/utils/arch"
"gotest.tools/assert"
)

Expand All @@ -29,6 +31,13 @@ func TestMain(m *testing.M) {
}

func TestHipsterShop(t *testing.T) {

//Skipping test on s390x architecture as images unavailable for s390x
cluster := base.GetClusterContext()
if err := arch.SkipOnlyS390x(t, cluster); err != nil {
t.Fatal(err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check failed because of incorrect Go formatting. This is one such case (missing indent). Please fix these so the check passes.

}

// Cluster needs for hipster shop
needs := base.ClusterNeeds{
NamespaceId: "hipster",
Expand Down
8 changes: 8 additions & 0 deletions test/integration/examples/mongo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ import (
"testing"

"github.com/skupperproject/skupper/test/integration/examples/mongodb"
"github.com/skupperproject/skupper/test/utils/arch"
"github.com/skupperproject/skupper/test/utils/base"
)

func TestMongo(t *testing.T) {
// Skip test if the cluster architecture is s390x
cluster := base.GetClusterContext()
if err := arch.SkipOnlyS390x(t, cluster); err != nil {
t.Fatal(err)
}

mongodb.Run(context.Background(), t, testRunner)
}
7 changes: 7 additions & 0 deletions test/integration/performance/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ import (
"strconv"
"strings"
"testing"
"runtime"
"time"

"github.com/skupperproject/skupper/test/integration/performance/common"
"github.com/skupperproject/skupper/test/utils/base"
"github.com/skupperproject/skupper/test/utils/k8s"
"github.com/skupperproject/skupper/test/utils/arch"
"gotest.tools/assert"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
Expand Down Expand Up @@ -45,6 +47,11 @@ type postgresSettings struct {
}

func TestPostgres(t *testing.T) {
// Skip test if the cluster architecture is s390x
cluster := base.GetClusterContext()
if err := arch.SkipOnlyS390x(t, cluster); err != nil {
t.Fatal(err)
}
// TestPostgres is currently not functional for ARM
// https://github.com/skupperproject/skupper/issues/1650
common.CheckArch(t)
Expand Down
35 changes: 35 additions & 0 deletions test/utils/arch/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,38 @@ func Skip(t *testing.T, clusters ...*base.ClusterContext) error {
}
return err
}

// CheckOnlyS390x skips ONLY if the architecture is s390x
func CheckOnlyS390x(clusters ...*base.ClusterContext) (err error, skip bool) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would have been best to generalize Check(), as listed on its TODO, but this works fine


ctx, cancel := context.WithTimeout(context.Background(), time.Minute*10)
defer cancel()

for _, c := range clusters {
list, err := c.VanClient.KubeClient.CoreV1().Nodes().List(ctx, v1.ListOptions{})
if err != nil {
return err, false
}
for _, node := range list.Items {
arch := node.Labels["beta.kubernetes.io/arch"]
if arch == "s390x" {
return fmt.Errorf(
"at least one cluster node is s390x -- skipping (%s at %s is %q)",
node.Name,
c.VanClient.RestConfig.Host,
arch,
), true
}
}
}
return nil, false
}

// SkipOnlyS390x skips the test only for s390x clusters
func SkipOnlyS390x(t *testing.T, clusters ...*base.ClusterContext) error {
err, skip := CheckOnlyS390x(clusters...)
if skip {
t.Skipf("%v", err)
}
return err
}