From b1f70fb73713b00badc9bd454a3a6b427739334f Mon Sep 17 00:00:00 2001 From: Christoph Wurm Date: Mon, 28 Jan 2019 11:43:50 +0000 Subject: [PATCH] Skip login dataset tests when not on a little-endian system. --- x-pack/auditbeat/module/system/login/login_test.go | 5 +++++ x-pack/auditbeat/tests/system/test_metricsets.py | 1 + 2 files changed, 6 insertions(+) diff --git a/x-pack/auditbeat/module/system/login/login_test.go b/x-pack/auditbeat/module/system/login/login_test.go index e7b0d54787bb..f2278edb02b1 100644 --- a/x-pack/auditbeat/module/system/login/login_test.go +++ b/x-pack/auditbeat/module/system/login/login_test.go @@ -7,6 +7,7 @@ package login import ( + "encoding/binary" "testing" "github.com/elastic/beats/auditbeat/core" @@ -14,6 +15,10 @@ import ( ) func TestData(t *testing.T) { + if byteOrder != binary.LittleEndian { + t.Skip("Test only works on little-endian systems - skipping.") + } + f := mbtest.NewReportingMetricSetV2(t, getConfig()) events, errs := mbtest.ReportingFetchV2(f) if len(errs) > 0 { diff --git a/x-pack/auditbeat/tests/system/test_metricsets.py b/x-pack/auditbeat/tests/system/test_metricsets.py index 2b81756841dc..1f515488e8f0 100644 --- a/x-pack/auditbeat/tests/system/test_metricsets.py +++ b/x-pack/auditbeat/tests/system/test_metricsets.py @@ -23,6 +23,7 @@ def test_metricset_host(self): self.check_metricset("system", "host", COMMON_FIELDS + fields, warnings_allowed=True) @unittest.skipUnless(sys.platform == "linux2", "Only implemented for Linux") + @unittest.skipIf(sys.byteorder != "little", "Test only implemented for little-endian systems") def test_metricset_login(self): """ login metricset collects information about logins (successful and failed) and system restarts.