Skip to content

Commit 5941790

Browse files
kungaijon
authored andcommitted
SysView Auth Uncomment database admin test cases (ydb-platform#15180)
1 parent 1baa1a8 commit 5941790

File tree

1 file changed

+35
-37
lines changed

1 file changed

+35
-37
lines changed

ydb/core/sys_view/ut_kqp.cpp

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ void SetupAuthAccessEnvironment(TTestEnv& env) {
125125
env.GetServer().GetRuntime()->SetLogPriority(NKikimrServices::SYSTEM_VIEWS, NLog::PRI_TRACE);
126126
env.GetServer().GetRuntime()->GetAppData().AdministrationAllowedSIDs.emplace_back("root@builtin");
127127
env.GetServer().GetRuntime()->GetAppData().AdministrationAllowedSIDs.emplace_back("user1rootadmin");
128+
env.GetServer().GetRuntime()->GetAppData().FeatureFlags.SetEnableDatabaseAdmin(true);
128129
env.GetClient().SetSecurityToken("root@builtin");
129130
CreateTenantsAndTables(env, true);
130131

@@ -2406,19 +2407,18 @@ Y_UNIT_TEST_SUITE(SystemView) {
24062407
NKqp::CompareYson(expected, NKqp::StreamResultToYson(it));
24072408
}
24082409

2409-
// TODO: make it work
2410-
// {
2411-
// auto it = client.StreamExecuteScanQuery(R"(
2412-
// SELECT Sid
2413-
// FROM `Root/Tenant1/.sys/auth_users`
2414-
// )").GetValueSync();
2410+
{
2411+
auto it = client.StreamExecuteScanQuery(R"(
2412+
SELECT Sid
2413+
FROM `Root/Tenant1/.sys/auth_users`
2414+
)").GetValueSync();
24152415

2416-
// auto expected = R"([
2417-
// [["user3"]];
2418-
// [["user4"]];
2419-
// ])";
2420-
// NKqp::CompareYson(expected, NKqp::StreamResultToYson(it));
2421-
// }
2416+
auto expected = R"([
2417+
[["user3"]];
2418+
[["user4"]];
2419+
])";
2420+
NKqp::CompareYson(expected, NKqp::StreamResultToYson(it));
2421+
}
24222422

24232423
{
24242424
auto it = client.StreamExecuteScanQuery(R"(
@@ -2802,19 +2802,18 @@ Y_UNIT_TEST_SUITE(SystemView) {
28022802
CheckAuthAdministratorAccessIsRequired(it);
28032803
}
28042804

2805-
// TODO: make it work
2806-
// {
2807-
// auto it = client.StreamExecuteScanQuery(R"(
2808-
// SELECT Sid
2809-
// FROM `Root/Tenant1/.sys/auth_groups`
2810-
// )").GetValueSync();
2805+
{
2806+
auto it = client.StreamExecuteScanQuery(R"(
2807+
SELECT Sid
2808+
FROM `Root/Tenant1/.sys/auth_groups`
2809+
)").GetValueSync();
28112810

2812-
// auto expected = R"([
2813-
// [["group3"]];
2814-
// [["group4"]];
2815-
// ])";
2816-
// NKqp::CompareYson(expected, NKqp::StreamResultToYson(it));
2817-
// }
2811+
auto expected = R"([
2812+
[["group3"]];
2813+
[["group4"]];
2814+
])";
2815+
NKqp::CompareYson(expected, NKqp::StreamResultToYson(it));
2816+
}
28182817

28192818
{
28202819
auto it = client.StreamExecuteScanQuery(R"(
@@ -3125,19 +3124,18 @@ Y_UNIT_TEST_SUITE(SystemView) {
31253124
CheckAuthAdministratorAccessIsRequired(it);
31263125
}
31273126

3128-
// TODO: make it work
3129-
// {
3130-
// auto it = client.StreamExecuteScanQuery(R"(
3131-
// SELECT *
3132-
// FROM `Root/Tenant1/.sys/auth_group_members`
3133-
// )").GetValueSync();
3134-
3135-
// auto expected = R"([
3136-
// [["group3"];["user3"]];
3137-
// [["group4"];["user4"]];
3138-
// ])";
3139-
// NKqp::CompareYson(expected, NKqp::StreamResultToYson(it));
3140-
// }
3127+
{
3128+
auto it = client.StreamExecuteScanQuery(R"(
3129+
SELECT *
3130+
FROM `Root/Tenant1/.sys/auth_group_members`
3131+
)").GetValueSync();
3132+
3133+
auto expected = R"([
3134+
[["group3"];["user3"]];
3135+
[["group4"];["user4"]];
3136+
])";
3137+
NKqp::CompareYson(expected, NKqp::StreamResultToYson(it));
3138+
}
31413139

31423140
{
31433141
auto it = client.StreamExecuteScanQuery(R"(

0 commit comments

Comments
 (0)