summaryrefslogtreecommitdiff
path: root/cmds/incidentd/tests/Section_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cmds/incidentd/tests/Section_test.cpp')
-rw-r--r--cmds/incidentd/tests/Section_test.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/cmds/incidentd/tests/Section_test.cpp b/cmds/incidentd/tests/Section_test.cpp
index 0c7876c1ecfb..cbfb89685de0 100644
--- a/cmds/incidentd/tests/Section_test.cpp
+++ b/cmds/incidentd/tests/Section_test.cpp
@@ -155,7 +155,7 @@ TEST(SectionTest, CommandSectionIncidentHelperTimeout) {
}
TEST(SectionTest, CommandSectionBadCommand) {
- CommandSection cs(NOOP_PARSER, "echo", "about", NULL);
+ CommandSection cs(NOOP_PARSER, "echoo", "about", NULL);
ReportRequestSet requests;
ASSERT_EQ(NAME_NOT_FOUND, cs.Execute(&requests));
}
@@ -167,6 +167,26 @@ TEST(SectionTest, CommandSectionBadCommandAndTimeout) {
ASSERT_EQ(NO_ERROR, cs.Execute(&requests));
}
+TEST(SectionTest, LogSectionBinary) {
+ LogSection ls(1, LOG_ID_EVENTS);
+ ReportRequestSet requests;
+ requests.setMainFd(STDOUT_FILENO);
+ CaptureStdout();
+ ASSERT_EQ(NO_ERROR, ls.Execute(&requests));
+ string results = GetCapturedStdout();
+ EXPECT_FALSE(results.empty());
+}
+
+TEST(SectionTest, LogSectionSystem) {
+ LogSection ls(1, LOG_ID_SYSTEM);
+ ReportRequestSet requests;
+ requests.setMainFd(STDOUT_FILENO);
+ CaptureStdout();
+ ASSERT_EQ(NO_ERROR, ls.Execute(&requests));
+ string results = GetCapturedStdout();
+ EXPECT_FALSE(results.empty());
+}
+
TEST(SectionTest, TestFilterPiiTaggedFields) {
TemporaryFile tf;
FileSection fs(NOOP_PARSER, tf.path);