From 870a21aa4c47f7f39347a48c6e1e5ae12f3a58d0 Mon Sep 17 00:00:00 2001 From: Kevin Fox Date: Wed, 10 Jan 2024 09:16:05 -0800 Subject: [PATCH] Add test Signed-off-by: Kevin Fox --- pkg/sidecar/sidecar_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/sidecar/sidecar_test.go b/pkg/sidecar/sidecar_test.go index 7e778801..3f4edf89 100644 --- a/pkg/sidecar/sidecar_test.go +++ b/pkg/sidecar/sidecar_test.go @@ -198,6 +198,14 @@ func TestDefaultAgentAddress(t *testing.T) { require.NoError(t, err) assert.Equal(t, spiffeSidecar.config.AgentAddress, "/tmp/spire-agent/public/api.sock") } + +func TestExitOnWaitFlag(t *testing.T) { + log, _ := test.NewNullLogger() + spiffeSidecar, err := New("../../test/sidecar/config/helper.conf", true, log) + require.NoError(t, err) + assert.Equal(t, spiffeSidecar.config.ExitWhenReady, true) +} + func TestEnvAgentAddress(t *testing.T) { os.Setenv("SPIRE_AGENT_ADDRESS", "/tmp/spire-agent/public/api.sock") log, _ := test.NewNullLogger()