From 0e64db2ad67545eb489d8236c21f3fd5234e85b7 Mon Sep 17 00:00:00 2001 From: Rob Miller Date: Mon, 5 Jan 2015 14:10:58 -0800 Subject: [PATCH] Syslog timestamp must be calculated against current year and location. --- CHANGES.txt | 11 +++++++++++ CMakeLists.txt | 2 +- cmd/hekad/main.go | 2 +- docs/source/conf.py | 2 +- sandbox/plugins/sandbox_decoders_test.go | 15 ++++++++++++--- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 2a807a31e..377dc1c40 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,14 @@ +0.8.2 (2015-01-05) +================== + +Bug Handling +------------ + +* Fix rsyslog sandbox decoder test to use current year and location for + timestamp parsing, since syslog timestamp format makes that assumption. + +* Ensure that geoip_decoder is not included in release binaries. + 0.8.1 (2014-12-17) ================== diff --git a/CMakeLists.txt b/CMakeLists.txt index 868bf50da..0c721869e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ project(heka C) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "High performance data gathering, analysis, monitoring, and reporting.") set(CPACK_PACKAGE_VERSION_MAJOR 0) set(CPACK_PACKAGE_VERSION_MINOR 8) -set(CPACK_PACKAGE_VERSION_PATCH 1) +set(CPACK_PACKAGE_VERSION_PATCH 2) set(CPACK_PACKAGE_VENDOR "Mozilla") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt") set(CPACK_PACKAGE_CONTACT "heka@mozilla.org") diff --git a/cmd/hekad/main.go b/cmd/hekad/main.go index 47b077f94..269cd03b3 100644 --- a/cmd/hekad/main.go +++ b/cmd/hekad/main.go @@ -52,7 +52,7 @@ import ( ) const ( - VERSION = "0.8.1" + VERSION = "0.8.2" ) func setGlobalConfigs(config *HekadConfig) (*pipeline.GlobalConfigStruct, string, string) { diff --git a/docs/source/conf.py b/docs/source/conf.py index 14a30814b..5200510ce 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -52,7 +52,7 @@ # The short X.Y version. version = '0.8' # The full version, including alpha/beta/rc tags. -release = '0.8.1' +release = '0.8.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/sandbox/plugins/sandbox_decoders_test.go b/sandbox/plugins/sandbox_decoders_test.go index 4a1c4a670..1cbcf3326 100644 --- a/sandbox/plugins/sandbox_decoders_test.go +++ b/sandbox/plugins/sandbox_decoders_test.go @@ -1,6 +1,7 @@ package plugins import ( + "fmt" "github.com/mozilla-services/heka/message" "github.com/mozilla-services/heka/pipeline" ts "github.com/mozilla-services/heka/pipeline/testsupport" @@ -9,6 +10,7 @@ import ( "github.com/rafrombrc/gomock/gomock" gs "github.com/rafrombrc/gospec/src/gospec" "os" + "time" ) func DecoderSpec(c gs.Context) { @@ -624,9 +626,16 @@ HugePages_Free: 0 _, err = decoder.Decode(pack) c.Assume(err, gs.IsNil) - c.Expect(pack.Message.GetTimestamp(), - gs.Equals, - int64(1392065938000000000)) + // Syslog timestamp doesn't support year, so we have to calculate + // it for the current year or else this test will fail every + // January. + year := time.Now().Year() + tStr := fmt.Sprintf("%d Feb 10 12:58:58 -0800", year) + t, err := time.Parse("2006 Jan 02 15:04:05 -0700", tStr) + c.Assume(err, gs.IsNil) + unixT := t.UnixNano() + + c.Expect(pack.Message.GetTimestamp(), gs.Equals, unixT) c.Expect(pack.Message.GetSeverity(), gs.Equals, int32(4)) c.Expect(pack.Message.GetHostname(), gs.Equals, "testhost")