From 563a123059edb39e3e9ee81cce9c586bec2fc48b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= <clement.chigot@atos.net>
Date: Tue, 14 Jan 2020 16:38:28 +0100
Subject: [PATCH 10/11] all: remove docker and k8s tests for AIX

---
 libbeat/scripts/Makefile                |  8 +++++++-
 metricbeat/mb/testing/data/data_test.go | 11 +++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/libbeat/scripts/Makefile b/libbeat/scripts/Makefile
index ddd460c3d..f575aea7c 100755
--- a/libbeat/scripts/Makefile
+++ b/libbeat/scripts/Makefile
@@ -13,7 +13,13 @@ BEAT_VENDOR?=Elastic ## @packaging Name of the vendor of the application
 BEAT_GOPATH=$(firstword $(subst :, ,${GOPATH}))
 BEAT_REF_YAML?=true
 ES_BEATS?=..## @community_beat Must be set to ./vendor/github.com/elastic/beats. It must always be a relative path.
-GOPACKAGES?=$(shell go list ${BEAT_PATH}/... | grep -v /vendor/ | grep -v /scripts/cmd/ )
+
+ifeq ($(shell uname -s), AIX)
+	# Don't list packages with docker or kubernetes on AIX
+	GOPACKAGES?=$(shell go list ${BEAT_PATH}/... | grep -v /vendor/ | grep -v /scripts/cmd/ | grep -v docker | grep -v kubernetes | grep -v /libbeat/tests/compose )
+else
+	GOPACKAGES?=$(shell go list ${BEAT_PATH}/... | grep -v /vendor/ | grep -v /scripts/cmd/ )
+endif
 PACKER_TEMPLATES_DIR?=${ES_BEATS}/dev-tools/packer ## @Building Directory of templates that are used by "make release"
 NOTICE_FILE?=../NOTICE.txt
 LICENSE_FILE?=../licenses/APACHE-LICENSE-2.0.txt
diff --git a/metricbeat/mb/testing/data/data_test.go b/metricbeat/mb/testing/data/data_test.go
index 3102780e6..945482f52 100644
--- a/metricbeat/mb/testing/data/data_test.go
+++ b/metricbeat/mb/testing/data/data_test.go
@@ -21,6 +21,7 @@ import (
 	"fmt"
 	"os"
 	"path/filepath"
+	"runtime"
 	"strings"
 	"testing"
 
@@ -39,8 +40,14 @@ func TestAll(t *testing.T) {
 		metricSetName := s[5]
 
 		t.Run(fmt.Sprintf("%s.%s", moduleName, metricSetName), func(t *testing.T) {
-			config := mbtest.ReadDataConfig(t, f)
-			mbtest.TestDataFilesWithConfig(t, moduleName, metricSetName, config)
+
+			if runtime.GOOS == "aix" && (moduleName == "docker" || moduleName == "kubernetes") {
+				t.Skipf("%s module not available on AIX", moduleName)
+
+			} else {
+				config := mbtest.ReadDataConfig(t, f)
+				mbtest.TestDataFilesWithConfig(t, moduleName, metricSetName, config)
+			}
 		})
 	}
 }
-- 
2.22.0

