I've started reviewing this patch in earnest, and almost immediately hit a serious problem: these regression tests aren't even a little bit committable. For one thing, they fail if you do "make installcheck" twice in a row. This seems to be because the first run leaves some cruft behind in pg_parameter_acl that affects the results of subsequent runs. But the bigger problem is that it is ABSOLUTELY NOT OKAY to test ALTER SYSTEM during an "installcheck" run. That would be true even if you cleaned up all the settings by the end of the run, as the patch fails to do (and for extra demerit, it leaves a superuser role laying around). Even transient effects on the behavior of sessions in other DBs aren't acceptable in installcheck mode, IMO.
I think we probably have to trash the core-regression-tests part of the patch altogether and instead use a TAP test for whatever testing we want to do. It might be all right to test SET privileges without testing ALTER SYSTEM, but I'm not sure there's much point in that. regards, tom lane