Skip to content

Commit

Permalink
Ensure user exists before rolling upgrade
Browse files Browse the repository at this point in the history
To catch regressions like crate/crate#15425 in
the future
  • Loading branch information
mfussenegger authored and matriv committed Jan 24, 2024
1 parent a4706fd commit 4cd0259
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/bwc/test_rolling_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
class RollingUpgradeTest(NodeProvider, unittest.TestCase):

def test_rolling_upgrade(self):
print("") # force newline for first print(path)
for path in ROLLING_UPGRADES:
print(path)
with self.subTest(repr(path)):
Expand Down Expand Up @@ -56,6 +57,8 @@ def _test_rolling_upgrade(self, path, nodes):
cluster.start()
with connect(cluster.node().http_url, error_trace=True) as conn:
c = conn.cursor()
c.execute("create user arthur")
c.execute("grant dql to arthur")
c.execute(f'''
CREATE TABLE doc.t1 (
type BYTE,
Expand Down Expand Up @@ -95,6 +98,13 @@ def _test_rolling_upgrade(self, path, nodes):
with connect(new_node.http_url, error_trace=True) as conn:
c = conn.cursor()
wait_for_active_shards(c, expected_active_shards)

c.execute("select name from sys.users order by 1")
self.assertEqual(c.fetchall(), [["arthur"], ["crate"]])

c.execute("select * from sys.privileges")
self.assertEqual(c.fetchall(), [["CLUSTER", "arthur", "crate", None, "GRANT", "DQL"]])

c.execute('''
SELECT type, AVG(value)
FROM doc.t1
Expand Down

0 comments on commit 4cd0259

Please sign in to comment.