@@ -5605,6 +5605,61 @@ Y_UNIT_TEST_SUITE(KqpScheme) {
56055605 UNIT_ASSERT_EQUAL_C (describe.GetStatus (), EStatus::SCHEME_ERROR, result.GetIssues ().ToString ());
56065606 }
56075607 }
5608+
5609+ void AsyncReplicationConnectionParams (TKikimrRunner& kikimr, const TString& connectionParam, bool ssl = false ) {
5610+ using namespace NReplication ;
5611+
5612+ auto repl = TReplicationClient (kikimr.GetDriver (), TCommonClientSettings ().Database (" /Root" ));
5613+ auto db = kikimr.GetTableClient ();
5614+ auto session = db.CreateSession ().GetValueSync ().GetSession ();
5615+
5616+ {
5617+ auto query = R"(
5618+ --!syntax_v1
5619+ CREATE TABLE `/Root/table` (Key Uint64, Value String, PRIMARY KEY (Key));
5620+ )" ;
5621+
5622+ auto result = session.ExecuteSchemeQuery (query).GetValueSync ();
5623+ UNIT_ASSERT_VALUES_EQUAL_C (result.GetStatus (), EStatus::SUCCESS, result.GetIssues ().ToString ());
5624+ }
5625+ {
5626+ auto query = Sprintf (R"(
5627+ --!syntax_v1
5628+ CREATE ASYNC REPLICATION `/Root/replication` FOR
5629+ `/Root/table` AS `/Root/replica`
5630+ WITH (
5631+ %s, TOKEN = "root@builtin"
5632+ );
5633+ )" , connectionParam.c_str ());
5634+
5635+ const auto result = session.ExecuteSchemeQuery (query).GetValueSync ();
5636+ UNIT_ASSERT_VALUES_EQUAL_C (result.GetStatus (), EStatus::SUCCESS, result.GetIssues ().ToString ());
5637+ }
5638+ {
5639+ const auto result = repl.DescribeReplication (" /Root/replication" ).ExtractValueSync ();
5640+ UNIT_ASSERT_VALUES_EQUAL_C (result.GetStatus (), EStatus::SUCCESS, result.GetIssues ().ToString ());
5641+
5642+ const auto & params = result.GetReplicationDescription ().GetConnectionParams ();
5643+ UNIT_ASSERT_VALUES_EQUAL (params.GetDiscoveryEndpoint (), kikimr.GetEndpoint ());
5644+ UNIT_ASSERT_VALUES_EQUAL (params.GetDatabase (), " /Root" );
5645+ UNIT_ASSERT_VALUES_EQUAL (params.GetEnableSsl (), ssl);
5646+ }
5647+ }
5648+
5649+ Y_UNIT_TEST (AsyncReplicationConnectionString) {
5650+ TKikimrRunner kikimr;
5651+ AsyncReplicationConnectionParams (kikimr, Sprintf (R"( CONNECTION_STRING = "grpc://%s/?database=/Root")" , kikimr.GetEndpoint ().c_str ()));
5652+ }
5653+
5654+ Y_UNIT_TEST (AsyncReplicationConnectionStringWithSsl) {
5655+ TKikimrRunner kikimr;
5656+ AsyncReplicationConnectionParams (kikimr, Sprintf (R"( CONNECTION_STRING = "grpcs://%s/?database=/Root")" , kikimr.GetEndpoint ().c_str ()), true );
5657+ }
5658+
5659+ Y_UNIT_TEST (AsyncReplicationEndpointAndDatabase) {
5660+ TKikimrRunner kikimr;
5661+ AsyncReplicationConnectionParams (kikimr, Sprintf (R"( ENDPOINT = "%s", DATABASE = "/Root")" , kikimr.GetEndpoint ().c_str ()));
5662+ }
56085663}
56095664
56105665Y_UNIT_TEST_SUITE (KqpOlapScheme) {
0 commit comments