diff --git a/lib/ClientSai.cpp b/lib/ClientSai.cpp index 72f7e64af..279492dbf 100644 --- a/lib/ClientSai.cpp +++ b/lib/ClientSai.cpp @@ -1557,15 +1557,5 @@ sai_status_t ClientSai::dbgGenerateDump( SWSS_LOG_ENTER(); REDIS_CHECK_API_INITIALIZED(); - const std::vector entry = - { - swss::FieldValueTuple("DBG_GENERATE_DUMP", dump_file_name), - }; - - std::string key = "DBG_GEN_DUMP:01"; - - m_communicationChannel->set(key, entry, REDIS_ASIC_STATE_COMMAND_DBG_GEN_DUMP); - - swss::KeyOpFieldsValuesTuple kco; - return m_communicationChannel->wait(REDIS_ASIC_STATE_COMMAND_DBG_GEN_DUMPRESPONSE, kco); + return SAI_STATUS_NOT_IMPLEMENTED; } diff --git a/proxylib/Proxy.cpp b/proxylib/Proxy.cpp index 6b6d741b3..49e0e151b 100644 --- a/proxylib/Proxy.cpp +++ b/proxylib/Proxy.cpp @@ -371,7 +371,8 @@ void Proxy::processSingleEvent( void Proxy::processDbgGenerateDump( _In_ const swss::KeyOpFieldsValuesTuple &kco) { - SWSS_LOG_ENTER(); + return SAI_STATUS_SUCCESS; + /*SWSS_LOG_ENTER(); const auto& values = kfvFieldsValues(kco); if (values.size() != 1) @@ -386,7 +387,7 @@ void Proxy::processDbgGenerateDump( sai_status_t status = m_vendorSai->dbgGenerateDump(value_cstr); - m_selectableChannel->set(sai_serialize_status(status), {} , "dbg_gen_dumpresponse"); + m_selectableChannel->set(sai_serialize_status(status), {} , "dbg_gen_dumpresponse");*/ } void Proxy::processCreate( diff --git a/unittest/lib/TestClientSai.cpp b/unittest/lib/TestClientSai.cpp index 45050ad54..b2f88ddaf 100644 --- a/unittest/lib/TestClientSai.cpp +++ b/unittest/lib/TestClientSai.cpp @@ -56,7 +56,7 @@ TEST(ClientSai, dbgGenerateDump) sai.apiInitialize(0,&test_services); - const std::string filePath = "/var/log/dbgGenerateDump.log"; + const std::string filePath = "/var/log/testDump.log"; - EXPECT_EQ(SAI_STATUS_NOT_IMPLEMENTED, sai.dbgGenerateDump(filePath.c_str())); -} + EXPECT_EQ(sai.dbgGenerateDump(filePath.c_str()), SAI_STATUS_NOT_IMPLEMENTED); +} \ No newline at end of file diff --git a/unittest/lib/TestServerSai.cpp b/unittest/lib/TestServerSai.cpp index df90bcc6f..91185c025 100644 --- a/unittest/lib/TestServerSai.cpp +++ b/unittest/lib/TestServerSai.cpp @@ -49,3 +49,4 @@ TEST(ServerSai, bulkGet) SAI_BULK_OP_ERROR_MODE_STOP_ON_ERROR, statuses)); } + diff --git a/unittest/syncd/TestVendorSai.cpp b/unittest/syncd/TestVendorSai.cpp index f14d280a4..161409187 100644 --- a/unittest/syncd/TestVendorSai.cpp +++ b/unittest/syncd/TestVendorSai.cpp @@ -1558,3 +1558,10 @@ TEST_F(VendorSaiTest, bulk_prefix_compression_entry) EXPECT_EQ(SAI_STATUS_NOT_SUPPORTED, m_vsai->bulkSet(0, e, nullptr, SAI_BULK_OP_ERROR_MODE_STOP_ON_ERROR, nullptr)); } + +TEST_F(VendorSaiTest, dbgGenerateDump) +{ + const std::string filePath = "/var/log/testDump.log"; + + EXPECT_EQ(SAI_STATUS_SUCCESS, m_vsai->dbgGenerateDump(filePath.c_str())); +} \ No newline at end of file diff --git a/unittest/vslib/TestSai.cpp b/unittest/vslib/TestSai.cpp index 5c0fa810e..32d9a1a70 100644 --- a/unittest/vslib/TestSai.cpp +++ b/unittest/vslib/TestSai.cpp @@ -24,4 +24,13 @@ TEST(Sai, bulkGet) attrs, SAI_BULK_OP_ERROR_MODE_STOP_ON_ERROR, statuses)); -} \ No newline at end of file +} + +TEST(Sai, dbgGenerateDump) +{ + Sai sai; + + const std::string filePath = "/var/log/testDump.log"; + + EXPECT_EQ(SAI_STATUS_NOT_IMPLEMENTED, sai.dbgGenerateDump(filePath.c_str())); +} diff --git a/vslib/Sai.cpp b/vslib/Sai.cpp index 2248a9e52..4a5eb6585 100644 --- a/vslib/Sai.cpp +++ b/vslib/Sai.cpp @@ -856,11 +856,11 @@ sai_status_t Sai::queryApiVersion( sai_status_t Sai::dbgGenerateDump( _In_ const char *dump_file_name) { - MUTEX(); SWSS_LOG_ENTER(); - VS_CHECK_API_INITIALIZED(); - return m_meta->dbgGenerateDump(dump_file_name); + SWSS_LOG_ERROR("not implemented, FIXME"); + + return SAI_STATUS_NOT_IMPLEMENTED; }