From 8a7a4115475e84ac426216b1b1b9dafca3347d27 Mon Sep 17 00:00:00 2001 From: Vitaly Baranov Date: Thu, 19 Sep 2024 01:24:07 +0200 Subject: [PATCH] Add one more test. --- ...thout_access_entities_dependents.reference | 7 ++++ ...ckup_without_access_entities_dependents.sh | 30 ++++++++++++++++++ ...kup_without_access_entities_dependents.zip | Bin 0 -> 1996 bytes 3 files changed, 37 insertions(+) create mode 100644 tests/queries/0_stateless/03231_old_backup_without_access_entities_dependents.reference create mode 100755 tests/queries/0_stateless/03231_old_backup_without_access_entities_dependents.sh create mode 100644 tests/queries/0_stateless/backups/old_backup_without_access_entities_dependents.zip diff --git a/tests/queries/0_stateless/03231_old_backup_without_access_entities_dependents.reference b/tests/queries/0_stateless/03231_old_backup_without_access_entities_dependents.reference new file mode 100644 index 00000000000..8268df7a65b --- /dev/null +++ b/tests/queries/0_stateless/03231_old_backup_without_access_entities_dependents.reference @@ -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 diff --git a/tests/queries/0_stateless/03231_old_backup_without_access_entities_dependents.sh b/tests/queries/0_stateless/03231_old_backup_without_access_entities_dependents.sh new file mode 100755 index 00000000000..550db582b30 --- /dev/null +++ b/tests/queries/0_stateless/03231_old_backup_without_access_entities_dependents.sh @@ -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; +" diff --git a/tests/queries/0_stateless/backups/old_backup_without_access_entities_dependents.zip b/tests/queries/0_stateless/backups/old_backup_without_access_entities_dependents.zip new file mode 100644 index 0000000000000000000000000000000000000000..a20e66b2f6b8294fcd81323c467e36064caa7f20 GIT binary patch literal 1996 zcmWIWW@Zs#VB+9ln8|G%sVi%5r_IQ~u#|~`ft`VYK`$vWIlHuA>ZNSI!v;JI4^|g6 z>XqG_xhRfxXD74hYqM!0jLVlx_jB?J{7yeQ&CXuva$fYY-F9{#7xwMW?GLPJGc2C> zeYRoXDXnal1|`WU|-a-8u*W=7b&WRG9#3{SqT;(Tl(wkE}7?V7c(ge#dg zvHTXd{1%#ha;L0MzUTExHPeM}|9vB8CK+zCsE?!7iA8rJ6W2)xHv82QTOI|^%)Q=! zsh&?<>fP+N-xj$By(`0|-se@Z;|??QkSHxqEkX|orE>Mu^Eg5Rq8>RUrcN--K5QV; zlKwk<&)KsI9XcnwIAnePOyXz?ej{!r6+LPBHoY?EPoEzm9de* zz3jtNo=>WrZ#7LSzeMfortHd+RU5m`1xw6c>cQGyyr^b#`)*!)vl~p_o1(i}_e9+~ zeEdSqw#y}wZv3oypD#Bqu#zj_vs0~ApZjuZ(xH!$m;4M~h8%aA{ZpZ*tVnbc>lKfb z)3LnoY-)MmpB0^_xKr(Qep~F+>0jnMS^aa0J6_nRA93!1ba&~W>3uKk6s6j?U)a)b zpNBi>IDtWun_7}cAXN$=D?>?{u#|S@_(m=*pej8emc*hO9L9RZg*nB1MWsB2p&W%J zp9(`Y*6HYZp1rEA>!+&~R`9j>`Y-` zbx|x}YXn)q$RxsyyXXUY0}K{4f+%P~2-Acse?zngFuZUK0A@O9xI*l~rUjJW5n762 zTHs-fTPG;hBXrJ1(+MjLP<@DA9>7dk(0CTBe&jrX&*P|WSq`i^z#fPC0+t_9-GZJY z5pKDTRX?$A0VQb&07b$hW|RbuJ2*i}9HEVq1xXuPWWZ7+dXk6fU(jfdMK?SHz`_w` h40^&w7&8NlG4Ny_;LXYgQpyd4dw~J=6R4Ph0RUw8O-KL$ literal 0 HcmV?d00001