You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/06/02 06:47:39 UTC

[incubator-doris] branch master updated: [regression test]add encryption function test case (#9920)

This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new f681c0891f [regression test]add encryption function test case (#9920)
f681c0891f is described below

commit f681c0891f088db32d646753b369bf295ee699d0
Author: zy-kkk <81...@qq.com>
AuthorDate: Thu Jun 2 14:47:32 2022 +0800

    [regression test]add encryption function test case (#9920)
---
 .../test_encryption_function.out                   | 43 ++++++++++++++++++++++
 .../test_encryption_function.groovy                | 42 +++++++++++++++++++++
 2 files changed, 85 insertions(+)

diff --git a/regression-test/data/query/sql_functions/encryption_digest_functions/test_encryption_function.out b/regression-test/data/query/sql_functions/encryption_digest_functions/test_encryption_function.out
new file mode 100644
index 0000000000..e75c306f5d
--- /dev/null
+++ b/regression-test/data/query/sql_functions/encryption_digest_functions/test_encryption_function.out
@@ -0,0 +1,43 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !sql --
+wr2JEDVXzL9+2XtRhgIloA==
+
+-- !sql --
+tsmK1HzbpnEdR2//WhO+MA==
+
+-- !sql --
+text
+
+-- !sql --
+\N
+
+-- !sql --
+900150983cd24fb0d6963f7d28e17f72
+
+-- !sql --
+e2fc714c4727ee9395f324cd2e7f331f
+
+-- !sql --
+e2fc714c4727ee9395f324cd2e7f331f
+
+-- !sql --
+aDjwRflBrDjhBZIOFNw3Tg==
+
+-- !sql --
+1Y4NGIukSbv9OrkZnRD1bQ==
+
+-- !sql --
+text
+
+-- !sql --
+\N
+
+-- !sql --
+66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0
+
+-- !sql --
+82ec580fe6d36ae4f81cae3c73f4a5b3b5a09c943172dc9053c69fd8e18dca1e
+
+-- !sql --
+82ec580fe6d36ae4f81cae3c73f4a5b3b5a09c943172dc9053c69fd8e18dca1e
+
diff --git a/regression-test/suites/query/sql_functions/encryption_digest_functions/test_encryption_function.groovy b/regression-test/suites/query/sql_functions/encryption_digest_functions/test_encryption_function.groovy
new file mode 100644
index 0000000000..639df669fe
--- /dev/null
+++ b/regression-test/suites/query/sql_functions/encryption_digest_functions/test_encryption_function.groovy
@@ -0,0 +1,42 @@
+// 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.
+
+suite("test_encryption_function", "query") {
+    sql "set enable_vectorized_engine = true;"
+    sql "set batch_size = 4096;"
+
+    sql "set block_encryption_mode=\"AES_256_CBC\";"
+    qt_sql "SELECT TO_BASE64(AES_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3'));"
+    qt_sql "SELECT TO_BASE64(AES_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3', '0123456789'));"
+    qt_sql "SELECT AES_DECRYPT(FROM_BASE64('wr2JEDVXzL9+2XtRhgIloA=='),'F3229A0B371ED2D9441B830D21A390C3');"
+    qt_sql "SELECT AES_DECRYPT(FROM_BASE64('mvZT1KJw7N0RJf27aipUpg=='),'F3229A0B371ED2D9441B830D21A390C3', '0123456789');"
+
+    qt_sql "SELECT MD5(\"abc\");"
+
+    qt_sql "SELECT MD5(\"abcd\");"
+    qt_sql "SELECT MD5SUM(\"ab\",\"cd\");"
+
+    sql "set block_encryption_mode=\"SM4_128_CBC\";"
+    qt_sql "SELECT TO_BASE64(SM4_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3'));"
+    qt_sql "SELECT TO_BASE64(SM4_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3', '0123456789'));"
+    qt_sql "SELECT SM4_DECRYPT(FROM_BASE64('aDjwRflBrDjhBZIOFNw3Tg=='),'F3229A0B371ED2D9441B830D21A390C3');"
+    qt_sql "SELECT SM4_DECRYPT(FROM_BASE64('G7yqOKfEyxdagboz6Qf01A=='),'F3229A0B371ED2D9441B830D21A390C3', '0123456789');"
+
+    qt_sql "SELECT SM3(\"abc\");"
+    qt_sql "select sm3(\"abcd\");"
+    qt_sql "select sm3sum(\"ab\",\"cd\");"
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org