diff --git a/filebeat/tests/system/filebeat.py b/filebeat/tests/system/filebeat.py index 52d6ea0fdda..32902e3b321 100644 --- a/filebeat/tests/system/filebeat.py +++ b/filebeat/tests/system/filebeat.py @@ -18,7 +18,7 @@ def setUpClass(self): if not hasattr(self, "beat_name"): self.beat_name = "filebeat" if not hasattr(self, "beat_path"): - self.beat_path = os.path.abspath(os.path.join(curdir, "../../")) + self.beat_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../")) super(BaseTest, self).setUpClass() diff --git a/libbeat/tests/system/beat/common_tests.py b/libbeat/tests/system/beat/common_tests.py index ed390c44df5..9a194af3eea 100644 --- a/libbeat/tests/system/beat/common_tests.py +++ b/libbeat/tests/system/beat/common_tests.py @@ -56,6 +56,10 @@ def test_export_index_pattern(self): output = self.run_export_cmd("index-pattern") js = json.loads(output) assert "objects" in js + size = len(output.encode('utf-8')) + assert size < 1024*1024, "Kibana index pattern must be less than 1MiB " \ + "to keep the Beat setup request size below " \ + "Kibana's server.maxPayloadBytes." @unittest.skipUnless(INTEGRATION_TESTS, "integration test") def test_export_config(self): diff --git a/x-pack/filebeat/tests/system/test_filebeat_xpack.py b/x-pack/filebeat/tests/system/test_filebeat_xpack.py new file mode 100644 index 00000000000..1890498fd0a --- /dev/null +++ b/x-pack/filebeat/tests/system/test_filebeat_xpack.py @@ -0,0 +1,30 @@ +import jinja2 +import os +import sys + +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../filebeat/tests/system'))) + +from filebeat import BaseTest as FilebeatTest +from beat import common_tests + + +class FilebeatXPackTest(FilebeatTest, common_tests.TestExportsMixin): + + @classmethod + def setUpClass(self): + self.beat_name = "filebeat" + self.beat_path = os.path.abspath( + os.path.join(os.path.dirname(__file__), "../../")) + + super(FilebeatTest, self).setUpClass() + + def setUp(self): + super(FilebeatTest, self).setUp() + + # Hack to make jinja2 have the right paths + self.template_env = jinja2.Environment( + loader=jinja2.FileSystemLoader([ + os.path.abspath(os.path.join(self.beat_path, "../../filebeat")), + os.path.abspath(os.path.join(self.beat_path, "../../libbeat")) + ]) + )