123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- # Copyright Materialize, Inc. and contributors. All rights reserved.
- #
- # Use of this software is governed by the Business Source License
- # included in the LICENSE file at the root of this repository.
- #
- # As of the Change Date specified in that file, in accordance with
- # the Business Source License, use of this software will be governed
- # by the Apache License, Version 2.0.
- # Test for `NETWORK POLICIES`.
- mode standard
- # Start from a pristine state
- reset-server
- # Verify initial Network Policies.
- query TTT rowsort
- select * from (SHOW NETWORK POLICIES)
- ----
- default
- open_ingress
- (empty)
- simple conn=mz_system,user=mz_system
- ALTER SYSTEM SET enable_network_policies=on
- ----
- COMPLETE 0
- simple conn=mz_system,user=mz_system
- CREATE NETWORK POLICY np (RULES ( r1 (address='0.0.0.0/32', action='allow', direction='ingress'), r2 (address='0.0.0.1/32', action='allow', direction='ingress') ))
- ----
- COMPLETE 0
- query TTT rowsort
- SELECT * FROM (SHOW NETWORK POLICIES)
- ----
- default
- open_ingress
- (empty)
- np
- r1,r2
- (empty)
- query TTT valuesort
- SELECT id, name, owner_id FROM mz_internal.mz_network_policies
- ----
- u2
- np
- s1
- u1
- default
- s1
- query TTTTT colnames,valuesort
- SELECT * FROM mz_internal.mz_network_policy_rules
- ----
- name policy_id action address direction
- r1
- u2
- allow
- 0.0.0.0/32
- ingress
- r2
- u2
- allow
- 0.0.0.1/32
- ingress
- open_ingress
- u1
- allow
- 0.0.0.0/0
- ingress
- simple conn=mz_system,user=mz_system
- ALTER NETWORK POLICY np SET (RULES (r1 (address='1.1.1.1/32', action='allow', direction='ingress') ));
- ----
- COMPLETE 0
- query TTTTT colnames,valuesort
- SELECT * FROM mz_internal.mz_network_policy_rules
- ----
- name policy_id action address direction
- r1
- u2
- allow
- 1.1.1.1/32
- ingress
- open_ingress
- u1
- allow
- 0.0.0.0/0
- ingress
- simple conn=mz_system,user=mz_system
- DROP NETWORK POLICY np;
- ----
- COMPLETE 0
- query TTT rowsort
- select * from (SHOW NETWORK POLICIES)
- ----
- default
- open_ingress
- (empty)
|