Files
neon/test_runner/regress/test_createuser.py
Matthias van de Meent 209fd611ac Some work on reducing test setup overhead
With the introduction of test-local tenants and timelines, we can still
allow tests to share a pageserver and/or safekeeper, removing the overhead
of setting up those components.

Future work can add wrappers for Pageserver, Safekeepers, and other APIs
that expose tenant-level configuration options that shouldn't impact
concurrent or sequential tests that reuse the same PS/SK resources.

Important note: This doesn't yet work consistently for all updated tests.

[skip ci]
2024-09-19 09:59:24 +02:00

26 lines
808 B
Python

from fixtures.neon_fixtures import NeonEnv
from fixtures.shared_fixtures import TTimeline
from fixtures.utils import query_scalar
#
# Test CREATE USER to check shared catalog restore
#
def test_createuser(timeline: TTimeline):
endpoint = timeline.primary
with endpoint.cursor() as cur:
# Cause a 'relmapper' change in the original branch
cur.execute("CREATE USER testuser with password %s", ("testpwd",))
cur.execute("CHECKPOINT")
lsn = query_scalar(cur, "SELECT pg_current_wal_insert_lsn()")
# Create a branch
branch = timeline.create_branch("test_createuser2", lsn=lsn)
endpoint2 = branch.primary
# Test that you can connect to new branch as a new user
assert endpoint2.safe_psql("select current_user", user="testuser") == [("testuser",)]