Skip to content

Commit

Permalink
Remove unneccessary lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jul 21, 2022
1 parent 13b8271 commit 540af0f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ bool RsyslogPlugin::onMessage(string msg, lua_State* luaState) {
}
paramDict["timestamp"] = formattedTimestamp;
int returnCode = event_publish(m_eventHandle, tag, &paramDict);
if (returnCode != 0 || timestamp.empty()) {
if(returnCode != 0) {
SWSS_LOG_ERROR("rsyslog_plugin was not able to publish event for %s.\n", tag.c_str());
return false;
}
Expand Down
11 changes: 2 additions & 9 deletions src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ using namespace std;
using namespace swss;
using json = nlohmann::json;

TEST(syslog_parser, matching_regex) {

TEST(syslog_parser, matching_regex) {
json jList = json::array();
vector<regex> testExpressions;
string regexString = "timestamp (.*) message (.*) other_data (.*)";
Expand Down Expand Up @@ -166,14 +165,8 @@ TimestampFormatter* createFormatter() {
return formatter;
}

TEST(rsyslog_plugin, onInit_invalidJS0N) {
auto plugin = createPlugin("./rsyslog_plugin_tests/test_regex_1.rc.json");
EXPECT_NE(0, plugin->onInit());
delete plugin;
}

TEST(rsyslog_plugin, onInit_emptyJSON) {
auto plugin = createPlugin("./rsyslog_plugin_tests/test_regex_6.rc.json");
auto plugin = createPlugin("./rsyslog_plugin_tests/test_regex_1.rc.json");
EXPECT_NE(0, plugin->onInit());
delete plugin;
}
Expand Down
Empty file.

0 comments on commit 540af0f

Please sign in to comment.