Skip to content

Commit cabf834

Browse files
committed
TestDynamicCertificates: Check the initial state
1 parent ef60735 commit cabf834

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/operator/staticpod/certsyncpod/certsync_controller_linux_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ func TestDynamicCertificates(t *testing.T) {
5050
t.Fatalf("Failed to init dynamic certificate: %v", err)
5151
}
5252

53+
// Check the initial keypair is loaded.
54+
cert, key := dc.CurrentCertKeyContent()
55+
if !bytes.Equal(cert, []byte(tlsCert)) || !bytes.Equal(key, []byte(tlsKey)) {
56+
t.Fatal("Unexpected initial keypair loaded")
57+
}
58+
5359
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
5460
var wg sync.WaitGroup
5561
wg.Add(1)

0 commit comments

Comments
 (0)