Skip to content

Commit 0dbd07a

Browse files
committed
adding the quality test for poc count test
Signed-off-by: Adam D. Cornett <adc@redhat.com>
1 parent bf90543 commit 0dbd07a

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

tests/observability/parameters/parameters.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const (
1010
CertsuiteCrdStatusTcName = "observability-crd-status"
1111
CertsuiteTerminationMsgPolicyTcName = "observability-termination-policy"
1212
CertsuitePodDisruptionBudgetTcName = "observability-pod-disruption-budget"
13+
CertsuitePodCountTcName = "observability-pod-count"
1314

1415
TestNamespace = "observability-ns"
1516

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package tests
2+
3+
import (
4+
. "github.com/onsi/ginkgo/v2"
5+
. "github.com/onsi/gomega"
6+
7+
"github.com/redhat-best-practices-for-k8s/certsuite-qe/tests/globalhelper"
8+
"github.com/redhat-best-practices-for-k8s/certsuite-qe/tests/globalparameters"
9+
tshelper "github.com/redhat-best-practices-for-k8s/certsuite-qe/tests/observability/helper"
10+
tsparams "github.com/redhat-best-practices-for-k8s/certsuite-qe/tests/observability/parameters"
11+
"github.com/redhat-best-practices-for-k8s/certsuite-qe/tests/utils/deployment"
12+
)
13+
14+
var _ = Describe(tsparams.CertsuitePodCountTcName, func() {
15+
var randomNamespace string
16+
var randomReportDir string
17+
var randomCertsuiteConfigDir string
18+
19+
BeforeEach(func() {
20+
// Create random namespace and keep original report and certsuite config directories
21+
randomNamespace, randomReportDir, randomCertsuiteConfigDir =
22+
globalhelper.BeforeEachSetupWithRandomNamespace(tsparams.TestNamespace)
23+
24+
By("Define certsuite config file")
25+
err := globalhelper.DefineCertsuiteConfig(
26+
[]string{randomNamespace},
27+
tshelper.GetCertsuiteTargetPodLabelsSlice(),
28+
[]string{},
29+
[]string{},
30+
[]string{tsparams.CrdSuffix1, tsparams.CrdSuffix2}, randomCertsuiteConfigDir)
31+
Expect(err).ToNot(HaveOccurred())
32+
})
33+
34+
AfterEach(func() {
35+
globalhelper.AfterEachCleanupWithRandomNamespace(randomNamespace,
36+
randomReportDir, randomCertsuiteConfigDir, tsparams.CrdDeployTimeoutMins)
37+
})
38+
39+
It("One deployment with one replica meets requirement", func() {
40+
By("Define deployment")
41+
dep := deployment.DefineDeployment(tsparams.TestDeploymentBaseName, randomNamespace,
42+
globalhelper.GetConfiguration().General.TestImage, tsparams.CertsuiteTargetPodLabels)
43+
44+
deployment.RedefineWithReplicaNumber(dep, 1)
45+
46+
By("Create deployment")
47+
err := globalhelper.CreateAndWaitUntilDeploymentIsReady(dep, tsparams.DeploymentDeployTimeoutMins)
48+
Expect(err).ToNot(HaveOccurred())
49+
50+
By("Assert deployment has one replica")
51+
runningDeployment, err := globalhelper.GetRunningDeployment(dep.Namespace, dep.Name)
52+
Expect(err).ToNot(HaveOccurred())
53+
Expect(*runningDeployment.Spec.Replicas).To(Equal(int32(1)))
54+
55+
By("Start Certsuite " + tsparams.CertsuitePodCountTcName + " test case")
56+
err = globalhelper.LaunchTests(tsparams.CertsuitePodCountTcName,
57+
globalhelper.ConvertSpecNameToFileName(CurrentSpecReport().FullText()), randomReportDir, randomCertsuiteConfigDir)
58+
Expect(err).ToNot(HaveOccurred())
59+
60+
By("Verify test case status in Claim report")
61+
err = globalhelper.ValidateIfReportsAreValid(tsparams.CertsuitePodCountTcName,
62+
globalparameters.TestCasePassed, randomReportDir)
63+
Expect(err).ToNot(HaveOccurred())
64+
})
65+
})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package tests

0 commit comments

Comments
 (0)