Skip to content

Commit 932a732

Browse files
committed
Revert "Fix and add unitest - draft"
This reverts commit 6b6fc3a.
1 parent 6b6fc3a commit 932a732

File tree

9 files changed

+4
-66
lines changed

9 files changed

+4
-66
lines changed

lib/Recorder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ void Recorder::recordDbgGenDumpResponse(
321321
{
322322
SWSS_LOG_ENTER();
323323

324-
recordLine("G|" + sai_serialize_status(status));
324+
recordLine("F|" + sai_serialize_status(status));
325325
}
326326

327327
void Recorder::recordQueryAttributeCapability(

lib/RedisRemoteSaiInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,7 @@ sai_status_t RedisRemoteSaiInterface::dbgGenerateDump(
19261926

19271927
if (m_syncMode)
19281928
{
1929-
SWSS_LOG_DEBUG("wait for generate dump response");
1929+
SWSS_LOG_DEBUG("wait for generate dump response");
19301930
swss::KeyOpFieldsValuesTuple kco;
19311931
auto status = m_communicationChannel->wait(REDIS_ASIC_STATE_COMMAND_DBG_GEN_DUMPRESPONSE, kco);
19321932
m_recorder->recordDbgGenDumpResponse(status);

proxylib/Proxy.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -362,33 +362,9 @@ void Proxy::processSingleEvent(
362362
if (op == "clear_stats")
363363
return processClearStats(kco);
364364

365-
if (op == "dbg_gen_dump")
366-
return processDbgGenerateDump(kco);
367-
368365
SWSS_LOG_THROW("event op '%s' is not implemented, FIXME", op.c_str());
369366
}
370367

371-
void Proxy::processDbgGenerateDump(
372-
_In_ const swss::KeyOpFieldsValuesTuple &kco)
373-
{
374-
SWSS_LOG_ENTER();
375-
376-
const auto& values = kfvFieldsValues(kco);
377-
if (values.size() != 1)
378-
{
379-
SWSS_LOG_THROW("Invalid input: expected 1 arguments, received %zu", values.size());
380-
}
381-
382-
auto& fieldValues = kfvFieldsValues(kco);
383-
384-
auto value = fvValue(fieldValues[0]);
385-
const char* value_cstr = value.c_str();
386-
387-
sai_status_t status = m_vendorSai->dbgGenerateDump(value_cstr);
388-
389-
m_selectableChannel->set(sai_serialize_status(status), {} , "dbg_gen_dumpresponse");
390-
}
391-
392368
void Proxy::processCreate(
393369
_In_ const swss::KeyOpFieldsValuesTuple &kco)
394370
{

proxylib/Proxy.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ namespace saiproxy
106106
void processClearStats(
107107
_In_ const swss::KeyOpFieldsValuesTuple &kco);
108108

109-
void processDbgGenerateDump(
110-
_In_ const swss::KeyOpFieldsValuesTuple &kco);
111-
112109
private: // notifications
113110

114111
void onFdbEvent(

proxylib/Sai.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,11 +1133,7 @@ sai_status_t Sai::dbgGenerateDump(
11331133

11341134
m_communicationChannel->set(key, entry, "dbg_gen_dump");
11351135

1136-
swss::KeyOpFieldsValuesTuple kco;
1137-
1138-
auto status = m_communicationChannel->wait("dbg_gen_dumpresponse", kco);
1139-
1140-
return status;
1136+
return SAI_STATUS_SUCCESS;
11411137
}
11421138

11431139
void Sai::updateNotifications(

unittest/lib/TestSai.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,6 @@ TEST(Sai, queryApiVersion)
4040
EXPECT_EQ(sai.queryApiVersion(&version), SAI_STATUS_SUCCESS);
4141
}
4242

43-
TEST(Sai, dbgGenerateDump)
44-
{
45-
Sai sai;
46-
47-
sai.apiInitialize(0,&test_services);
48-
49-
const std::string filePath = "/var/log/testDump.log";
50-
51-
auto status = sai.dbgGenerateDump(filePath.c_str());
52-
53-
EXPECT_EQ(status, SAI_STATUS_SUCCESS);
54-
}
55-
5643
TEST(Sai, bulkGet)
5744
{
5845
Sai sai;

unittest/meta/TestDummySaiInterface.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,6 @@ TEST(DummySaiInterface, queryApiVersion)
2020
EXPECT_EQ(sai.queryApiVersion(&version), SAI_STATUS_SUCCESS);
2121
}
2222

23-
TEST(DummySaiInterface, dbgGenerateDump)
24-
{
25-
DummySaiInterface sai;
26-
27-
sai.apiInitialize(0,0);
28-
29-
const std::string filePath = "/var/log/testDump.log";
30-
31-
EXPECT_EQ(sai.dbgGenerateDump(filePath.c_str()), SAI_STATUS_SUCCESS);
32-
}
33-
3423
TEST(DummySaiInterface, bulkGet)
3524
{
3625
DummySaiInterface sai;

unittest/vslib/TestVirtualSwitchSaiInterface.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,6 @@ TEST_F(VirtualSwitchSaiInterfaceTest, queryApiVersion)
122122
EXPECT_EQ(m_vssai->queryApiVersion(&version), SAI_STATUS_SUCCESS);
123123
}
124124

125-
TEST_F(VirtualSwitchSaiInterfaceTest, dbgGenerateDump)
126-
{
127-
const std::string filePath = "/var/log/testDump.log";
128-
129-
EXPECT_EQ(m_vssai->dbgGenerateDump(filePath.c_str()), SAI_STATUS_SUCCESS);
130-
}
131-
132125
TEST_F(VirtualSwitchSaiInterfaceTest, bulkGet)
133126
{
134127
sai_object_id_t oids[1] = {0};

0 commit comments

Comments
 (0)