-
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.
branch-3.0: [fix](cloud) Add check for alter storage vault type (#43489)
Cherry-picked from #43352 Co-authored-by: Lei Zhang <[email protected]>
- Loading branch information
1 parent
f8c9b2c
commit e077592
Showing
3 changed files
with
96 additions
and
1 deletion.
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
78 changes: 78 additions & 0 deletions
78
regression-test/suites/vault_p0/alter/test_alter_vault_type.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,78 @@ | ||
// 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_alter_vault_type", "nonConcurrent") { | ||
def suiteName = name; | ||
if (!isCloudMode()) { | ||
logger.info("skip ${name} case, because not cloud mode") | ||
return | ||
} | ||
|
||
if (!enableStoragevault()) { | ||
logger.info("skip ${name} case, because storage vault not enabled") | ||
return | ||
} | ||
|
||
def hdfsVaultName = suiteName + "_HDFS" | ||
|
||
sql """ | ||
CREATE STORAGE VAULT IF NOT EXISTS ${hdfsVaultName} | ||
PROPERTIES ( | ||
"type"="HDFS", | ||
"fs.defaultFS"="${getHmsHdfsFs()}", | ||
"path_prefix" = "${hdfsVaultName}", | ||
"hadoop.username" = "hadoop" | ||
); | ||
""" | ||
|
||
expectExceptionLike({ | ||
sql """ | ||
ALTER STORAGE VAULT ${hdfsVaultName} | ||
PROPERTIES ( | ||
"type"="s3", | ||
"s3.access_key" = "new_ak" | ||
); | ||
""" | ||
}, "is not s3 storage vault") | ||
|
||
|
||
def s3VaultName = suiteName + "_S3" | ||
sql """ | ||
CREATE STORAGE VAULT IF NOT EXISTS ${s3VaultName} | ||
PROPERTIES ( | ||
"type"="S3", | ||
"s3.endpoint"="${getS3Endpoint()}", | ||
"s3.region" = "${getS3Region()}", | ||
"s3.access_key" = "${getS3AK()}", | ||
"s3.secret_key" = "${getS3SK()}", | ||
"s3.root.path" = "${s3VaultName}", | ||
"s3.bucket" = "${getS3BucketName()}", | ||
"s3.external_endpoint" = "", | ||
"provider" = "${getS3Provider()}" | ||
); | ||
""" | ||
|
||
expectExceptionLike({ | ||
sql """ | ||
ALTER STORAGE VAULT ${s3VaultName} | ||
PROPERTIES ( | ||
"type"="hdfs", | ||
"hadoop.username" = "hdfs" | ||
); | ||
""" | ||
}, "is not hdfs storage vault") | ||
} |
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