MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / checkAlterSystem

Function checkAlterSystem

pkg/postgres/configuration_fuzz_test.go:121–138  ·  view source on GitHub ↗
(
	t *testing.T,
	cfg *PgConfiguration,
	majorVersion int,
	includingMandatory, alterSystemEnabled bool,
)

Source from the content-addressed store, hash-verified

119}
120
121func checkAlterSystem(
122 t *testing.T,
123 cfg *PgConfiguration,
124 majorVersion int,
125 includingMandatory, alterSystemEnabled bool,
126) {
127 t.Helper()
128 if !includingMandatory || majorVersion < 17 {
129 return
130 }
131 want := "off"
132 if alterSystemEnabled {
133 want = "on"
134 }
135 if got := cfg.GetConfig("allow_alter_system"); got != want {
136 t.Fatalf("allow_alter_system mismatch: got %q want %q", got, want)
137 }
138}
139
140// checkRenderedConfWellFormed enforces the postgresql.conf injection
141// invariant: a user-controlled value cannot break out of its `key = 'value'`

Calls 1

GetConfigMethod · 0.80

Tested by

no test coverage detected