/
lifecycle_deployment_scaling.go
73 lines (57 loc) · 2.52 KB
/
lifecycle_deployment_scaling.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package tests
import (
"os"
"strings"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/test-network-function/cnfcert-tests-verification/tests/globalhelper"
"github.com/test-network-function/cnfcert-tests-verification/tests/globalparameters"
tshelper "github.com/test-network-function/cnfcert-tests-verification/tests/lifecycle/helper"
tsparams "github.com/test-network-function/cnfcert-tests-verification/tests/lifecycle/parameters"
)
var _ = Describe("lifecycle-deployment-scaling", Serial, func() {
var randomNamespace string
var randomReportDir string
var randomTnfConfigDir string
BeforeEach(func() {
// Create random namespace and keep original report and TNF config directories
randomNamespace, randomReportDir, randomTnfConfigDir = globalhelper.BeforeEachSetupWithRandomNamespace(tsparams.LifecycleNamespace)
By("Define TNF config file")
err := globalhelper.DefineTnfConfig(
[]string{randomNamespace},
[]string{tsparams.TestPodLabel},
[]string{tsparams.TnfTargetOperatorLabels},
[]string{},
[]string{}, randomTnfConfigDir)
Expect(err).ToNot(HaveOccurred())
By("Enable intrusive tests")
err = os.Setenv("TNF_NON_INTRUSIVE_ONLY", "false")
Expect(err).ToNot(HaveOccurred())
if globalhelper.GetConfiguration().General.DisableIntrusiveTests == strings.ToLower("true") {
Skip("Intrusive tests are disabled via config")
}
})
AfterEach(func() {
globalhelper.AfterEachCleanupWithRandomNamespace(randomNamespace, randomReportDir, randomTnfConfigDir, tsparams.WaitingTime)
By("Disable intrusive tests")
err := os.Setenv("TNF_NON_INTRUSIVE_ONLY", "true")
Expect(err).ToNot(HaveOccurred())
})
// 47398
It("One deployment, one pod, one container, scale in and out", func() {
By("Define Deployment")
deploymenta, err := tshelper.DefineDeployment(1, 1, tsparams.TestDeploymentName, randomNamespace)
Expect(err).ToNot(HaveOccurred())
By("Create Deployment")
err = globalhelper.CreateAndWaitUntilDeploymentIsReady(deploymenta, tsparams.WaitingTime)
Expect(err).ToNot(HaveOccurred())
By("Start lifecycle-deployment-scaling test")
err = globalhelper.LaunchTests(
tsparams.TnfDeploymentScalingTcName,
globalhelper.ConvertSpecNameToFileName(CurrentSpecReport().FullText()), randomReportDir, randomTnfConfigDir)
Expect(err).ToNot(HaveOccurred())
By("Verify test case status in Claim report")
err = globalhelper.ValidateIfReportsAreValid(tsparams.TnfDeploymentScalingTcName, globalparameters.TestCasePassed, randomReportDir)
Expect(err).ToNot(HaveOccurred())
})
})