UNCLASSIFIED

Commit f32694ac authored by joshwolf's avatar joshwolf
Browse files

Merge branch 'helm-tests' into 'main'

feat: Helm test-lib library and enhanced helm testing

See merge request !21
parents a2b32982 e8df2195
Pipeline #289268 passed with stages
in 4 minutes and 42 seconds
dependencies:
- name: gluon
repository: oci://registry.dso.mil/platform-one/big-bang/apps/library-charts/gluon
version: 0.1.1
digest: sha256:cf1107c00a11cde8074a39624643312fe85ee11250bb7d9380e3787bde0af0f7
generated: "2021-06-01T10:06:05.8383699-06:00"
apiVersion: v2
name: twistlock
version: 0.0.4-bb.2
version: 0.0.4-bb.3
appVersion: 21.04.412
dependencies:
- name: gluon
version: 0.1.1
repository: oci://registry.dso.mil/platform-one/big-bang/apps/library-charts/gluon
{{- include "gluon.tests.script-configmap.overrides" (list . "twistlock-test.script-configmap") }}
{{- define "twistlock-test.script-configmap" }}
{{- end }}
---
{{- include "gluon.tests.script-runner.overrides" (list . "twistlock-test.script-runner") -}}
{{- define "twistlock-test.script-runner" -}}
{{- end }}
{{- include "gluon.tests.cypress-configmap.overrides" (list . "twistlock-test.cypress-configmap") }}
{{- define "twistlock-test.cypress-configmap" }}
{{- end }}
---
{{- include "gluon.tests.cypress-runner.overrides" (list . "twistlock-test.cypress-runner") -}}
{{- define "twistlock-test.cypress-runner" -}}
{{- end }}
{
"pluginsFile": false,
"supportFile": false,
"fixturesFolder": false,
"env": {
"twistlock_url": "twistlock.bigbang.dev"
}
"fixturesFolder": false
}
describe('Twistlock Healthcheck', function() {
it('Check console is accessible', function() {
cy.visit('/', { timeout: 5000 })
cy.title().should('eq', 'Prisma Cloud')
})
/* Below section should work, but times out because either one of Cypress or Twistlock doesn't play nice.
it('Create admin user', function() {
cy.get('input[type="text"]').type("admin")
cy.get('input[type="password"]').type(Cypress.env('twistlock_password'))
cy.get('button[type="submit"]').click()
})*/
})
#!/bin/bash
set -ex
echo "Hitting Twistlock API endpoint..."
curl -sISk -H 'Authorization: Basic "${api_auth}"' "${twistlock_host}/" &>/dev/null || export TW_DOWN="true"
if [[ ${TW_DOWN} == "true" ]]; then
echo "Test 1 Failure: Cannot hit Twistlock endpoint."
echo "Debug information (curl response):"
echo $(curl -k -H 'Authorization: Basic "${api_auth}"' "${twistlock_host}/")
exit 1
fi
echo "Test 1 Success: Twistlock API is up."
# A license is required to do more
#echo "Creating admin user for further testing"
#curl -k -H 'Content-Type: application/json' -XPOST -d '{"username": "admin", "password": "admin"}' "${twistlock_host}/api/v1/signup" &>/dev/null
#echo "Created admin user for further testing."
#
#echo "Hitting Twistlock API Version endpoint..."
#version_response=$(curl -k -H 'Content-Type: application/json' -H 'Authorization: Basic YWRtaW46YWRtaW4=' "${twistlock_host}/api/v1/version" 2>/dev/null)
#current_version=$(echo ${version_response} | xargs)
#if [ ! ${desired_version} == ${current_version} ]; then
# echo "Test 2 Failure: Twistlock version does not match."
# echo "Debug information (curl response):"
# echo $(curl -k -H 'Content-Type: application/json' -H 'Authorization: Basic "${api_auth}"' "${twistlock_host}/api/v1/version")
# exit 1
#fi
#echo "Test 2 Success: Twistlock Version Matches."
describe('Basic Twistlock Up', function() {
it('Check console is accessible', () => {
cy.visit(Cypress.env('twistlock_url'));
cy.title().should('eq', 'Prisma Cloud');
});
})
......@@ -7,3 +7,15 @@ imagePullSecrets:
console:
persistence:
size: 5Gi
bbtests:
enabled: true
cypress:
artifacts: true
envs:
cypress_baseUrl: "http://{{ .Release.Name }}-console.{{ .Release.Namespace }}.svc.cluster.local:8081"
scripts:
image: registry1.dso.mil/ironbank/stedolan/jq:1.6
envs:
twistlock_host: "https://{{ .Release.Name }}-console.{{ .Release.Namespace }}.svc.cluster.local:8083"
desired_version: "{{ .Values.console.image.tag }}"
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