( t *testing.T, cfg *PgConfiguration, majorVersion int, includingMandatory, alterSystemEnabled bool, )
| 119 | } |
| 120 | |
| 121 | func 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'` |
no test coverage detected