diff --git a/artifacts/loadtester/config.yaml b/artifacts/loadtester/config.yaml new file mode 100644 index 00000000..b9d0f568 --- /dev/null +++ b/artifacts/loadtester/config.yaml @@ -0,0 +1,19 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: flagger-loadtester-bats +data: + tests: | + #!/usr/bin/env bats + + @test "check message" { + curl -sS http://${URL} | jq -r .message | { + run cut -d $' ' -f1 + [ $output = "greetings" ] + } + } + + @test "check headers" { + curl -sS http://${URL}/headers | grep X-Request-Id + } diff --git a/artifacts/loadtester/deployment.yaml b/artifacts/loadtester/deployment.yaml index 653ef98e..8c3664dc 100644 --- a/artifacts/loadtester/deployment.yaml +++ b/artifacts/loadtester/deployment.yaml @@ -57,3 +57,11 @@ spec: securityContext: readOnlyRootFilesystem: true runAsUser: 10001 + volumeMounts: + - name: tests + mountPath: /bats + readOnly: true + volumes: + - name: tests + configMap: + name: flagger-loadtester-bats \ No newline at end of file