From ff8fbec1681adeb494a2a998ce7a54ba2401f6ce Mon Sep 17 00:00:00 2001 From: Oded Arbel Date: Wed, 5 Sep 2018 19:48:00 +0300 Subject: [PATCH] fixup tests with expected pid where it should be expected --- internal/syslogparser/rfc3164/rfc3164_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/syslogparser/rfc3164/rfc3164_test.go b/internal/syslogparser/rfc3164/rfc3164_test.go index e707f37..17b8f6e 100644 --- a/internal/syslogparser/rfc3164/rfc3164_test.go +++ b/internal/syslogparser/rfc3164/rfc3164_test.go @@ -46,6 +46,7 @@ func (s *Rfc3164TestSuite) TestParser_Valid(c *C) { "timestamp": time.Date(now.Year(), time.October, 11, 22, 14, 15, 0, time.UTC), "hostname": "mymachine", "tag": "very.large.syslog.message.tag", + "pid": "", "content": "'su root' failed for lonvick on /dev/pts/8", "priority": 34, "facility": 4, @@ -78,6 +79,7 @@ func (s *Rfc3164TestSuite) TestParser_ValidNoTag(c *C) { "timestamp": time.Date(now.Year(), time.October, 11, 22, 14, 15, 0, time.UTC), "hostname": "mymachine", "tag": "", + "pid": "", "content": "singleword", "priority": 34, "facility": 4, @@ -112,6 +114,7 @@ func (s *Rfc3164TestSuite) TestParser_NoTimestamp(c *C) { "timestamp": now, "hostname": "", "tag": "", + "pid": "", "content": "INFO leaving (1) step postscripts", "priority": 14, "facility": 1, @@ -164,6 +167,7 @@ func (s *Rfc3164TestSuite) TestParser_ValidRFC3339Timestamp(c *C) { "timestamp": time.Date(2018, time.January, 12, 22, 14, 15, 0, time.UTC), "hostname": "mymachine", "tag": "app", + "pid": "101", "content": "msg", "priority": 34, "facility": 4, @@ -184,7 +188,8 @@ func (s *Rfc3164TestSuite) TestParsemessage_Valid(c *C) { buff := []byte("sometag[123]: " + content) hdr := rfc3164message{ tag: "sometag", - content: content, + pid: "123", + content: content } s.assertRfc3164message(c, hdr, buff, len(buff), syslogparser.ErrEOL)