FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
stackrox/pkg/centralsensor/sensor_hello_test.go at master · stackrox/stackrox · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
stackrox
/
stackrox
Public
Notifications
You must be signed in to change notification settings
Fork
191
Star
1.3k
Code
Issues
54
Pull requests
604
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
stackrox
/
pkg
/
centralsensor
/
sensor_hello_test.go
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (43 loc) · 1.17 KB
Breadcrumbs
stackrox
/
pkg
/
centralsensor
/
sensor_hello_test.go
Copy path
File metadata and controls
48 lines (43 loc) · 1.17 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package
centralsensor
import
(
"testing"
"github.com/stackrox/rox/generated/internalapi/central"
"github.com/stackrox/rox/generated/storage"
"github.com/stretchr/testify/assert"
)
func
TestSecuredClusterIsNotManagedManually
(
t
*
testing.
T
) {
tests
:=
[]
struct
{
name
string
managedBy
storage.
ManagerType
expectedOutcome
bool
}{
{
name
:
"Unknown manager type"
,
managedBy
:
storage
.
ManagerType_MANAGER_TYPE_UNKNOWN
,
expectedOutcome
:
false
,
},
{
name
:
"Manually managed"
,
managedBy
:
storage
.
ManagerType_MANAGER_TYPE_MANUAL
,
expectedOutcome
:
false
,
},
{
name
:
"Managed by Helm"
,
managedBy
:
storage
.
ManagerType_MANAGER_TYPE_HELM_CHART
,
expectedOutcome
:
true
,
},
{
name
:
"Managed by Operator"
,
managedBy
:
storage
.
ManagerType_MANAGER_TYPE_KUBERNETES_OPERATOR
,
expectedOutcome
:
true
,
},
}
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing.
T
) {
config
:=
&
central.
HelmManagedConfigInit
{}
config
.
ManagedBy
=
tt
.
managedBy
result
:=
SecuredClusterIsNotManagedManually
(
config
)
assert
.
Equal
(
t
,
tt
.
expectedOutcome
,
result
)
})
}
}
Back
|
FazBrowse Home
|
New Git URL