This is an automated email from the ASF dual-hosted git repository.
jianglongtao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 14e1181a005 Add integration test cases for DistSQL `mask rule` (#23698)
14e1181a005 is described below
commit 14e1181a005301e62cf6a6027e7312714c7e84d5
Author: Zichao <[email protected]>
AuthorDate: Mon Jan 23 16:03:00 2023 +1300
Add integration test cases for DistSQL `mask rule` (#23698)
---
.../dataset/rdl_empty_rules/alter_mask_rule.xml | 26 ++++++++++++++++++++
.../dataset/rdl_empty_rules/create_mask_rule.xml | 26 ++++++++++++++++++++
.../rdl/dataset/rdl_empty_rules/drop_mask_rule.xml | 25 +++++++++++++++++++
.../cases/rdl/rdl-integration-test-cases.xml | 19 +++++++++++++++
.../cases/rql/dataset/db/count_mask_rule.xml | 24 +++++++++++++++++++
.../cases/rql/dataset/db/show_mask_rule.xml | 25 +++++++++++++++++++
.../count_mask_rule.xml | 24 +++++++++++++++++++
.../show_mask_rule.xml | 25 +++++++++++++++++++
.../count_mask_rule.xml | 24 +++++++++++++++++++
.../show_mask_rule.xml | 25 +++++++++++++++++++
.../cases/rql/dataset/mask/count_mask_rule.xml | 25 +++++++++++++++++++
.../cases/rql/dataset/mask/show_mask_rule.xml | 28 ++++++++++++++++++++++
.../rql/dataset/mask_encrypt/count_mask_rule.xml | 25 +++++++++++++++++++
.../rql/dataset/mask_encrypt/show_mask_rule.xml | 28 ++++++++++++++++++++++
.../mask_encrypt_sharding/count_mask_rule.xml | 25 +++++++++++++++++++
.../mask_encrypt_sharding/show_mask_rule.xml | 28 ++++++++++++++++++++++
.../rql/dataset/mask_sharding/count_mask_rule.xml | 25 +++++++++++++++++++
.../rql/dataset/mask_sharding/show_mask_rule.xml | 28 ++++++++++++++++++++++
.../cases/rql/rql-integration-test-cases.xml | 8 +++++++
19 files changed, 463 insertions(+)
diff --git
a/test/e2e/suite/src/test/resources/cases/rdl/dataset/rdl_empty_rules/alter_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rdl/dataset/rdl_empty_rules/alter_mask_rule.xml
new file mode 100644
index 00000000000..e40f2b2e210
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rdl/dataset/rdl_empty_rules/alter_mask_rule.xml
@@ -0,0 +1,26 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="table" />
+ <column name="column" />
+ <column name="algorithm_type" />
+ <column name="algorithm_props" />
+ </metadata>
+ <row values="t_mask| order_id| MASK_FROM_X_TO_Y|
to-y=2,from-x=1,replace-char=*" />
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rdl/dataset/rdl_empty_rules/create_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rdl/dataset/rdl_empty_rules/create_mask_rule.xml
new file mode 100644
index 00000000000..f8e8830ae09
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rdl/dataset/rdl_empty_rules/create_mask_rule.xml
@@ -0,0 +1,26 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="table" />
+ <column name="column" />
+ <column name="algorithm_type" />
+ <column name="algorithm_props" />
+ </metadata>
+ <row values="t_mask| order_id| MD5| " />
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rdl/dataset/rdl_empty_rules/drop_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rdl/dataset/rdl_empty_rules/drop_mask_rule.xml
new file mode 100644
index 00000000000..d1bbc872414
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rdl/dataset/rdl_empty_rules/drop_mask_rule.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="table" />
+ <column name="column" />
+ <column name="algorithm_type" />
+ <column name="algorithm_props" />
+ </metadata>
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rdl/rdl-integration-test-cases.xml
b/test/e2e/suite/src/test/resources/cases/rdl/rdl-integration-test-cases.xml
index f075b50024f..2787a4da2fb 100644
--- a/test/e2e/suite/src/test/resources/cases/rdl/rdl-integration-test-cases.xml
+++ b/test/e2e/suite/src/test/resources/cases/rdl/rdl-integration-test-cases.xml
@@ -157,5 +157,24 @@
<assertion-sql sql="SHOW READWRITE_SPLITTING RULES;" />
</assertion>
</test-case>
+ <test-case sql="CREATE MASK RULE t_mask
(COLUMNS((NAME=order_id,TYPE(NAME='MD5'))));">
+ <assertion expected-data-file="create_mask_rule.xml">
+ <assertion-sql sql="SHOW MASK RULES;" />
+ <destroy-sql sql="DROP MASK RULE t_mask;" />
+ </assertion>
+ </test-case>
+ <test-case sql="ALTER MASK RULE t_mask (COLUMNS((NAME=order_id,
TYPE(NAME='MASK_FROM_X_TO_Y', PROPERTIES('from-x'=1, 'to-y'=2,
'replace-char'='*'))))));">
+ <assertion expected-data-file="alter_mask_rule.xml">
+ <initial-sql sql="CREATE MASK RULE t_mask
(COLUMNS((NAME=order_id,TYPE(NAME='MD5'))));" />
+ <assertion-sql sql="SHOW MASK RULES;" />
+ <destroy-sql sql="DROP MASK RULE t_mask;" />
+ </assertion>
+ </test-case>
+ <test-case sql="DROP MASK RULE t_mask;">
+ <assertion expected-data-file="drop_mask_rule.xml">
+ <initial-sql sql="CREATE MASK RULE t_mask
(COLUMNS((NAME=order_id,TYPE(NAME='MD5'))));" />
+ <assertion-sql sql="SHOW MASK RULES;" />
+ </assertion>
+ </test-case>
</integration-test-cases>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/db/count_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/db/count_mask_rule.xml
new file mode 100644
index 00000000000..67088a467e0
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/rql/dataset/db/count_mask_rule.xml
@@ -0,0 +1,24 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="rule_name" />
+ <column name="database" />
+ <column name="count" />
+ </metadata>
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/db/show_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/db/show_mask_rule.xml
new file mode 100644
index 00000000000..d1bbc872414
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/rql/dataset/db/show_mask_rule.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="table" />
+ <column name="column" />
+ <column name="algorithm_type" />
+ <column name="algorithm_props" />
+ </metadata>
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/count_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/count_mask_rule.xml
new file mode 100644
index 00000000000..67088a467e0
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/count_mask_rule.xml
@@ -0,0 +1,24 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="rule_name" />
+ <column name="database" />
+ <column name="count" />
+ </metadata>
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_mask_rule.xml
new file mode 100644
index 00000000000..d1bbc872414
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_mask_rule.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="table" />
+ <column name="column" />
+ <column name="algorithm_type" />
+ <column name="algorithm_props" />
+ </metadata>
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/count_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/count_mask_rule.xml
new file mode 100644
index 00000000000..67088a467e0
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/count_mask_rule.xml
@@ -0,0 +1,24 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="rule_name" />
+ <column name="database" />
+ <column name="count" />
+ </metadata>
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_mask_rule.xml
new file mode 100644
index 00000000000..d1bbc872414
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_mask_rule.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="table" />
+ <column name="column" />
+ <column name="algorithm_type" />
+ <column name="algorithm_props" />
+ </metadata>
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/mask/count_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask/count_mask_rule.xml
new file mode 100644
index 00000000000..2cf5a1d326c
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask/count_mask_rule.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="rule_name" />
+ <column name="database" />
+ <column name="count" />
+ </metadata>
+ <row values="mask| mask| 1" />
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/mask/show_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask/show_mask_rule.xml
new file mode 100644
index 00000000000..0654800c268
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask/show_mask_rule.xml
@@ -0,0 +1,28 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="table" />
+ <column name="column" />
+ <column name="algorithm_type" />
+ <column name="algorithm_props" />
+ </metadata>
+ <row values="t_user| password| MD5| " />
+ <row values="t_user| email| MASK_BEFORE_SPECIAL_CHARS|
special-chars=@,replace-char=*" />
+ <row values="t_user| telephone| KEEP_FIRST_N_LAST_M|
first-n=3,last-m=4,replace-char=*" />
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_encrypt/count_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_encrypt/count_mask_rule.xml
new file mode 100644
index 00000000000..195ea840e10
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_encrypt/count_mask_rule.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="rule_name" />
+ <column name="database" />
+ <column name="count" />
+ </metadata>
+ <row values="mask| mask_encrypt| 1" />
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_encrypt/show_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_encrypt/show_mask_rule.xml
new file mode 100644
index 00000000000..0654800c268
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_encrypt/show_mask_rule.xml
@@ -0,0 +1,28 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="table" />
+ <column name="column" />
+ <column name="algorithm_type" />
+ <column name="algorithm_props" />
+ </metadata>
+ <row values="t_user| password| MD5| " />
+ <row values="t_user| email| MASK_BEFORE_SPECIAL_CHARS|
special-chars=@,replace-char=*" />
+ <row values="t_user| telephone| KEEP_FIRST_N_LAST_M|
first-n=3,last-m=4,replace-char=*" />
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_encrypt_sharding/count_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_encrypt_sharding/count_mask_rule.xml
new file mode 100644
index 00000000000..772ef4189d9
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_encrypt_sharding/count_mask_rule.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="rule_name" />
+ <column name="database" />
+ <column name="count" />
+ </metadata>
+ <row values="mask| mask_encrypt_sharding| 1" />
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_encrypt_sharding/show_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_encrypt_sharding/show_mask_rule.xml
new file mode 100644
index 00000000000..0654800c268
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_encrypt_sharding/show_mask_rule.xml
@@ -0,0 +1,28 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="table" />
+ <column name="column" />
+ <column name="algorithm_type" />
+ <column name="algorithm_props" />
+ </metadata>
+ <row values="t_user| password| MD5| " />
+ <row values="t_user| email| MASK_BEFORE_SPECIAL_CHARS|
special-chars=@,replace-char=*" />
+ <row values="t_user| telephone| KEEP_FIRST_N_LAST_M|
first-n=3,last-m=4,replace-char=*" />
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_sharding/count_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_sharding/count_mask_rule.xml
new file mode 100644
index 00000000000..43e11169ac7
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_sharding/count_mask_rule.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="rule_name" />
+ <column name="database" />
+ <column name="count" />
+ </metadata>
+ <row values="mask| mask_sharding| 1" />
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_sharding/show_mask_rule.xml
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_sharding/show_mask_rule.xml
new file mode 100644
index 00000000000..0654800c268
--- /dev/null
+++
b/test/e2e/suite/src/test/resources/cases/rql/dataset/mask_sharding/show_mask_rule.xml
@@ -0,0 +1,28 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="table" />
+ <column name="column" />
+ <column name="algorithm_type" />
+ <column name="algorithm_props" />
+ </metadata>
+ <row values="t_user| password| MD5| " />
+ <row values="t_user| email| MASK_BEFORE_SPECIAL_CHARS|
special-chars=@,replace-char=*" />
+ <row values="t_user| telephone| KEEP_FIRST_N_LAST_M|
first-n=3,last-m=4,replace-char=*" />
+</dataset>
diff --git
a/test/e2e/suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
b/test/e2e/suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
index 704be14ca66..f6443b1846a 100644
--- a/test/e2e/suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
+++ b/test/e2e/suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
@@ -117,6 +117,10 @@
<assertion expected-data-file="show_encrypt_rule.xml" />
</test-case>
+ <test-case sql="SHOW MASK RULES"
scenario-types="db,dbtbl_with_readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,mask,mask_encrypt,mask_encrypt_sharding,mask_sharding">
+ <assertion expected-data-file="show_mask_rule.xml" />
+ </test-case>
+
<!--TODO add db discovery tests-->
<test-case sql="SHOW DB_DISCOVERY RULES"
scenario-types="sharding_governance">
<assertion expected-data-file="show_discovery_rules.xml" />
@@ -149,4 +153,8 @@
<test-case sql="COUNT SHADOW RULE;"
scenario-types="db,tbl,encrypt,dbtbl_with_readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,sharding_and_encrypt,encrypt_and_readwrite_splitting,readwrite_splitting">
<assertion expected-data-file="count_shadow_rule.xml" />
</test-case>
+
+ <test-case sql="COUNT MASK RULE;"
scenario-types="db,dbtbl_with_readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,mask,mask_encrypt,mask_encrypt_sharding,mask_sharding">
+ <assertion expected-data-file="count_mask_rule.xml" />
+ </test-case>
</integration-test-cases>