This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 5b814e6e653 [cases](regression-test) Add create and drop S3 repository
test (#25568)
5b814e6e653 is described below
commit 5b814e6e6531e02eb1975f2c7b9b7ee11065fa22
Author: walter <[email protected]>
AuthorDate: Wed Oct 18 22:16:31 2023 +0800
[cases](regression-test) Add create and drop S3 repository test (#25568)
---
.../test_create_and_drop_repository.groovy | 84 ++++++++++++++++++++++
1 file changed, 84 insertions(+)
diff --git
a/regression-test/suites/backup_restore/test_create_and_drop_repository.groovy
b/regression-test/suites/backup_restore/test_create_and_drop_repository.groovy
new file mode 100644
index 00000000000..b291703e733
--- /dev/null
+++
b/regression-test/suites/backup_restore/test_create_and_drop_repository.groovy
@@ -0,0 +1,84 @@
+// 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_create_and_drop_repository", "backup_restore") {
+ String repoName = "test_create_and_drop_repository"
+
+ try_sql "DROP REPOSITORY `${repoName}`"
+
+ String ak = getS3AK()
+ String sk = getS3SK()
+ String endpoint = getS3Endpoint()
+ String region = getS3Region()
+ String bucket = context.config.otherConfigs.get("s3BucketName");
+
+ def filter_show_repo_result = { result, name ->
+ for (record in result) {
+ if (record[1] == name)
+ return record
+ }
+ null
+ }
+
+ // case 1. S3 repo
+ sql """
+ CREATE REPOSITORY `${repoName}`
+ WITH S3
+ ON LOCATION "s3://${bucket}/${repoName}"
+ PROPERTIES
+ (
+ "s3.endpoint" = "http://${endpoint}",
+ "s3.region" = "${region}",
+ "s3.access_key" = "${ak}",
+ "s3.secret_key" = "${sk}"
+ )
+ """
+
+ def result = sql """ SHOW REPOSITORIES """
+ def repo = filter_show_repo_result(result, repoName)
+ assertTrue(repo != null)
+
+ sql "DROP REPOSITORY `${repoName}`"
+
+ result = sql """ SHOW REPOSITORIES """
+ repo = filter_show_repo_result(result, repoName)
+ assertTrue(repo == null)
+
+ // case 2. S3 read only repo
+ sql """
+ CREATE READ ONLY REPOSITORY `${repoName}`
+ WITH S3
+ ON LOCATION "s3://${bucket}/${repoName}"
+ PROPERTIES
+ (
+ "s3.endpoint" = "http://${endpoint}",
+ "s3.region" = "${region}",
+ "s3.access_key" = "${ak}",
+ "s3.secret_key" = "${sk}"
+ )
+ """
+
+ result = sql """ SHOW REPOSITORIES """
+ repo = filter_show_repo_result(result, repoName)
+ assertTrue(repo != null)
+
+ sql "DROP REPOSITORY `${repoName}`"
+
+ result = sql """ SHOW REPOSITORIES """
+ repo = filter_show_repo_result(result, repoName)
+ assertTrue(repo == null)
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]