@@ -73,16 +73,6 @@ echo "### Sets multiple roles when there are other parameters in the query"
7373$CLICKHOUSE_CURL -u $TEST_USER_AUTH -sS " $CLICKHOUSE_URL &role=$TEST_ROLE1 &$CHANGED_SETTING_NAME =$CHANGED_SETTING_VALUE &role=$TEST_ROLE2 " --data-binary " $SHOW_CURRENT_ROLES_QUERY "
7474$CLICKHOUSE_CURL -u $TEST_USER_AUTH -sS " $CLICKHOUSE_URL &role=$TEST_ROLE1 &$CHANGED_SETTING_NAME =$CHANGED_SETTING_VALUE &role=$TEST_ROLE2 " --data-binary " $SHOW_CHANGED_SETTINGS_QUERY "
7575
76- echo " ### Cannot set a role that is not granted to the user (single parameter)"
77- OUT=$( $CLICKHOUSE_CURL -u $TEST_USER_AUTH -sS " $CLICKHOUSE_URL &role=$TEST_ROLE_NOT_GRANTED " --data-binary " $SHOW_CURRENT_ROLES_QUERY " )
78- echo -ne $OUT | grep -o " Code: 497" || echo " expected code 497, got: $OUT "
79- echo -ne $OUT | grep -o " ACCESS_DENIED" || echo " expected ACCESS_DENIED error, got: $OUT "
80-
81- echo " ### Cannot set a role that is not granted to the user (multiple parameters)"
82- OUT=$( $CLICKHOUSE_CURL -u $TEST_USER_AUTH -sS " $CLICKHOUSE_URL &role=$TEST_ROLE1 &role=$TEST_ROLE_NOT_GRANTED " --data-binary " $SHOW_CURRENT_ROLES_QUERY " )
83- echo -ne $OUT | grep -o " Code: 497" || echo " expected code 497, got: $OUT "
84- echo -ne $OUT | grep -o " ACCESS_DENIED" || echo " expected ACCESS_DENIED error, got: $OUT "
85-
8676echo " ### Cannot set a role that does not exist (single parameter)"
8777OUT=$( $CLICKHOUSE_CURL -u $TEST_USER_AUTH -sS " $CLICKHOUSE_URL &role=aaaaaaaaaaa" --data-binary " $SHOW_CURRENT_ROLES_QUERY " )
8878echo -ne $OUT | grep -o " Code: 511" || echo " expected code 511, got: $OUT "
@@ -93,6 +83,16 @@ OUT=$($CLICKHOUSE_CURL -u $TEST_USER_AUTH -sS "$CLICKHOUSE_URL&role=$TEST_ROLE1&
9383echo -ne $OUT | grep -o " Code: 511" || echo " expected code 511, got: $OUT "
9484echo -ne $OUT | grep -o " UNKNOWN_ROLE" || echo " expected UNKNOWN_ROLE error, got: $OUT "
9585
86+ echo " ### Cannot set a role that is not granted to the user (single parameter)"
87+ OUT=$( $CLICKHOUSE_CURL -u $TEST_USER_AUTH -sS " $CLICKHOUSE_URL &role=$TEST_ROLE_NOT_GRANTED " --data-binary " $SHOW_CURRENT_ROLES_QUERY " )
88+ echo -ne $OUT | grep -o " Code: 512" || echo " expected code 512, got: $OUT "
89+ echo -ne $OUT | grep -o " SET_NON_GRANTED_ROLE" || echo " expected SET_NON_GRANTED_ROLE error, got: $OUT "
90+
91+ echo " ### Cannot set a role that is not granted to the user (multiple parameters)"
92+ OUT=$( $CLICKHOUSE_CURL -u $TEST_USER_AUTH -sS " $CLICKHOUSE_URL &role=$TEST_ROLE1 &role=$TEST_ROLE_NOT_GRANTED " --data-binary " $SHOW_CURRENT_ROLES_QUERY " )
93+ echo -ne $OUT | grep -o " Code: 512" || echo " expected code 512, got: $OUT "
94+ echo -ne $OUT | grep -o " SET_NON_GRANTED_ROLE" || echo " expected SET_NON_GRANTED_ROLE error, got: $OUT "
95+
9696$CLICKHOUSE_CLIENT -n --query "
9797DROP USER $TEST_USER ;
9898DROP ROLE $TEST_ROLE1 ;
0 commit comments