Skip to content

Commit 4a2d3a5

Browse files
kungaKamil Khamitov
authored and
Kamil Khamitov
committed
SysView Auth Uncomment database admin test cases (ydb-platform#15180)
1 parent 2717185 commit 4a2d3a5

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

@@ -2408,19 +2409,18 @@ Y_UNIT_TEST_SUITE(SystemView) {
24082409
NKqp::CompareYson(expected, NKqp::StreamResultToYson(it));
24092410
}
24102411

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

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

24252425
{
24262426
auto it = client.StreamExecuteScanQuery(R"(
@@ -2804,19 +2804,18 @@ Y_UNIT_TEST_SUITE(SystemView) {
28042804
CheckAuthAdministratorAccessIsRequired(it);
28052805
}
28062806

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

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

28212820
{
28222821
auto it = client.StreamExecuteScanQuery(R"(
@@ -3127,19 +3126,18 @@ Y_UNIT_TEST_SUITE(SystemView) {
31273126
CheckAuthAdministratorAccessIsRequired(it);
31283127
}
31293128

3130-
// TODO: make it work
3131-
// {
3132-
// auto it = client.StreamExecuteScanQuery(R"(
3133-
// SELECT *
3134-
// FROM `Root/Tenant1/.sys/auth_group_members`
3135-
// )").GetValueSync();
3136-
3137-
// auto expected = R"([
3138-
// [["group3"];["user3"]];
3139-
// [["group4"];["user4"]];
3140-
// ])";
3141-
// NKqp::CompareYson(expected, NKqp::StreamResultToYson(it));
3142-
// }
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+
}
31433141

31443142
{
31453143
auto it = client.StreamExecuteScanQuery(R"(

0 commit comments

Comments
 (0)