-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(test)[auth]Add call auth module case
- Loading branch information
Showing
66 changed files
with
5,422 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
1,111 | ||
2,222 | ||
3,333 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
4,444 | ||
5,555 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
1,2 | ||
3,5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
1,111 | ||
2,222 | ||
3,333 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test_dml_multi_routine_load_auth_tb1|49|2023-08-08|FALSE|\N|16275|-2144851675|-2303421957908954634|-46526938720058765|-13141.142578|-686632233.230200|229942298.0|-152553823.0|2022-09-01 00:16:01|2023-03-25|2022-09-07 14:59:03|s||yvuILR2iNxfe8RRml|{"student": true, "name": "Alice", "grade": 9, "subjects": ["math", "science", "history"]}|true|1|2|3|4|5|6.0|7.0|888888888|999999999|2023-08-24|2023-08-24 12:00:00|2023-08-24|2023-08-24 12:00:00|我能吞下玻璃而不伤身体|我能吞下玻璃而不伤身体|我能吞下玻璃而不伤身体|{} | ||
test_dml_multi_routine_load_auth_tb2|49|2023-08-08|FALSE|\N|16275|-2144851675|-2303421957908954634|-46526938720058765|-13141.142578|-686632233.230200|229942298.0|-152553823.0|2022-09-01 00:16:01|2023-03-25|2022-09-07 14:59:03|s||yvuILR2iNxfe8RRml|{"student": true, "name": "Alice", "grade": 9, "subjects": ["math", "science", "history"]}|true|1|2|3|4|5|6.0|7.0|888888888|999999999|2023-08-24|2023-08-24 12:00:00|2023-08-24|2023-08-24 12:00:00|我能吞下玻璃而不伤身体|我能吞下玻璃而不伤身体|我能吞下玻璃而不伤身体|{} |
46 changes: 46 additions & 0 deletions
46
regression-test/suites/auth_call/ddl/test_dml_multi_routine_load_auth_tb1.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
CREATE TABLE test_dml_multi_routine_load_auth_tb1 | ||
( | ||
k00 INT NOT NULL, | ||
k01 DATE NOT NULL, | ||
k02 BOOLEAN NULL, | ||
k03 TINYINT NULL, | ||
k04 SMALLINT NULL, | ||
k05 INT NULL, | ||
k06 BIGINT NULL, | ||
k07 LARGEINT NULL, | ||
k08 FLOAT NULL, | ||
k09 DOUBLE NULL, | ||
k10 DECIMAL(9,1) NULL, | ||
k11 DECIMALV3(9,1) NULL, | ||
k12 DATETIME NULL, | ||
k13 DATEV2 NULL, | ||
k14 DATETIMEV2 NULL, | ||
k15 CHAR NULL, | ||
k16 VARCHAR NULL, | ||
k17 STRING NULL, | ||
k18 JSON NULL, | ||
|
||
INDEX idx_inverted_k104 (`k05`) USING INVERTED, | ||
INDEX idx_inverted_k110 (`k11`) USING INVERTED, | ||
INDEX idx_inverted_k113 (`k13`) USING INVERTED, | ||
INDEX idx_inverted_k114 (`k14`) USING INVERTED, | ||
INDEX idx_inverted_k117 (`k17`) USING INVERTED PROPERTIES("parser" = "english"), | ||
INDEX idx_ngrambf_k115 (`k15`) USING NGRAM_BF PROPERTIES("gram_size"="3", "bf_size"="256"), | ||
INDEX idx_ngrambf_k116 (`k16`) USING NGRAM_BF PROPERTIES("gram_size"="3", "bf_size"="256"), | ||
INDEX idx_ngrambf_k117 (`k17`) USING NGRAM_BF PROPERTIES("gram_size"="3", "bf_size"="256"), | ||
|
||
INDEX idx_bitmap_k104 (`k02`) USING BITMAP | ||
|
||
) | ||
DUPLICATE KEY(k00) | ||
PARTITION BY RANGE(k01) | ||
( | ||
PARTITION p1 VALUES [('2023-08-01'), ('2023-08-11')), | ||
PARTITION p2 VALUES [('2023-08-11'), ('2023-08-21')), | ||
PARTITION p3 VALUES [('2023-08-21'), ('2023-09-01')) | ||
) | ||
DISTRIBUTED BY HASH(k00) BUCKETS 32 | ||
PROPERTIES ( | ||
"bloom_filter_columns"="k05", | ||
"replication_num" = "1" | ||
); |
46 changes: 46 additions & 0 deletions
46
regression-test/suites/auth_call/ddl/test_dml_multi_routine_load_auth_tb2.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
CREATE TABLE test_dml_multi_routine_load_auth_tb2 | ||
( | ||
k00 INT NOT NULL, | ||
k01 DATE NOT NULL, | ||
k02 BOOLEAN NULL, | ||
k03 TINYINT NULL, | ||
k04 SMALLINT NULL, | ||
k05 INT NULL, | ||
k06 BIGINT NULL, | ||
k07 LARGEINT NULL, | ||
k08 FLOAT NULL, | ||
k09 DOUBLE NULL, | ||
k10 DECIMAL(9,1) NULL, | ||
k11 DECIMALV3(9,1) NULL, | ||
k12 DATETIME NULL, | ||
k13 DATEV2 NULL, | ||
k14 DATETIMEV2 NULL, | ||
k15 CHAR NULL, | ||
k16 VARCHAR NULL, | ||
k17 STRING NULL, | ||
k18 JSON NULL, | ||
|
||
INDEX idx_inverted_k104 (`k05`) USING INVERTED, | ||
INDEX idx_inverted_k110 (`k11`) USING INVERTED, | ||
INDEX idx_inverted_k113 (`k13`) USING INVERTED, | ||
INDEX idx_inverted_k114 (`k14`) USING INVERTED, | ||
INDEX idx_inverted_k117 (`k17`) USING INVERTED PROPERTIES("parser" = "english"), | ||
INDEX idx_ngrambf_k115 (`k15`) USING NGRAM_BF PROPERTIES("gram_size"="3", "bf_size"="256"), | ||
INDEX idx_ngrambf_k116 (`k16`) USING NGRAM_BF PROPERTIES("gram_size"="3", "bf_size"="256"), | ||
INDEX idx_ngrambf_k117 (`k17`) USING NGRAM_BF PROPERTIES("gram_size"="3", "bf_size"="256"), | ||
|
||
INDEX idx_bitmap_k104 (`k02`) USING BITMAP | ||
|
||
) | ||
DUPLICATE KEY(k00) | ||
PARTITION BY RANGE(k01) | ||
( | ||
PARTITION p1 VALUES [('2023-08-01'), ('2023-08-11')), | ||
PARTITION p2 VALUES [('2023-08-11'), ('2023-08-21')), | ||
PARTITION p3 VALUES [('2023-08-21'), ('2023-09-01')) | ||
) | ||
DISTRIBUTED BY HASH(k00) BUCKETS 32 | ||
PROPERTIES ( | ||
"bloom_filter_columns"="k05", | ||
"replication_num" = "1" | ||
); |
92 changes: 92 additions & 0 deletions
92
regression-test/suites/auth_call/test_account_management_grant_auth.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
import org.junit.Assert; | ||
import org.codehaus.groovy.runtime.IOGroovyMethods | ||
|
||
suite("test_account_management_grant_auth","p0,auth_call") { | ||
|
||
String user = 'test_account_management_grant_auth_user' | ||
String pwd = 'C123_567p' | ||
String dbName = 'test_account_management_grant_auth_db' | ||
String user_derive = 'test_account_management_grant_user_derive_role' | ||
String role_derive = 'test_account_management_grant_role_derive_role' | ||
|
||
try_sql("DROP USER ${user}") | ||
try_sql("DROP USER ${user_derive}") | ||
try_sql """drop database if exists ${dbName}""" | ||
|
||
sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'""" | ||
sql """grant select_priv on regression_test to ${user}""" | ||
sql """create database ${dbName}""" | ||
|
||
connect(user=user, password="${pwd}", url=context.config.jdbcUrl) { | ||
test { | ||
sql """CREATE USER ${user_derive} IDENTIFIED BY '${pwd}';""" | ||
exception "denied" | ||
} | ||
test { | ||
sql """ALTER USER ${user_derive} IDENTIFIED BY "${pwd}";""" | ||
exception "denied" | ||
} | ||
test { | ||
sql """SET PASSWORD FOR '${user_derive}' = PASSWORD('${pwd}')""" | ||
exception "denied" | ||
} | ||
test { | ||
sql """SET PROPERTY FOR '${user_derive}' 'max_user_connections' = '1000';""" | ||
exception "denied" | ||
} | ||
test { | ||
sql """DROP user ${user_derive}""" | ||
exception "denied" | ||
} | ||
test { | ||
sql """SET LDAP_ADMIN_PASSWORD = PASSWORD('${pwd}')""" | ||
exception "denied" | ||
} | ||
} | ||
sql """grant grant_priv on *.*.* to '${user}'""" | ||
connect(user=user, password="${pwd}", url=context.config.jdbcUrl) { | ||
sql """CREATE USER ${user_derive} IDENTIFIED BY '${pwd}';""" | ||
sql """ALTER USER ${user_derive} IDENTIFIED BY "${pwd}";""" | ||
sql """SET PASSWORD FOR '${user_derive}' = PASSWORD('${pwd}')""" | ||
test { | ||
sql """SET PROPERTY FOR '${user_derive}' 'max_user_connections' = '1000';""" | ||
exception "denied" | ||
} | ||
sql """DROP user ${user_derive}""" | ||
test { | ||
sql """SET LDAP_ADMIN_PASSWORD = PASSWORD('${pwd}')""" | ||
exception "denied" | ||
} | ||
} | ||
sql """revoke grant_priv on *.*.* from '${user}'""" | ||
sql """grant admin_priv on *.*.* to '${user}'""" | ||
connect(user=user, password="${pwd}", url=context.config.jdbcUrl) { | ||
sql """CREATE USER ${user_derive} IDENTIFIED BY '${pwd}';""" | ||
sql """ALTER USER ${user_derive} IDENTIFIED BY "${pwd}";""" | ||
sql """SET PASSWORD FOR '${user_derive}' = PASSWORD('${pwd}')""" | ||
sql """SET PROPERTY FOR '${user_derive}' 'max_user_connections' = '1000';""" | ||
sql """DROP user ${user_derive}""" | ||
sql """SET LDAP_ADMIN_PASSWORD = PASSWORD('${pwd}')""" | ||
} | ||
|
||
sql """drop database if exists ${dbName}""" | ||
try_sql("DROP USER ${user}") | ||
try_sql("DROP role ${user_derive}") | ||
} |
65 changes: 65 additions & 0 deletions
65
regression-test/suites/auth_call/test_account_management_role_auth.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
import org.junit.Assert; | ||
import org.codehaus.groovy.runtime.IOGroovyMethods | ||
|
||
suite("test_account_management_role_auth","p0,auth_call") { | ||
|
||
String user = 'test_account_management_role_auth_user' | ||
String role = 'test_account_management_role_auth_role' | ||
String pwd = 'C123_567p' | ||
String dbName = 'test_account_management_role_auth_db' | ||
|
||
String role_derive = 'test_account_management_role_auth_derive_role' | ||
|
||
try_sql("DROP USER ${user}") | ||
try_sql("DROP role ${role}") | ||
try_sql("DROP role ${role_derive}") | ||
try_sql """drop database if exists ${dbName}""" | ||
sql """CREATE ROLE ${role}""" | ||
sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'""" | ||
sql """grant select_priv on regression_test to ${user}""" | ||
sql """create database ${dbName}""" | ||
sql """GRANT '${role}' TO ${user};""" | ||
|
||
connect(user=user, password="${pwd}", url=context.config.jdbcUrl) { | ||
test { | ||
sql """CREATE ROLE ${role_derive}""" | ||
exception "denied" | ||
} | ||
test { | ||
sql """ALTER ROLE ${role_derive} COMMENT "this is my first role";""" | ||
exception "denied" | ||
} | ||
test { | ||
sql """DROP ROLE ${role_derive}""" | ||
exception "denied" | ||
} | ||
} | ||
sql """grant grant_priv on *.*.* to ROLE '${role}'""" | ||
connect(user=user, password="${pwd}", url=context.config.jdbcUrl) { | ||
sql """CREATE ROLE ${role_derive}""" | ||
sql """ALTER ROLE ${role_derive} COMMENT "this is my first role";""" | ||
sql """DROP ROLE ${role_derive}""" | ||
} | ||
|
||
sql """drop database if exists ${dbName}""" | ||
try_sql("DROP USER ${user}") | ||
try_sql("DROP role ${role}") | ||
try_sql("DROP role ${role_derive}") | ||
} |
Oops, something went wrong.