@@ -3429,6 +3429,48 @@ Y_UNIT_TEST_SUITE(TImportTests) {
34293429 UNIT_ASSERT (entry.HasEndTime ());
34303430 UNIT_ASSERT_LT (entry.GetStartTime ().seconds (), entry.GetEndTime ().seconds ());
34313431 }
3432+
3433+ Y_UNIT_TEST (UserSID) {
3434+ TTestBasicRuntime runtime;
3435+ TTestEnv env (runtime);
3436+ ui64 txId = 100 ;
3437+
3438+ const auto data = GenerateTestData (R"(
3439+ columns {
3440+ name: "key"
3441+ type { optional_type { item { type_id: UTF8 } } }
3442+ }
3443+ columns {
3444+ name: "value"
3445+ type { optional_type { item { type_id: UTF8 } } }
3446+ }
3447+ primary_key: "key"
3448+ )" , {{" a" , 1 }});
3449+
3450+ TPortManager portManager;
3451+ const ui16 port = portManager.GetPort ();
3452+
3453+ TS3Mock s3Mock (ConvertTestData (data), TS3Mock::TSettings (port));
3454+ UNIT_ASSERT (s3Mock.Start ());
3455+
3456+ const TString request = Sprintf (R"(
3457+ ImportFromS3Settings {
3458+ endpoint: "localhost:%d"
3459+ scheme: HTTP
3460+ items {
3461+ source_prefix: ""
3462+ destination_path: "/MyRoot/Table"
3463+ }
3464+ }
3465+ )" , port);
3466+ const TString userSID = " user@builtin" ;
3467+ TestImport (runtime, ++txId, " /MyRoot" , request, userSID);
3468+
3469+ const auto desc = TestGetImport (runtime, txId, " /MyRoot" );
3470+ const auto & entry = desc.GetResponse ().GetEntry ();
3471+ UNIT_ASSERT_VALUES_EQUAL (entry.GetProgress (), Ydb::Import::ImportProgress::PROGRESS_PREPARING);
3472+ UNIT_ASSERT_VALUES_EQUAL (entry.GetUserSID (), userSID);
3473+ }
34323474}
34333475
34343476Y_UNIT_TEST_SUITE (TImportWithRebootsTests) {
0 commit comments