Skip to content

Commit ac8b874

Browse files
committed
Fix tests
Signed-off-by: Moritz Hoffmann <mh@materialize.com>
1 parent dc5ce5b commit ac8b874

File tree

14 files changed

+212
-106
lines changed

14 files changed

+212
-106
lines changed

doc/user/data/examples/rbac-cloud/grant_roles.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@
4747
mz_system | PUBLIC | | | quickstart | cluster | USAGE
4848
```
4949
test_results: |
50+
materialize PUBLIC <null> <null> compute_cluster cluster CREATEDATAFLOW
51+
materialize PUBLIC <null> <null> serving_cluster cluster CREATEDATAFLOW
5052
materialize PUBLIC mydb <null> public schema USAGE
5153
mz_system PUBLIC <null> <null> materialize database USAGE
54+
mz_system PUBLIC <null> <null> quickstart cluster CREATEDATAFLOW
5255
mz_system PUBLIC <null> <null> quickstart cluster USAGE
5356
mz_system PUBLIC materialize <null> public schema USAGE
5457

doc/user/data/examples/rbac-cloud/show_privileges.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
SHOW PRIVILEGES FOR "blue.berry@example.com";
1414
test_results: |
1515
mz_system PUBLIC <null> <null> materialize database USAGE
16+
mz_system PUBLIC <null> <null> quickstart cluster CREATEDATAFLOW
1617
mz_system PUBLIC <null> <null> quickstart cluster USAGE
1718
mz_system PUBLIC materialize <null> public schema USAGE
1819

doc/user/data/examples/rbac-sm/grant_roles.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@
4747
| mz_system | view_manager | null | null | compute_cluster | cluster | USAGE |
4848
```
4949
test_results: |
50+
materialize PUBLIC <null> <null> compute_cluster cluster CREATEDATAFLOW
51+
materialize PUBLIC <null> <null> serving_cluster cluster CREATEDATAFLOW
5052
materialize PUBLIC mydb <null> public schema USAGE
5153
mz_system PUBLIC <null> <null> materialize database USAGE
54+
mz_system PUBLIC <null> <null> quickstart cluster CREATEDATAFLOW
5255
mz_system PUBLIC <null> <null> quickstart cluster USAGE
5356
mz_system PUBLIC materialize <null> public schema USAGE
5457

doc/user/data/examples/rbac-sm/show_privileges.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
SHOW PRIVILEGES FOR "blue.berry@example.com";
1212
test_results: |
1313
mz_system PUBLIC <null> <null> materialize database USAGE
14+
mz_system PUBLIC <null> <null> quickstart cluster CREATEDATAFLOW
1415
mz_system PUBLIC <null> <null> quickstart cluster USAGE
1516
mz_system PUBLIC materialize <null> public schema USAGE
1617

misc/python/materialize/checks/all_checks/default_privileges.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def validate(self) -> Testdrive:
8080
LEFT JOIN mz_databases AS databases ON defaults.database_id = databases.id
8181
LEFT JOIN mz_schemas AS schemas ON defaults.schema_id = schemas.id
8282
ORDER BY role_name, grantee_name;
83+
PUBLIC <null> <null> cluster PUBLIC D
8384
PUBLIC <null> <null> cluster mz_support U
8485
PUBLIC <null> <null> database mz_support U
8586
PUBLIC <null> <null> schema mz_support U

misc/python/materialize/checks/all_checks/owners.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,11 @@ def validate(self) -> Testdrive:
493493
contains: column "privileges" does not exist
494494
495495
> SELECT name, unnest(privileges)::text FROM mz_clusters WHERE name LIKE 'owner_cluster%'
496+
owner_cluster1 =D/owner_role_01
496497
owner_cluster1 mz_support=U/owner_role_01
497-
owner_cluster1 owner_role_01=UC/owner_role_01
498-
owner_cluster2 mz_support=U/other_owner
499-
owner_cluster2 other_owner=UC/other_owner
498+
owner_cluster1 owner_role_01=UCD/owner_role_01
499+
owner_cluster2 =D/other_owner
500+
owner_cluster2 other_owner=UCD/other_owner
500501
501502
> SELECT name, unnest(privileges)::text FROM mz_connections WHERE name LIKE 'owner_%'
502503
owner_csr_conn1 owner_role_01=U/owner_role_01

misc/python/materialize/checks/all_checks/privileges.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,9 @@ def validate(self) -> Testdrive:
264264
265265
> SELECT name, unnest(privileges)::text FROM mz_clusters WHERE name LIKE 'privilege_cluster%'
266266
privilege_cluster1 mz_support=U/materialize
267-
privilege_cluster1 materialize=UC/materialize
268-
privilege_cluster1 role_1=UC/materialize
267+
privilege_cluster1 =D/materialize
268+
privilege_cluster1 materialize=UCD/materialize
269+
privilege_cluster1 role_1=UCD/materialize
269270
270271
> SELECT name, unnest(privileges)::text FROM mz_connections WHERE name LIKE 'privilege_%'
271272
privilege_csr_conn1 materialize=U/materialize

src/catalog/tests/snapshots/debug__opened_trace.snap

Lines changed: 65 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
source: src/catalog/tests/debug.rs
3-
assertion_line: 233
43
expression: test_trace
54
---
65
Trace {
@@ -44,6 +43,37 @@ Trace {
4443
AuditLogEventV1 {
4544
id: 2,
4645
event_type: Grant,
46+
object_type: Cluster,
47+
user: None,
48+
occurred_at: EpochMillis {
49+
millis: 0,
50+
},
51+
details: AlterDefaultPrivilegeV1(
52+
AlterDefaultPrivilegeV1 {
53+
role_id: "p",
54+
database_id: None,
55+
schema_id: None,
56+
grantee_id: "p",
57+
privileges: "D",
58+
},
59+
),
60+
},
61+
),
62+
},
63+
(),
64+
),
65+
2,
66+
Overflowing(
67+
1,
68+
),
69+
),
70+
(
71+
(
72+
AuditLogKey {
73+
event: V1(
74+
AuditLogEventV1 {
75+
id: 3,
76+
event_type: Grant,
4777
object_type: Database,
4878
user: None,
4979
occurred_at: EpochMillis {
@@ -73,7 +103,7 @@ Trace {
73103
AuditLogKey {
74104
event: V1(
75105
AuditLogEventV1 {
76-
id: 3,
106+
id: 4,
77107
event_type: Grant,
78108
object_type: Schema,
79109
user: None,
@@ -104,7 +134,7 @@ Trace {
104134
AuditLogKey {
105135
event: V1(
106136
AuditLogEventV1 {
107-
id: 4,
137+
id: 5,
108138
event_type: Grant,
109139
object_type: Type,
110140
user: None,
@@ -135,7 +165,7 @@ Trace {
135165
AuditLogKey {
136166
event: V1(
137167
AuditLogEventV1 {
138-
id: 5,
168+
id: 6,
139169
event_type: Create,
140170
object_type: Database,
141171
user: None,
@@ -163,7 +193,7 @@ Trace {
163193
AuditLogKey {
164194
event: V1(
165195
AuditLogEventV1 {
166-
id: 6,
196+
id: 7,
167197
event_type: Grant,
168198
object_type: Database,
169199
user: None,
@@ -193,7 +223,7 @@ Trace {
193223
AuditLogKey {
194224
event: V1(
195225
AuditLogEventV1 {
196-
id: 7,
226+
id: 8,
197227
event_type: Create,
198228
object_type: Schema,
199229
user: None,
@@ -226,7 +256,7 @@ Trace {
226256
AuditLogKey {
227257
event: V1(
228258
AuditLogEventV1 {
229-
id: 8,
259+
id: 9,
230260
event_type: Create,
231261
object_type: NetworkPolicy,
232262
user: None,
@@ -254,7 +284,7 @@ Trace {
254284
AuditLogKey {
255285
event: V1(
256286
AuditLogEventV1 {
257-
id: 9,
287+
id: 10,
258288
event_type: Create,
259289
object_type: Cluster,
260290
user: None,
@@ -282,7 +312,7 @@ Trace {
282312
AuditLogKey {
283313
event: V1(
284314
AuditLogEventV1 {
285-
id: 10,
315+
id: 11,
286316
event_type: Grant,
287317
object_type: Cluster,
288318
user: None,
@@ -294,7 +324,7 @@ Trace {
294324
object_id: "Cu1",
295325
grantee_id: "p",
296326
grantor_id: "s1",
297-
privileges: "U",
327+
privileges: "UD",
298328
},
299329
),
300330
},
@@ -312,7 +342,7 @@ Trace {
312342
AuditLogKey {
313343
event: V1(
314344
AuditLogEventV1 {
315-
id: 11,
345+
id: 12,
316346
event_type: Create,
317347
object_type: ClusterReplica,
318348
user: None,
@@ -355,7 +385,7 @@ Trace {
355385
AuditLogKey {
356386
event: V1(
357387
AuditLogEventV1 {
358-
id: 12,
388+
id: 13,
359389
event_type: Grant,
360390
object_type: System,
361391
user: None,
@@ -403,7 +433,7 @@ Trace {
403433
1,
404434
),
405435
acl_mode: AclMode {
406-
bitflags: 256,
436+
bitflags: 268435712,
407437
},
408438
},
409439
MzAclItem {
@@ -425,7 +455,7 @@ Trace {
425455
1,
426456
),
427457
acl_mode: AclMode {
428-
bitflags: 768,
458+
bitflags: 268436224,
429459
},
430460
},
431461
],
@@ -630,6 +660,26 @@ Trace {
630660
1,
631661
),
632662
),
663+
(
664+
(
665+
DefaultPrivilegesKey {
666+
role_id: Public,
667+
database_id: None,
668+
schema_id: None,
669+
object_type: Cluster,
670+
grantee: Public,
671+
},
672+
DefaultPrivilegesValue {
673+
privileges: AclMode {
674+
bitflags: 268435456,
675+
},
676+
},
677+
),
678+
2,
679+
Overflowing(
680+
1,
681+
),
682+
),
633683
(
634684
(
635685
DefaultPrivilegesKey {
@@ -684,7 +734,7 @@ Trace {
684734
name: "auditlog",
685735
},
686736
IdAllocValue {
687-
next_id: 13,
737+
next_id: 14,
688738
},
689739
),
690740
2,

src/catalog/tests/snapshots/open__initial_snapshot.snap

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
source: src/catalog/tests/open.rs
3-
assertion_line: 518
43
expression: test_snapshot
54
---
65
Snapshot {
@@ -554,7 +553,7 @@ Snapshot {
554553
1,
555554
),
556555
acl_mode: AclMode {
557-
bitflags: 256,
556+
bitflags: 268435712,
558557
},
559558
},
560559
MzAclItem {
@@ -576,7 +575,7 @@ Snapshot {
576575
1,
577576
),
578577
acl_mode: AclMode {
579-
bitflags: 768,
578+
bitflags: 268436224,
580579
},
581580
},
582581
],
@@ -677,7 +676,7 @@ Snapshot {
677676
IdAllocKey {
678677
name: "auditlog",
679678
}: IdAllocValue {
680-
next_id: 13,
679+
next_id: 14,
681680
},
682681
IdAllocKey {
683682
name: "database",
@@ -782,6 +781,17 @@ Snapshot {
782781
bitflags: 256,
783782
},
784783
},
784+
DefaultPrivilegesKey {
785+
role_id: Public,
786+
database_id: None,
787+
schema_id: None,
788+
object_type: Cluster,
789+
grantee: Public,
790+
}: DefaultPrivilegesValue {
791+
privileges: AclMode {
792+
bitflags: 268435456,
793+
},
794+
},
785795
DefaultPrivilegesKey {
786796
role_id: Public,
787797
database_id: None,

0 commit comments

Comments
 (0)