Skip to content

Commit 72974a5

Browse files
committed
updated test to check for setting verifier only
1 parent d8171d3 commit 72974a5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/pgbouncer/reconcile_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,16 @@ func TestSCRAMVerifier(t *testing.T) {
126126
assert.Equal(t, string(intent.Data["pgbouncer-verifier"]), "SCRAM-SHA-256$4096:randomsalt:storedkey:serverkey")
127127
assert.Equal(t, string(intent.Data["pgbouncer-password"]), "password")
128128

129+
// Simulate the setting of a verifier only
130+
intent = new(corev1.Secret)
131+
existing.Data = map[string][]byte{
132+
"pgbouncer-verifier": []byte("SCRAM-SHA-256$4096:randomsalt:storedkey:serverkey"),
133+
}
134+
assert.NilError(t, Secret(ctx, cluster, root, existing, service, intent))
135+
assert.Assert(t, string(intent.Data["pgbouncer-verifier"]) != "SCRAM-SHA-256$4096:randomsalt:storedkey:serverkey")
136+
assert.Assert(t, len(intent.Data["pgbouncer-password"]) != 0)
137+
assert.Assert(t, len(intent.Data["pgbouncer-verifier"]) != 0)
138+
129139
}
130140

131141
func TestPod(t *testing.T) {

0 commit comments

Comments
 (0)