Skip to content

Commit

Permalink
Fix test_ddl_forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
save-buffer committed Dec 12, 2023
1 parent 031c710 commit 458c554
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test_runner/regress/test_ddl_forwarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,15 @@ def test_ddl_forwarding(ddl: DdlForwardingContext):
# We don't have compute_ctl, so here, so create neon_superuser here manually
cur.execute("CREATE ROLE neon_superuser NOLOGIN CREATEDB CREATEROLE")

with pytest.raises(psycopg2.InternalError):
cur.execute("ALTER ROLE neon_superuser LOGIN")
# Contrary to popular belief, being superman does not make you superuser
cur.execute("CREATE ROLE superman LOGIN NOSUPERUSER PASSWORD 'jungle_man'")

with ddl.pg.cursor(user="superman", password="jungle_man") as superman_cur:
# We allow real SUPERUSERs to ALTER neon_superuser
with pytest.raises(psycopg2.InternalError):
superman_cur.execute("ALTER ROLE neon_superuser LOGIN")

cur.execute("ALTER ROLE neon_superuser LOGIN")

with pytest.raises(psycopg2.InternalError):
cur.execute("CREATE DATABASE trololobus WITH OWNER neon_superuser")
Expand Down

0 comments on commit 458c554

Please sign in to comment.