Skip to content

Commit

Permalink
e2e: test coordinator metrics endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
davidweisse committed May 21, 2024
1 parent d5cad82 commit 4b3c7a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions e2e/openssl/openssl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ func TestOpenSSL(t *testing.T) {

require.True(t, t.Run("contrast verify", ct.Verify), "contrast verify needs to succeed for subsequent tests")

t.Run("check coordinator metrics endpoint", func(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
defer cancel()

require := require.New(t)

require.NoError(ct.Kubeclient.WaitForDeployment(ctx, ct.Namespace, opensslFrontend))

frontendPods, err := ct.Kubeclient.PodsFromDeployment(ctx, ct.Namespace, opensslFrontend)
require.NoError(err)
require.Len(frontendPods, 1, "pod not found: %s/%s", ct.Namespace, opensslFrontend)

_, stderr, err := ct.Kubeclient.Exec(ctx, ct.Namespace, frontendPods[0].Name, []string{"/bin/bash", "-c", "curl --fail coordinator:9102/metrics"})
require.NoError(err, "stderr: %q", stderr)
})

for cert, pool := range map[string]*x509.CertPool{
"mesh CA cert": ct.MeshCACert(),
"root CA cert": ct.RootCACert(),
Expand Down
1 change: 1 addition & 0 deletions packages/containers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ let
openssl
procps
vim
curl
];
config = {
Cmd = [ "bash" ];
Expand Down

0 comments on commit 4b3c7a6

Please sign in to comment.