UNCLASSIFIED

Commit a441c2cf authored by bhearn's avatar bhearn
Browse files

Merge branch 'helm-tests-update' into 'main'

add helm tests

See merge request !31
parents 25fd5798 9366acae
Pipeline #257154 passed with stages
in 4 minutes and 13 seconds
...@@ -106,10 +106,15 @@ spec: ...@@ -106,10 +106,15 @@ spec:
{{- end }} {{- end }}
envFrom: envFrom:
{{- if not .Values.inject_secrets_via_env }} {{- if not .Values.inject_secrets_via_env }}
{{- if .Values.anchoreGlobal.existingSecret }}
- secretRef: - secretRef:
name: {{ default (include "anchore-engine.fullname" .) .Values.anchoreGlobal.existingSecret }} name: {{ .Values.anchoreGlobal.existingSecret }}
{{- else }}
- secretRef:
name: {{ include "anchore-engine.fullname" . }}
- secretRef: - secretRef:
name: {{ default (print (include "anchore-engine.fullname" .) "-admin-pass") .Values.anchoreGlobal.existingSecret }} name: {{ print (include "anchore-engine.fullname" .) "-admin-pass" }}
{{- end }}
{{- end }} {{- end }}
- configMapRef: - configMapRef:
name: {{ template "anchore-engine.fullname" . }}-env name: {{ template "anchore-engine.fullname" . }}-env
......
...@@ -92,10 +92,15 @@ spec: ...@@ -92,10 +92,15 @@ spec:
{{- end }} {{- end }}
envFrom: envFrom:
{{- if not .Values.inject_secrets_via_env }} {{- if not .Values.inject_secrets_via_env }}
{{- if .Values.anchoreGlobal.existingSecret }}
- secretRef: - secretRef:
name: {{ default (include "anchore-engine.fullname" .) .Values.anchoreGlobal.existingSecret }} name: {{ .Values.anchoreGlobal.existingSecret }}
{{- else }}
- secretRef:
name: {{ include "anchore-engine.fullname" . }}
- secretRef: - secretRef:
name: {{ default (print (include "anchore-engine.fullname" .) "-admin-pass") .Values.anchoreGlobal.existingSecret }} name: {{ print (include "anchore-engine.fullname" .) "-admin-pass" }}
{{- end }}
{{- end }} {{- end }}
- configMapRef: - configMapRef:
name: {{ template "anchore-engine.fullname" . }}-env name: {{ template "anchore-engine.fullname" . }}-env
......
{{- include "bb-test-lib.script-configmap.base" . }}
---
{{- include "bb-test-lib.script-runner.base" . }}
\ No newline at end of file
#!/bin/bash
# Wait for Anchore Engine API to go live
while [ $(curl -sw '%{http_code}' -u "admin:${ANCHORE_CLI_PASS}" "${ANCHORE_CLI_URL}/swagger.json" -o /dev/null) -ne 200 ]; do
echo "Waiting for Anchore API..."
sleep 10;
done
echo "Retrieving system health..."
status=$(anchore-cli --debug system status 2>&1)
# IF status code is 200 AND all services are up
if [[ ${status} =~ "httpcode from response: 200" && ${status} =~ "analyzer:8084): up" && ${status} =~ "simplequeue:8083): up" && ${status} =~ "policy:8087): up" && ${status} =~ "api:8228): up" && ${status} =~ "catalog:8082): up" ]]; then
echo "200 OK - all services up!"
else
echo ${status}
sleep 10
exit 1
fi
echo "Initiating image analysis..."
add=$(anchore-cli --debug image add docker.io/library/centos:latest 2>&1)
# IF status code is 200
if [[ ${add} =~ "httpcode from response: 200" ]]; then
echo "200 OK - image analysis initiated!"
else
echo ${add}
sleep 10
exit 1
fi
echo "Waiting for image analysis to complete..."
wait=$(anchore-cli --debug image wait docker.io/library/centos:latest 2>&1)
# IF status code is 200
if [[ ${wait} =~ "httpcode from response: 200" ]]; then
echo "200 OK - image analysis completed!"
else
echo ${wait}
sleep 10
exit 1
fi
# List analyzed images
echo "Listing analyzed images..."
list=$(anchore-cli --debug image list 2>&1)
# IF status code is 200
if [[ ${list} =~ "httpcode from response: 200" ]]; then
echo "200 OK - image analysis stored!"
else
echo ${list}
sleep 10
exit 1
fi
\ No newline at end of file
...@@ -114,7 +114,7 @@ cloudsql: ...@@ -114,7 +114,7 @@ cloudsql:
image: image:
# set repo and image tag of gce-proxy # set repo and image tag of gce-proxy
repository: gcr.io/cloudsql-docker/gce-proxy repository: gcr.io/cloudsql-docker/gce-proxy
tag: 1.12 tag: 1.22.0
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
# Create an ingress resource for all external anchore engine services (API & Enterprise UI). # Create an ingress resource for all external anchore engine services (API & Enterprise UI).
...@@ -953,7 +953,7 @@ anchoreEnterpriseNotifications: ...@@ -953,7 +953,7 @@ anchoreEnterpriseNotifications:
anchoreEnterpriseUi: anchoreEnterpriseUi:
# If enabled is set to false, set anchore-ui-redis.enabled to false to ensure that helm doesn't stand up a unneccessary redis instance. # If enabled is set to false, set anchore-ui-redis.enabled to false to ensure that helm doesn't stand up a unneccessary redis instance.
enabled: true enabled: true
image: registry1.dso.mil/ironbank/anchore/enterpriseui/enterpriseui:3.0.1 image: registry1.dso.mil/ironbank/anchore/enterpriseui/enterpriseui:3.0.2
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
imagePullSecretName: private-registry imagePullSecretName: private-registry
...@@ -1067,7 +1067,7 @@ anchore-ui-redis: ...@@ -1067,7 +1067,7 @@ anchore-ui-redis:
# enabled: false # enabled: false
# If 'enabled: false', specify an external redis endpoint - # If 'enabled: false', specify an external redis endpoint -
# eg redis://:<password>@hostname:6379 # eg redis://nouser:<password>@hostname:6379
externalEndpoint: Null externalEndpoint: Null
# Pod configuration for the helm post-install-hook enterprise engine upgrade Job # Pod configuration for the helm post-install-hook enterprise engine upgrade Job
......
{
"pluginsFile": false,
"supportFile": false,
"fixturesFolder": false,
"env": {
"anchore_url": "anchore-api.bigbang.dev/v1/swagger.json"
}
}
describe('Basic Anchore API', function() {
beforeEach(() => {
cy.request(Cypress.env('anchore_url')).as('anchore-api');
});
it('Validate the header', () => {
cy.get('@anchore-api')
.its('headers')
.its('content-type')
.should('include', 'application/json');
});
it('Validate the status code', () => {
cy.get('@anchore-api')
.its('status')
.should('equal', 200);
});
it('Validate API object', () => {
cy.get('@anchore-api')
.its('body')
.should('include', { basePath: '/v1' });
});
})
istio: istio:
enabled: true enabled: true
bbtests:
scripts:
image: registry1.dso.mil/ironbank/anchore/cli/cli:0.9.1
envs:
ANCHORE_CLI_URL: "http://{{ template \"anchore-engine.api.fullname\" . }}:{{ .Values.anchoreApi.service.port }}/v1"
ANCHORE_CLI_USER: admin
secretEnvs:
- name: ANCHORE_CLI_PASS
valueFrom:
secretKeyRef:
name: "{{ template \"anchore-engine.fullname\" . }}-admin-pass"
key: ANCHORE_ADMIN_PASSWORD
postgresql: postgresql:
imagePullSecrets: private-registry-mil
enabled: true enabled: true
anchoreGlobal: # anchoreGlobal:
imagePullSecretName: private-registry-mil
anchoreAnalyzer: anchoreAnalyzer:
replicaCount: 1 replicaCount: 1
anchoreEnterpriseGlobal: # anchoreEnterpriseGlobal:
imagePullSecretName: private-registry-mil
# anchore-feeds-db:
anchore-feeds-db: # anchore-ui-redis:
imagePullSecrets: private-registry-mil # global:
anchore-ui-redis: \ No newline at end of file
global:
imagePullSecrets:
- private-registry-mil
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment