-
Notifications
You must be signed in to change notification settings - Fork 88
/
inventory.go
188 lines (168 loc) · 4.89 KB
/
inventory.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
package inventory
import (
"context"
"fmt"
"time"
"github.com/onsi/gomega/gexec"
"github.com/replicatedhq/kots/e2e/kubectl"
"github.com/replicatedhq/kots/e2e/registry"
//lint:ignore ST1001 since Ginkgo and Gomega are DSLs this makes the tests more natural to read
. "github.com/onsi/ginkgo/v2"
//lint:ignore ST1001 since Ginkgo and Gomega are DSLs this makes the tests more natural to read
. "github.com/onsi/gomega"
)
const (
HelmPassword = "password"
)
func NewRegressionTest() Test {
return Test{
Name: "Regression",
TestimLabel: "type=existing cluster, env=online, phase=new install, rbac=minimal rbac",
Namespace: "qakotsregression",
UpstreamURI: "qakotsregression/type-existing-cluster-env-on-2",
Browser: "firefox",
UseMinimalRBAC: true,
NeedsMonitoring: true,
NeedsRegistry: true,
Setup: SetupRegressionTest,
}
}
func NewSmokeTest() Test {
return Test{
ID: "smoke-test",
Name: "Smoke Test",
Namespace: "smoke-test",
AppSlug: "qakotstestim",
UpstreamURI: "qakotstestim/github-actions-qa",
NeedsSnapshots: true,
}
}
func NewAirgapSmokeTest() Test {
return Test{
Name: "airgap-smoke-test",
TestimSuite: "airgap-smoke-test",
Namespace: "airgap-smoke-test",
UpstreamURI: "airgap-smoke-test/automated",
}
}
func NewConfigValidation() Test {
return Test{
ID: "config-validation",
Name: "Config Validation",
Namespace: "config-validation",
AppSlug: "config-validation-panda",
UpstreamURI: "config-validation-panda/automated",
}
}
func NewBackupAndRestore() Test {
return Test{
ID: "backup-and-restore",
Name: "Backup and Restore",
Namespace: "backup-and-restore",
AppSlug: "backup-and-restore",
UpstreamURI: "backup-and-restore/automated",
NeedsSnapshots: true,
}
}
func NewNoRequiredConfig() Test {
return Test{
ID: "no-required-config",
Name: "No Required Config",
Namespace: "no-required-config",
AppSlug: "no-required-config",
UpstreamURI: "no-required-config/automated",
}
}
func NewVersionHistoryPagination() Test {
return Test{
Name: "Version History Pagination",
TestimSuite: "version-history-pagination",
Namespace: "version-history-pagination",
UpstreamURI: "version-history-pagination/automated",
}
}
func NewChangeLicense() Test {
return Test{
Name: "Change License",
TestimSuite: "change-license",
Namespace: "change-license",
UpstreamURI: "change-license/automated",
}
}
func NewMultiAppBackupAndRestoreTest() Test {
return Test{
Name: "multi-app-backup-and-restore",
TestimSuite: "multi-app-backup-and-restore",
Namespace: "multi-app-backup-and-restore",
UpstreamURI: "multi-app-backup-and-restore/automated",
NeedsSnapshots: true,
}
}
func MultiAppTest() Test {
return Test{
Name: "multi-app-install",
TestimSuite: "multi-app-install",
Namespace: "multi-app-install",
UpstreamURI: "multi-app-install/automated",
}
}
func NewMinKotsVersion() Test {
return Test{
Name: "Min KOTS Version",
TestimSuite: "min-kots-version",
Namespace: "min-kots-version",
UpstreamURI: "min-kots-version/automated",
SkipCompatibilityCheck: true,
}
}
func NewTargetKotsVersion() Test {
return Test{
Name: "Target KOTS Version",
TestimSuite: "target-kots-version",
Namespace: "target-kots-version",
UpstreamURI: "target-kots-version/automated",
SkipCompatibilityCheck: true,
}
}
func NewRangeKotsVersion() Test {
return Test{
Name: "Range KOTS Version",
TestimSuite: "range-kots-version",
Namespace: "range-kots-version",
UpstreamURI: "range-kots-version/automated",
SkipCompatibilityCheck: true,
}
}
func NewSupportBundle() Test {
return Test{
Name: "Support Bundle",
TestimSuite: "support-bundle",
Namespace: "support-bundle",
UpstreamURI: "support-bundle-halibut/automated",
}
}
func NewGitOps() Test {
return Test{
Name: "GitOps",
TestimSuite: "gitops",
Namespace: "gitops",
UpstreamURI: "gitops-bobcat/automated",
}
}
func SetupRegressionTest(kubectlCLI *kubectl.CLI) TestimParams {
cmd := kubectlCLI.Command(
context.Background(),
"create",
"secret",
"docker-registry",
"registry-creds",
fmt.Sprintf("--docker-server=registry.%s.svc.cluster.local:5000", registry.DefaultNamespace),
"--docker-username=fake",
"--docker-password=fake",
"--docker-email=fake@fake.com",
)
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
Expect(err).WithOffset(1).Should(Succeed(), "Create registry-creds secret failed")
Eventually(session).WithOffset(1).WithTimeout(30*time.Minute).Should(gexec.Exit(0), "Create registry-creds secret failed with non-zero exit code")
return nil
}