Skip to content

Commit

Permalink
test adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
elenagerman committed Jun 27, 2024
1 parent 89ce69c commit 54eaf35
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 97 deletions.
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 @@ -52,7 +52,7 @@ func VerifyESKAndCLOSuite() {
Label("clo"), reportxml.ID("59494"), CreateCLOInstance)

It("Verify ClusterLogging Operator successfully installed",
Label("clo"), reportxml.ID("73678"), VerifyCLODeployment)
Label("debug"), reportxml.ID("73678"), VerifyCLODeployment)
})
}

Expand Down 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,

Check failure on line 214 in tests/system-tests/vcore/internal/vcorecommon/esk-clo-operator.go

View workflow job for this annotation

GitHub Actions / build

commentFormatting: put a space between `//` and comment text (gocritic)
// 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
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
. "github.com/onsi/gomega"
"github.com/openshift-kni/eco-gotests/tests/system-tests/internal/apiobjectshelper"

goclient "sigs.k8s.io/controller-runtime/pkg/client"

"github.com/openshift-kni/eco-goinfra/pkg/nmstate"
"k8s.io/apimachinery/pkg/util/wait"

Expand All @@ -34,9 +32,6 @@ func VerifyNMStateSuite() {

It("Verifies NMState instance exists",
Label("nmstate"), reportxml.ID("67027"), VerifyNMStateInstanceExists)

It("Verifies all NodeNetworkConfigurationPolicies are Available",
Label("nmstate"), reportxml.ID("71846"), VerifyAllNNCPsAreOK)
})
}

Expand Down Expand Up @@ -79,59 +74,3 @@ func VerifyNMStateInstanceExists(ctx SpecContext) {
Expect(err).ToNot(HaveOccurred(),
fmt.Sprintf("Failed to pull in NMState instance %q", vcoreparams.NMStateInstanceName))
} // func VerifyNMStateInstanceExists (ctx SpecContext)

// VerifyAllNNCPsAreOK assert all available NNCPs are Available, not progressing and not degraded.
func VerifyAllNNCPsAreOK(ctx SpecContext) {
glog.V(vcoreparams.VCoreLogLevel).Infof("Verify NodeNetworkConfigurationPolicies are Available")

const ConditionTypeTrue = "True"

nncps, err := nmstate.ListPolicy(APIClient, goclient.ListOptions{})
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("Failed to list NodeNetworkConfigurationPolicies: %v", err))
Expect(len(nncps)).ToNot(Equal(0), "0 NodeNetworkConfigurationPolicies found")

nonAvailableNNCP := make(map[string]string)
progressingNNCP := make(map[string]string)
degradedNNCP := make(map[string]string)

for _, nncp := range nncps {
glog.V(vcoreparams.VCoreLogLevel).Infof("\t Processing %s NodeNetworkConfigurationPolicy",
nncp.Definition.Name)

for _, condition := range nncp.Object.Status.Conditions {
//nolint:nolintlint
switch condition.Type { //nolint:exhaustive
//nolint:goconst
case "Available":
if condition.Status != ConditionTypeTrue {
nonAvailableNNCP[nncp.Definition.Name] = condition.Message
glog.V(vcoreparams.VCoreLogLevel).Infof("\t%s NNCP is not Available: %s\n",
nncp.Definition.Name, condition.Message)
} else {
glog.V(vcoreparams.VCoreLogLevel).Infof("\t%s NNCP is Available: %s\n",
nncp.Definition.Name, condition.Message)
}
case "Degraded":
if condition.Status == ConditionTypeTrue {
degradedNNCP[nncp.Definition.Name] = condition.Message
glog.V(vcoreparams.VCoreLogLevel).Infof("\t%s NNCP is Degraded: %s\n",
nncp.Definition.Name, condition.Message)
} else {
glog.V(vcoreparams.VCoreLogLevel).Infof("\t%s NNCP is Not-Degraded\n", nncp.Definition.Name)
}
case "Progressing":
if condition.Status == ConditionTypeTrue {
progressingNNCP[nncp.Definition.Name] = condition.Message
glog.V(vcoreparams.VCoreLogLevel).Infof("\t%s NNCP is Progressing: %s\n",
nncp.Definition.Name, condition.Message)
} else {
glog.V(vcoreparams.VCoreLogLevel).Infof("\t%s NNCP is Not-Progressing\n", nncp.Definition.Name)
}
}
}
}

Expect(len(nonAvailableNNCP)).To(Equal(0), "There are NonAvailable NodeNetworkConfigurationPolicies")
Expect(len(degradedNNCP)).To(Equal(0), "There are Degraded NodeNetworkConfigurationPolicies")
Expect(len(nonAvailableNNCP)).To(Equal(0), "There are Progressing NodeNetworkConfigurationPolicies")
} // func VerifyNNCP (ctx SpecContext)
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ func VerifyNTOSuite() {
It("Create new nodes tuning",
Label("nto"), reportxml.ID("63740"), CreateNodesTuning) //nolint:misspell

It("Verify CPU Manager config",
Label("nto"), reportxml.ID("63809"), VerifyCPUManagerConfig) //nolint:misspell
//It("Verify CPU Manager config",

Check failure on line 56 in tests/system-tests/vcore/internal/vcorecommon/node-tuning-operator.go

View workflow job for this annotation

GitHub Actions / build

commentFormatting: put a space between `//` and comment text (gocritic)
// Label("nto"), reportxml.ID("63809"), VerifyCPUManagerConfig) //nolint:misspell

Check failure on line 57 in tests/system-tests/vcore/internal/vcorecommon/node-tuning-operator.go

View workflow job for this annotation

GitHub Actions / build

`nto` is a misspelling of `not` (misspell)

It("Verify Node Tuning Operator Huge Pages configuration",
Label("nto"), reportxml.ID("60062"), VerifyHugePagesConfig) //nolint:misspell
Expand Down Expand Up @@ -164,8 +164,7 @@ func CreatePerformanceProfile(ctx SpecContext) {
WithGloballyDisableIrqLoadBalancing().
WithHugePages(vcoreparams.HugePagesSize, hugePages).
WithNumaTopology(vcoreparams.TopologyConfig).
WithWorkloadHints(false, true, false).
WithNodeSelector(workerLabelMap)
WithWorkloadHints(false, true, false)

if !ppObj.Exists() {
glog.V(vcoreparams.VCoreLogLevel).Infof("Create new performanceprofile %s", workerLabel)
Expand Down Expand Up @@ -209,15 +208,15 @@ func CreatePerformanceProfile(ctx SpecContext) {
// CreateNodesTuning creates new Node Tuning configuration.
func CreateNodesTuning(ctx SpecContext) {
tunedInstanceName := fmt.Sprintf("configuration-nic-%s", workerLabel)
tunedProfileData := fmt.Sprintf(""+
"[main]"+
"summary=Configuration changes profile inherited from performance created tuned"+
"include=openshift-node-performance-%s"+
""+
"[net]"+
"type=net"+
"devices_udev_regex=^INTERFACE=ens2f(0|1)"+
"channels=combined 32",
tunedProfileData := fmt.Sprintf(
"[main]\n"+
"summary=Configuration changes profile inherited from performance created tuned\n\n"+
"include=openshift-node-performance-%s\n"+
"\n"+
"[net]\n"+
"type=net\n"+
"devices_udev_regex=^INTERFACE=ens2f(0|1)\n"+
"channels=combined 32",
workerLabel)
tunedProfile := tunedv1.TunedProfile{
Name: &tunedInstanceName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ func VerifyPostDeploymentConfig() {
})

It("Verifies Image Registry management state is Enabled",
Label("image-registry"), reportxml.ID("72812"), VerifyImageRegistryManagementStateEnablement)
Label("day2"), reportxml.ID("72812"), VerifyImageRegistryManagementStateEnablement)

It("Verifies network policy configuration procedure",
Label("network-policy"), reportxml.ID("60086"), VerifyNetworkPolicyConfig)
Label("day2"), reportxml.ID("60086"), VerifyNetworkPolicyConfig)

It("Verify scc activation succeeded",
Label("scc"), reportxml.ID("60042"), VerifySCCActivation)
Label("day2"), reportxml.ID("60042"), VerifySCCActivation)

It("Verifies sctp module activation succeeded",
Label("sctp"), reportxml.ID("60086"), VerifySCTPModuleActivation)
Label("day2"), reportxml.ID("60086"), VerifySCTPModuleActivation)

It("Verifies system reserved memory for masters succeeded",
Label("system-reserved"), reportxml.ID("60045"), SetSystemReservedMemoryForMasterNodes)
Label("day2"), reportxml.ID("60045"), SetSystemReservedMemoryForMasterNodes)
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func VerifyServiceMeshSuite() {
Label("smo"), reportxml.ID("73732"), VerifyServiceMeshDeployment)

It("Verifies Service Mesh configuration procedure succeeded",
Label("smo"), reportxml.ID("59502"), VerifyServiceMeshConfig)
Label("debug"), reportxml.ID("59502"), VerifyServiceMeshConfig)
})
}

Expand Down Expand Up @@ -217,7 +217,7 @@ func VerifyServiceMeshConfig(ctx SpecContext) {
err = await.WaitUntilDeploymentReady(APIClient,
smodeployment,
vcoreparams.IstioNamespace,
30*time.Second)
2*time.Minute)
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("smo deployment %s not found in %s namespace; %v",
smodeployment, vcoreparams.IstioNamespace, err))
}
Expand Down

0 comments on commit 54eaf35

Please sign in to comment.