forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
tests/queries/0_stateless/03231_old_backup_without_access_entities_dependents.reference
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,7 @@ | ||
CREATE USER user_03231 IDENTIFIED WITH no_password DEFAULT ROLE role_a_03231 SETTINGS custom_x = \'x\' | ||
GRANT role_a_03231 TO user_03231 | ||
CREATE ROLE role_a_03231 | ||
GRANT INSERT ON *.* TO role_a_03231 | ||
GRANT role_b_03231 TO role_a_03231 | ||
CREATE ROLE role_b_03231 | ||
GRANT SELECT ON *.* TO role_b_03231 |
30 changes: 30 additions & 0 deletions
30
tests/queries/0_stateless/03231_old_backup_without_access_entities_dependents.sh
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,30 @@ | ||
#!/usr/bin/env bash | ||
# Tags: no-fasttest, no-parallel | ||
# Tag no-fasttest: we restore from a zip-archived backup here. | ||
# Tag no-parallel: we drop and restore fixed users and roles. | ||
|
||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
# shellcheck source=../shell_config.sh | ||
. "$CURDIR"/../shell_config.sh | ||
|
||
# In this test we restore from "/tests/queries/0_stateless/backups/old_backup_without_access_entities_dependents.zip" | ||
backup_name="$($CURDIR/helpers/install_predefined_backup.sh old_backup_without_access_entities_dependents.zip)" | ||
|
||
${CLICKHOUSE_CLIENT} -m --query " | ||
DROP USER IF EXISTS user_03231; | ||
DROP ROLE IF EXISTS role_a_03231, role_b_03231; | ||
" | ||
|
||
${CLICKHOUSE_CLIENT} --query "RESTORE ALL FROM Disk('backups', '${backup_name}') FORMAT Null" | ||
|
||
${CLICKHOUSE_CLIENT} --query "SHOW CREATE USER user_03231" | ||
${CLICKHOUSE_CLIENT} --query "SHOW GRANTS FOR user_03231" | ||
${CLICKHOUSE_CLIENT} --query "SHOW CREATE ROLE role_a_03231" | ||
${CLICKHOUSE_CLIENT} --query "SHOW GRANTS FOR role_a_03231" | ||
${CLICKHOUSE_CLIENT} --query "SHOW CREATE ROLE role_b_03231" | ||
${CLICKHOUSE_CLIENT} --query "SHOW GRANTS FOR role_b_03231" | ||
|
||
${CLICKHOUSE_CLIENT} -m --query " | ||
DROP USER user_03231; | ||
DROP ROLE role_a_03231, role_b_03231; | ||
" |
Binary file added
BIN
+1.95 KB
tests/queries/0_stateless/backups/old_backup_without_access_entities_dependents.zip
Binary file not shown.