Skip to content

Commit

Permalink
[fix](test)fix unstable case (apache#44401)
Browse files Browse the repository at this point in the history
  • Loading branch information
starocean999 authored Nov 26, 2024
1 parent 322edf6 commit 14d928b
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@

import org.junit.Assert;

suite("test_nereids_role", "account") {
def role= 'nereids_account_role_test'
def user = 'nereids_acount_role_user_test'
def dbName = 'nereids_account_role_test_db'
suite("test_nereids_role_x", "account") {
def role= 'nereids_account_role_test_x'
def user = 'nereids_acount_role_user_test_x'
def dbName = 'nereids_account_role_test_db_x'
def pwd = 'C123_567p'

try_sql("DROP ROLE ${role}")
try_sql("DROP USER ${user}")
sql """DROP DATABASE IF EXISTS ${dbName}"""
sql """CREATE DATABASE IF NOT EXISTS ${dbName}"""
sql """CREATE ROLE ${role}"""
sql """GRANT SELECT_PRIV ON ${context.config.defaultDb} TO ROLE '${role}'"""
sql """GRANT SELECT_PRIV ON ${dbName} TO ROLE '${role}'"""
sql """GRANT SELECT_PRIV ON internal.${context.config.defaultDb}.* TO ROLE '${role}'"""
sql """GRANT SELECT_PRIV ON internal.${dbName}.* TO ROLE '${role}'"""
sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}' DEFAULT ROLE '${role}'"""
def result1 = connect(user=user, password="${pwd}", url=context.config.jdbcUrl) {
sql "show databases like '${dbName}'"
Expand Down

0 comments on commit 14d928b

Please sign in to comment.