Skip to content

Commit

Permalink
Create Kibana space before trying to use it
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Oct 1, 2018
1 parent a4d4d84 commit 30ed549
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion libbeat/tests/system/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import subprocess
from nose.plugins.attrib import attr
import unittest

import requests

INTEGRATION_TESTS = os.environ.get('INTEGRATION_TESTS', False)

Expand Down Expand Up @@ -43,6 +43,8 @@ def test_load_dashboard_into_space(self):
Test loading dashboards into Kibana space
"""
self.render_config_template()
self.create_kibana_space()

beat = self.start_beat(
logging_args=["-e", "-d", "*"],
extra_args=["setup",
Expand Down Expand Up @@ -148,3 +150,13 @@ def get_kibana_host(self):

def get_kibana_port(self):
return os.getenv('KIBANA_PORT', '5601')

def create_kibana_space(self):
url = "http://" + self.get_kibana_host() + ":" + self.get_kibana_port() + \
"/api/spaces/space"
data = {
"id": "foo-bar",
"name": "Foo bar space"
}
r = requests.post(url, data)
assert r.status_code == 200

0 comments on commit 30ed549

Please sign in to comment.