diff options
author | kungurtsev <kungasc@ydb.tech> | 2025-02-28 11:28:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-28 11:28:57 +0100 |
commit | 89703a23ada90508f81facfd5ac66daf2be2b6e5 (patch) | |
tree | be7b158aaea7dc5e5814ca0361222f7b38ccaf45 | |
parent | 553d194460085ff0b5ce35236008c90ba2b49099 (diff) | |
download | ydb-89703a23ada90508f81facfd5ac66daf2be2b6e5.tar.gz |
SysView Auth Uncomment database admin test cases (#15180)
-rw-r--r-- | ydb/core/sys_view/ut_kqp.cpp | 72 |
1 files changed, 35 insertions, 37 deletions
diff --git a/ydb/core/sys_view/ut_kqp.cpp b/ydb/core/sys_view/ut_kqp.cpp index 0589ba9f6e..17963caa8e 100644 --- a/ydb/core/sys_view/ut_kqp.cpp +++ b/ydb/core/sys_view/ut_kqp.cpp @@ -125,6 +125,7 @@ void SetupAuthAccessEnvironment(TTestEnv& env) { env.GetServer().GetRuntime()->SetLogPriority(NKikimrServices::SYSTEM_VIEWS, NLog::PRI_TRACE); env.GetServer().GetRuntime()->GetAppData().AdministrationAllowedSIDs.emplace_back("root@builtin"); env.GetServer().GetRuntime()->GetAppData().AdministrationAllowedSIDs.emplace_back("user1rootadmin"); + env.GetServer().GetRuntime()->GetAppData().FeatureFlags.SetEnableDatabaseAdmin(true); env.GetClient().SetSecurityToken("root@builtin"); CreateTenantsAndTables(env, true); @@ -2408,19 +2409,18 @@ Y_UNIT_TEST_SUITE(SystemView) { NKqp::CompareYson(expected, NKqp::StreamResultToYson(it)); } - // TODO: make it work - // { - // auto it = client.StreamExecuteScanQuery(R"( - // SELECT Sid - // FROM `Root/Tenant1/.sys/auth_users` - // )").GetValueSync(); + { + auto it = client.StreamExecuteScanQuery(R"( + SELECT Sid + FROM `Root/Tenant1/.sys/auth_users` + )").GetValueSync(); - // auto expected = R"([ - // [["user3"]]; - // [["user4"]]; - // ])"; - // NKqp::CompareYson(expected, NKqp::StreamResultToYson(it)); - // } + auto expected = R"([ + [["user3"]]; + [["user4"]]; + ])"; + NKqp::CompareYson(expected, NKqp::StreamResultToYson(it)); + } { auto it = client.StreamExecuteScanQuery(R"( @@ -2804,19 +2804,18 @@ Y_UNIT_TEST_SUITE(SystemView) { CheckAuthAdministratorAccessIsRequired(it); } - // TODO: make it work - // { - // auto it = client.StreamExecuteScanQuery(R"( - // SELECT Sid - // FROM `Root/Tenant1/.sys/auth_groups` - // )").GetValueSync(); + { + auto it = client.StreamExecuteScanQuery(R"( + SELECT Sid + FROM `Root/Tenant1/.sys/auth_groups` + )").GetValueSync(); - // auto expected = R"([ - // [["group3"]]; - // [["group4"]]; - // ])"; - // NKqp::CompareYson(expected, NKqp::StreamResultToYson(it)); - // } + auto expected = R"([ + [["group3"]]; + [["group4"]]; + ])"; + NKqp::CompareYson(expected, NKqp::StreamResultToYson(it)); + } { auto it = client.StreamExecuteScanQuery(R"( @@ -3127,19 +3126,18 @@ Y_UNIT_TEST_SUITE(SystemView) { CheckAuthAdministratorAccessIsRequired(it); } - // TODO: make it work - // { - // auto it = client.StreamExecuteScanQuery(R"( - // SELECT * - // FROM `Root/Tenant1/.sys/auth_group_members` - // )").GetValueSync(); - - // auto expected = R"([ - // [["group3"];["user3"]]; - // [["group4"];["user4"]]; - // ])"; - // NKqp::CompareYson(expected, NKqp::StreamResultToYson(it)); - // } + { + auto it = client.StreamExecuteScanQuery(R"( + SELECT * + FROM `Root/Tenant1/.sys/auth_group_members` + )").GetValueSync(); + + auto expected = R"([ + [["group3"];["user3"]]; + [["group4"];["user4"]]; + ])"; + NKqp::CompareYson(expected, NKqp::StreamResultToYson(it)); + } { auto it = client.StreamExecuteScanQuery(R"( |