diff --git a/charts/node-analyzer/tests/cert_validation_benchmarkrunner_test.yaml b/charts/node-analyzer/tests/cert_validation_benchmarkrunner_test.yaml index 9ab9d14c5..85b5409dd 100644 --- a/charts/node-analyzer/tests/cert_validation_benchmarkrunner_test.yaml +++ b/charts/node-analyzer/tests/cert_validation_benchmarkrunner_test.yaml @@ -7,6 +7,8 @@ tests: clusterName: "test" nodeAnalyzer: deploy: true + benchmarkRunner: + deploy: true templates: - templates/configmap-benchmark-runner.yaml asserts: @@ -21,6 +23,8 @@ tests: sslVerifyCertificate: true nodeAnalyzer: deploy: true + benchmarkRunner: + deploy: true templates: - templates/configmap-benchmark-runner.yaml asserts: @@ -35,6 +39,8 @@ tests: sslVerifyCertificate: false nodeAnalyzer: deploy: true + benchmarkRunner: + deploy: true templates: - templates/configmap-benchmark-runner.yaml asserts: @@ -48,6 +54,8 @@ tests: nodeAnalyzer: deploy: true sslVerifyCertificate: true + benchmarkRunner: + deploy: true templates: - templates/configmap-benchmark-runner.yaml asserts: @@ -61,6 +69,8 @@ tests: nodeAnalyzer: deploy: true sslVerifyCertificate: false + benchmarkRunner: + deploy: true templates: - templates/configmap-benchmark-runner.yaml asserts: @@ -74,6 +84,7 @@ tests: nodeAnalyzer: deploy: true benchmarkRunner: + deploy: true sslVerifyCertificate: true templates: - templates/configmap-benchmark-runner.yaml @@ -88,6 +99,7 @@ tests: nodeAnalyzer: deploy: true benchmarkRunner: + deploy: true sslVerifyCertificate: false templates: - templates/configmap-benchmark-runner.yaml diff --git a/charts/node-analyzer/tests/collector_endpoint_region_test.yaml b/charts/node-analyzer/tests/collector_endpoint_region_test.yaml index 29cedc918..655a23c67 100644 --- a/charts/node-analyzer/tests/collector_endpoint_region_test.yaml +++ b/charts/node-analyzer/tests/collector_endpoint_region_test.yaml @@ -3,6 +3,10 @@ templates: - templates/configmap-benchmark-runner.yaml tests: - it: Checking default value no region specified (us1) + set: + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -15,6 +19,9 @@ tests: global: sysdig: region: us2 + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -27,6 +34,9 @@ tests: global: sysdig: region: us3 + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -39,6 +49,9 @@ tests: global: sysdig: region: us4 + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -51,6 +64,9 @@ tests: global: sysdig: region: eu1 + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -63,6 +79,9 @@ tests: global: sysdig: region: au1 + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -75,6 +94,9 @@ tests: global: sysdig: region: au-syd-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -87,6 +109,9 @@ tests: global: sysdig: region: br-sao-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -99,6 +124,9 @@ tests: global: sysdig: region: ca-tor-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -111,6 +139,9 @@ tests: global: sysdig: region: eu-de-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -123,6 +154,9 @@ tests: global: sysdig: region: eu-gb-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -135,6 +169,9 @@ tests: global: sysdig: region: jp-osa-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -147,6 +184,9 @@ tests: global: sysdig: region: jp-tok-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -159,6 +199,9 @@ tests: global: sysdig: region: us-east-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -171,6 +214,9 @@ tests: global: sysdig: region: us-south-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -183,6 +229,9 @@ tests: global: sysdig: region: au-syd-private-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -195,6 +244,9 @@ tests: global: sysdig: region: br-sao-private-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -207,6 +259,9 @@ tests: global: sysdig: region: ca-tor-private-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -219,6 +274,9 @@ tests: global: sysdig: region: eu-de-private-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -231,6 +289,9 @@ tests: global: sysdig: region: eu-gb-private-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -243,6 +304,9 @@ tests: global: sysdig: region: jp-osa-private-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -255,6 +319,9 @@ tests: global: sysdig: region: jp-tok-private-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -267,6 +334,9 @@ tests: global: sysdig: region: us-east-private-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -279,6 +349,9 @@ tests: global: sysdig: region: us-south-private-monitor + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -291,6 +364,9 @@ tests: global: sysdig: region: au-syd-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -303,6 +379,9 @@ tests: global: sysdig: region: br-sao-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -315,6 +394,9 @@ tests: global: sysdig: region: ca-tor-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -327,6 +409,9 @@ tests: global: sysdig: region: eu-de-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -339,6 +424,9 @@ tests: global: sysdig: region: eu-gb-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -351,6 +439,9 @@ tests: global: sysdig: region: jp-osa-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -363,6 +454,9 @@ tests: global: sysdig: region: jp-tok-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -375,6 +469,9 @@ tests: global: sysdig: region: us-east-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -387,6 +484,9 @@ tests: global: sysdig: region: us-south-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -399,6 +499,9 @@ tests: global: sysdig: region: au-syd-private-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -411,6 +514,9 @@ tests: global: sysdig: region: br-sao-private-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -423,6 +529,9 @@ tests: global: sysdig: region: ca-tor-private-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -435,6 +544,9 @@ tests: global: sysdig: region: eu-de-private-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -447,6 +559,9 @@ tests: global: sysdig: region: eu-gb-private-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -459,6 +574,9 @@ tests: global: sysdig: region: jp-osa-private-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -471,6 +589,9 @@ tests: global: sysdig: region: jp-tok-private-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -483,6 +604,9 @@ tests: global: sysdig: region: us-east-private-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -495,6 +619,9 @@ tests: global: sysdig: region: us-south-private-secure + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - isKind: of: ConfigMap @@ -507,6 +634,9 @@ tests: global: sysdig: region: us7 + nodeAnalyzer: + benchmarkRunner: + deploy: true asserts: - failedTemplate: errorMessage: "global.sysdig.region=us7 provided is not recognized." diff --git a/charts/node-analyzer/tests/conditional_flag_test.yaml b/charts/node-analyzer/tests/conditional_flag_test.yaml index 83a0c8edd..fa4dd153a 100644 --- a/charts/node-analyzer/tests/conditional_flag_test.yaml +++ b/charts/node-analyzer/tests/conditional_flag_test.yaml @@ -119,12 +119,8 @@ tests: deploy: true clusterName: test-k8s asserts: - - contains: - path: spec.template.spec.containers[3].env - content: - name: EVE_INTEGRATION_ENABLED - count: 1 - any: true + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-runtime-scanner')].env[?(@.name == 'EVE_INTEGRATION_ENABLED')]" template: daemonset-node-analyzer.yaml - containsDocument: kind: ConfigMap @@ -204,10 +200,6 @@ tests: deploy: false clusterName: test-k8s asserts: - - notContains: - path: spec.template.spec.containers[3].env - content: - name: EVE_INTEGRATION_ENABLED - count: 1 - any: true + - isNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-runtime-scanner')].env[?(@.name == 'EVE_INTEGRATION_ENABLED')]" template: daemonset-node-analyzer.yaml diff --git a/charts/node-analyzer/tests/golden_template_test.yaml b/charts/node-analyzer/tests/golden_template_test.yaml index fcc901375..d5ec8ab31 100644 --- a/charts/node-analyzer/tests/golden_template_test.yaml +++ b/charts/node-analyzer/tests/golden_template_test.yaml @@ -8,6 +8,8 @@ tests: sysdig: accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE nodeAnalyzer: + benchmarkRunner: + deploy: true imageAnalyzer: resources: requests: diff --git a/charts/node-analyzer/tests/hostscanner_test.yaml b/charts/node-analyzer/tests/hostscanner_test.yaml index e4684d01f..c1ab9f2f7 100644 --- a/charts/node-analyzer/tests/hostscanner_test.yaml +++ b/charts/node-analyzer/tests/hostscanner_test.yaml @@ -14,18 +14,13 @@ tests: asserts: - isKind: of: DaemonSet - - equal: - path: spec.template.spec.containers[0].name - value: "sysdig-image-analyzer" - - equal: - path: spec.template.spec.containers[1].name - value: "sysdig-host-analyzer" - - equal: - path: spec.template.spec.containers[2].name - value: "sysdig-benchmark-runner" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-image-analyzer')]" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-host-analyzer')]" - lengthEqual: path: spec.template.spec.containers - count: 3 + count: 2 - it: "HS deployed if newEngineOnly is active but deploy unset" set: clusterName: "test" @@ -37,18 +32,13 @@ tests: asserts: - isKind: of: DaemonSet - - equal: - path: "spec.template.spec.containers[0].name" - value: "sysdig-benchmark-runner" - - equal: - path: "spec.template.spec.containers[1].name" - value: "sysdig-runtime-scanner" - - equal: - path: "spec.template.spec.containers[2].name" - value: "sysdig-host-scanner" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-runtime-scanner')]" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-host-scanner')]" - lengthEqual: path: spec.template.spec.containers - count: 3 + count: 2 - it: "HS deployed if newEngineOnly is true and deploy set to true" set: clusterName: "test" @@ -63,18 +53,13 @@ tests: asserts: - isKind: of: DaemonSet - - equal: - path: "spec.template.spec.containers[0].name" - value: "sysdig-benchmark-runner" - - equal: - path: "spec.template.spec.containers[1].name" - value: "sysdig-runtime-scanner" - - equal: - path: "spec.template.spec.containers[2].name" - value: "sysdig-host-scanner" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-runtime-scanner')]" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-host-scanner')]" - lengthEqual: path: spec.template.spec.containers - count: 3 + count: 2 - it: "HS not deployed if explicitly set to false while newEngineOnly is active" set: secure: @@ -88,15 +73,11 @@ tests: asserts: - isKind: of: DaemonSet - - equal: - path: "spec.template.spec.containers[0].name" - value: "sysdig-benchmark-runner" - - equal: - path: "spec.template.spec.containers[1].name" - value: "sysdig-runtime-scanner" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-runtime-scanner')]" - lengthEqual: path: spec.template.spec.containers - count: 2 + count: 1 - it: "HS deployed if newEngineOnly is unset and deploy set to true" set: clusterName: "test" @@ -108,21 +89,16 @@ tests: asserts: - isKind: of: DaemonSet - - equal: - path: "spec.template.spec.containers[0].name" - value: "sysdig-image-analyzer" - - equal: - path: "spec.template.spec.containers[1].name" - value: "sysdig-host-analyzer" - - equal: - path: "spec.template.spec.containers[2].name" - value: "sysdig-benchmark-runner" - - equal: - path: "spec.template.spec.containers[3].name" - value: "sysdig-host-scanner" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-image-analyzer')]" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-host-analyzer')]" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-host-scanner')]" - lengthEqual: path: spec.template.spec.containers - count: 4 + count: 3 + - it: "HS not deployed if explicitly set to false" set: nodeAnalyzer: @@ -133,18 +109,13 @@ tests: asserts: - isKind: of: DaemonSet - - equal: - path: "spec.template.spec.containers[0].name" - value: "sysdig-image-analyzer" - - equal: - path: "spec.template.spec.containers[1].name" - value: "sysdig-host-analyzer" - - equal: - path: "spec.template.spec.containers[2].name" - value: "sysdig-benchmark-runner" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-image-analyzer')]" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-host-analyzer')]" - lengthEqual: path: spec.template.spec.containers - count: 3 + count: 2 - it: "Additional dirs to scan is set" set: diff --git a/charts/node-analyzer/tests/readme_command_test.yaml b/charts/node-analyzer/tests/readme_command_test.yaml index 6e3240fe1..54fb60555 100644 --- a/charts/node-analyzer/tests/readme_command_test.yaml +++ b/charts/node-analyzer/tests/readme_command_test.yaml @@ -9,6 +9,9 @@ tests: accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE nodeAnalyzer: apiEndpoint: secure.sysdig.com + + benchmarkRunner: + deploy: true asserts: - equal: path: data.access-key diff --git a/charts/node-analyzer/tests/runtimescanner_test.yaml b/charts/node-analyzer/tests/runtimescanner_test.yaml index ed04bcb29..1849a25b4 100644 --- a/charts/node-analyzer/tests/runtimescanner_test.yaml +++ b/charts/node-analyzer/tests/runtimescanner_test.yaml @@ -61,15 +61,11 @@ tests: asserts: - isKind: of: DaemonSet - - equal: - path: "spec.template.spec.containers[0].name" - value: "sysdig-benchmark-runner" - - equal: - path: "spec.template.spec.containers[1].name" - value: "sysdig-host-scanner" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-host-scanner')]" - lengthEqual: path: spec.template.spec.containers - count: 2 + count: 1 - it: "is disabled by default, legacy will be deployed" templates: @@ -77,18 +73,13 @@ tests: asserts: - isKind: of: DaemonSet - - equal: - path: "spec.template.spec.containers[0].name" - value: "sysdig-image-analyzer" - - equal: - path: "spec.template.spec.containers[1].name" - value: "sysdig-host-analyzer" - - equal: - path: "spec.template.spec.containers[2].name" - value: "sysdig-benchmark-runner" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-image-analyzer')]" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-host-analyzer')]" - lengthEqual: path: spec.template.spec.containers - count: 3 + count: 2 - it: "is enabled when newEngineOnly is set" set: @@ -100,15 +91,10 @@ tests: asserts: - isKind: of: DaemonSet - - equal: - path: "spec.template.spec.containers[0].name" - value: "sysdig-benchmark-runner" - - equal: - path: "spec.template.spec.containers[1].name" - value: "sysdig-runtime-scanner" - - equal: - path: "spec.template.spec.containers[2].name" - value: "sysdig-host-scanner" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-runtime-scanner')]" + - isNotNull: + path: "spec.template.spec.containers[?(@.name == 'sysdig-host-scanner')]" - lengthEqual: path: spec.template.spec.containers - count: 3 + count: 2