Skip to content

Commit

Permalink
vCore: numa test suite (#69)
Browse files Browse the repository at this point in the history
* Vcore: numatest suite

* bump vendors
  • Loading branch information
elenagerman authored Jun 27, 2024
1 parent 0401912 commit 5cc1c2b
Show file tree
Hide file tree
Showing 22 changed files with 1,331 additions and 432 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/nmstate/kubernetes-nmstate/api v0.0.0-20240605150941-df565dd7bf35
github.com/onsi/ginkgo/v2 v2.19.0
github.com/onsi/gomega v1.33.1
github.com/openshift-kni/eco-goinfra v0.0.0-20240621192821-7c55fda74f32 // release-4.15
github.com/openshift-kni/eco-goinfra v0.0.0-20240626143745-4d019aeb6f02 // release-4.15
github.com/openshift-kni/k8sreporter v1.0.5
github.com/openshift/api v3.9.1-0.20191111211345-a27ff30ebf09+incompatible
github.com/openshift/assisted-service/api v0.0.0
Expand All @@ -44,6 +44,7 @@ require (
github.com/kedacore/keda-olm-operator v0.0.0-20240501182040-762f6be5a942
github.com/kedacore/keda/v2 v2.14.0
github.com/openshift-kni/lifecycle-agent v0.0.0-20240606123201-0c45cd13c2f1
github.com/openshift-kni/numaresources-operator v0.4.16-0rc0
github.com/openshift/client-go v0.0.1
github.com/openshift/installer v0.0.0-00010101000000-000000000000
github.com/povsister/scp v0.0.0-20210427074412-33febfd9f13e
Expand All @@ -70,7 +71,6 @@ require (
github.com/metal3-io/baremetal-operator/pkg/hardwareutils v0.5.1 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/nutanix-cloud-native/prism-go-client v0.2.1-0.20220804130801-c8a253627c64 // indirect
github.com/openshift-kni/numaresources-operator v0.4.16-0rc0 // indirect
github.com/openshift/cluster-logging-operator v0.0.0-20240606085930-750f369019d4 // indirect
github.com/openshift/elasticsearch-operator v0.0.0-20220613183908-e1648e67c298 // indirect
github.com/stmcginnis/gofish v0.15.1-0.20231121142100-22a60a77be91 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1691,8 +1691,8 @@ github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE
github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/openshift-kni/cluster-group-upgrades-operator v0.0.0-20240423171335-f07cdbf8af2c h1:wAPCXsnAXOUAJ5DYlVgGUcV9YBSiVlH4o9tbQ9py8ZY=
github.com/openshift-kni/cluster-group-upgrades-operator v0.0.0-20240423171335-f07cdbf8af2c/go.mod h1:hkzqKpmQvh7vgPx8Hw6IExJorKPM0dEeJdOXjIW3gNw=
github.com/openshift-kni/eco-goinfra v0.0.0-20240621192821-7c55fda74f32 h1:mLsBeu1cSEvCbJ2hEGDqoMA46leC6FD+V0zPLczkEVQ=
github.com/openshift-kni/eco-goinfra v0.0.0-20240621192821-7c55fda74f32/go.mod h1:oGFnQMzZ/bqtnjdh9Rx44NzsMGWaZXgyQsoS0Q7faJ8=
github.com/openshift-kni/eco-goinfra v0.0.0-20240626143745-4d019aeb6f02 h1:e9+xSEmZzymaHJbRsZ+6cndk8TYGYPYdDqVbPTVz0r4=
github.com/openshift-kni/eco-goinfra v0.0.0-20240626143745-4d019aeb6f02/go.mod h1:oGFnQMzZ/bqtnjdh9Rx44NzsMGWaZXgyQsoS0Q7faJ8=
github.com/openshift-kni/k8sreporter v1.0.5 h1:1GYBc/BTZyVoXilHef43v9A8BSzw700zAPZ6zsZvo6Y=
github.com/openshift-kni/k8sreporter v1.0.5/go.mod h1:fg8HI9yxiKAi6UzR6NTtrmQmA2WKzUqmkRUHwQ1+Bj8=
github.com/openshift-kni/lifecycle-agent v0.0.0-20240606123201-0c45cd13c2f1 h1:y+0Ecc+MSZA/GNS3VOpKq+XK9x8qoNA7TlyHvqbVbpw=
Expand Down
4 changes: 2 additions & 2 deletions tests/system-tests/internal/await/await.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ func WaitUntilNodeIsUnreachable(hostname string, timeout time.Duration) error {
}
}

// WaitUntilNewDaemonSetIsRunning waits until the new daemonset is in Ready state.
func WaitUntilNewDaemonSetIsRunning(apiClient *clients.Settings, name, nsname string, timeout time.Duration) error {
// WaitUntilDaemonSetIsRunning waits until the new daemonset is in Ready state.
func WaitUntilDaemonSetIsRunning(apiClient *clients.Settings, name, nsname string, timeout time.Duration) error {
glog.V(90).Infof("Verifying if daemonset %s is running in namespace %s", name, nsname)

var daemonsetObj *daemonset.Builder
Expand Down
68 changes: 68 additions & 0 deletions tests/system-tests/vcore/internal/config-files/clo-instance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
apiVersion: logging.openshift.io/v1
kind: ClusterLogging
metadata:
name: "{{ .ClusterLoggingName }}"
namespace: "{{ .ClusterLoggingNamespace }}"
spec:
collection:
fluentd:
resources:
limits:
memory: 2Gi
requests:
cpu: 100m
memory: 1Gi
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
type: fluentd
curation:
curator:
schedule: 30 * * * *
type: curator
logStore:
elasticsearch:
nodeCount: {{ .NodeCount }}
nodeSelector:
node-role.kubernetes.io/master: ''
redundancyPolicy: SingleRedundancy
resources:
limits:
cpu: 8
memory: 64Gi
requests:
cpu: 8
memory: 64Gi
storage:
size: 150Gi
storageClassName: ocs-storagecluster-cephfs
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
retentionPolicy:
application:
maxAge: 1d
audit:
maxAge: 7d
infra:
maxAge: 7d
type: elasticsearch
managementState: Managed
visualization:
kibana:
nodeSelector:
node-role.kubernetes.io/master: ''
replicas: 1
resources:
limits:
memory: 2Gi
requests:
cpu: 1
memory: 2Gi
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
type: kibana
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
- image: {{ .AbImageURL }}
name: test
command: ["/bin/sh"]
args: ["-c", "for i in $(seq 1 100);do echo $i;ab -c 5 -n 120 -v 2 http://test-app.{{ .TestNamespace }}.svc/;sleep 1;done"]
args: ["-c", "for i in $(seq 1 70);do echo $i;ab -c 5 -n 120 -v 2 http://test-app.{{ .TestNamespace }}.svc/;sleep 1;done"]
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@ func CreateCLOInstance(ctx SpecContext) {
_, err = consoleoperatorObj.WithPlugins([]string{"logging-view-plugin"}, false).Update()
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("failed to enable logging-view-pluggin due to %v", err))

eskInstance := clusterlogging.NewElasticsearchBuilder(APIClient,
vcoreparams.ESKInstanceName,
vcoreparams.CLONamespace)
Expect(eskInstance.Exists()).To(Equal(true), fmt.Sprintf("Failed to create ElasticSearch %s "+
"instance in %s namespace",
vcoreparams.ESKOperatorName, vcoreparams.CLONamespace))
// eskInstance := clusterlogging.NewElasticsearchBuilder(APIClient,
// vcoreparams.ESKInstanceName,
// vcoreparams.CLONamespace)
// Expect(eskInstance.Exists()).To(Equal(true), fmt.Sprintf("Failed to create ElasticSearch %s "+
// "instance in %s namespace",
// vcoreparams.ESKOperatorName, vcoreparams.CLONamespace))

_, err = consoleoperatorObj.WithPlugins([]string{"logging-view-plugin"}, false).Update()
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("failed to enable logging-view-pluggin due to %v", err))
Expand Down
120 changes: 120 additions & 0 deletions tests/system-tests/vcore/internal/vcorecommon/helper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
package vcorecommon

import (
"context"
"fmt"
"time"

"github.com/golang/glog"
"github.com/onsi/gomega"
"github.com/openshift-kni/eco-goinfra/pkg/namespace"
"github.com/openshift-kni/eco-gotests/tests/system-tests/internal/mirroring"
"github.com/openshift-kni/eco-gotests/tests/system-tests/internal/platform"
"github.com/openshift-kni/eco-gotests/tests/system-tests/vcore/internal/vcoreinittools"
"github.com/openshift-kni/eco-gotests/tests/system-tests/vcore/internal/vcoreparams"
"k8s.io/apimachinery/pkg/util/wait"
)

func getImageURL(repository, name, tag string) (string, error) {
imageURL := fmt.Sprintf("%s/%s", repository, name)

isDisconnected, err := platform.IsDisconnectedDeployment(vcoreinittools.APIClient)

if err != nil {
return "", err
}

if !isDisconnected {
glog.V(vcoreparams.VCoreLogLevel).Info("The connected deployment type was detected, " +
"the images mirroring is not required")
} else {
glog.V(vcoreparams.VCoreLogLevel).Infof("Mirror image %s:%s locally", imageURL, tag)

imageURL, _, err = mirroring.MirrorImageToTheLocalRegistry(
vcoreinittools.APIClient,
repository,
name,
tag,
vcoreinittools.VCoreConfig.Host,
vcoreinittools.VCoreConfig.User,
vcoreinittools.VCoreConfig.Pass,
vcoreinittools.VCoreConfig.CombinedPullSecretFile,
vcoreinittools.VCoreConfig.RegistryRepository)

if err != nil {
return "", fmt.Errorf("failed to mirror image %s:%s locally due to %w",
name, tag, err)
}
}

return fmt.Sprintf("%s:%s", imageURL, tag), nil
}

func insureNamespaceNotExists(nsName string) bool {
watchNamespace := namespace.NewBuilder(vcoreinittools.APIClient, nsName)
if watchNamespace.Exists() {
err := watchNamespace.Delete()
gomega.Expect(err).ToNot(gomega.HaveOccurred(),
fmt.Sprintf("Failed to delete watch namespace %s due to: %v",
vcoreparams.KedaWatchNamespace, err))

err = wait.PollUntilContextTimeout(
context.TODO(),
time.Second,
time.Minute*10,
true,
func(ctx context.Context) (bool, error) {
isExists := watchNamespace.Exists()

if !isExists {
return true, nil
}

return false, nil
})
gomega.Expect(err).ToNot(gomega.HaveOccurred(),
fmt.Sprintf("Failed to delete watch namespace %s due to: %v",
vcoreparams.KedaWatchNamespace, err))
}

return true
}

func insureNamespaceExists(nsName string) bool {
glog.V(vcoreparams.VCoreLogLevel).Infof("Insure namespace %q exists", nsName)

createNs := namespace.NewBuilder(vcoreinittools.APIClient, nsName)

if !createNs.Exists() {
createNs, err := createNs.Create()

if err != nil {
glog.V(vcoreparams.VCoreLogLevel).Infof("Error creating namespace %q: %v", nsName, err)

return false
}

err = wait.PollUntilContextTimeout(
context.TODO(),
time.Second,
3*time.Second,
true,
func(ctx context.Context) (bool, error) {
if !createNs.Exists() {
glog.V(vcoreparams.VCoreLogLevel).Infof("Error creating namespace %q", nsName)

return false, nil
}

glog.V(vcoreparams.VCoreLogLevel).Infof("Created namespace %q", createNs.Definition.Name)

return true, nil
})

if err != nil {
return false
}
}

return true
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@ func VerifyInitialDeploymentConfig() {
Label("healthy-cluster"), reportxml.ID("59441"), VerifyHealthyClusterStatus)

It("Asserts time sync was successfully applied for master nodes",
Label("chrony"), reportxml.ID("60028"), VerifyEtcChronyMasters)
Label("initial"), reportxml.ID("60028"), VerifyEtcChronyMasters)

It("Asserts time sync was successfully applied for workers nodes",
Label("chrony"), reportxml.ID("60029"), VerifyEtcChronyWorkers)
Label("initial"), reportxml.ID("60029"), VerifyEtcChronyWorkers)

It("Verifies odf MCP was deployed",
Label("odf"), reportxml.ID("73673"), VerifyODFMCPAvailability)
Label("initial"), reportxml.ID("73673"), VerifyODFMCPAvailability)

It("Verifies full set of ODF nodes was deployed",
Label("odf"), reportxml.ID("59442"), VerifyODFNodesAvailability)
Label("initial"), reportxml.ID("59442"), VerifyODFNodesAvailability)

It("Verifies control-plane-worker MCP was deployed",
Label("cp-mcp"), reportxml.ID("60049"), VerifyControlPlaneWorkerMCPAvailability)
Label("initial"), reportxml.ID("60049"), VerifyControlPlaneWorkerMCPAvailability)

It("Verifies control-plane-worker nodes availability",
Label("cp-nodes"), reportxml.ID("59505"), VerifyControlPlaneWorkerNodesAvailability)
Label("initial"), reportxml.ID("59505"), VerifyControlPlaneWorkerNodesAvailability)

It("Verifies user-plane-worker MCP was deployed",
Label("pp-mcp"), reportxml.ID("60050"), VerifyUserPlaneWorkerMCPAvailability)
Label("initial"), reportxml.ID("60050"), VerifyUserPlaneWorkerMCPAvailability)

It("Verifies user-plane-worker nodes availability",
Label("pp-nodes"), reportxml.ID("59506"), VerifyUserPlaneWorkerNodesAvailability)
Label("initial"), reportxml.ID("59506"), VerifyUserPlaneWorkerNodesAvailability)
})
}

Expand Down
Loading

0 comments on commit 5cc1c2b

Please sign in to comment.