Skip to content

Commit ee4f08d

Browse files
author
David Noble
committed
Resolved test case failure: test_index (test_examples.ExamplesTestCase)
1 parent 256a2f2 commit ee4f08d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tests/test_app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import logging
1919

2020
import splunklib.client as client
21-
import splunklib.data as data
21+
2222

2323
class TestApp(testlib.SDKTestCase):
2424
app = None
@@ -39,6 +39,9 @@ def setUp(self):
3939
logging.debug("Creating app %s", self.app_name)
4040
else:
4141
logging.debug("App %s already exists. Skipping creation.", self.app_name)
42+
if self.service.restart_required:
43+
self.service.restart(120)
44+
return
4245

4346
def tearDown(self):
4447
super(TestApp, self).tearDown()

tests/test_examples.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def check_commands(self, *args):
6060
for arg in args:
6161
result = run(arg)
6262
self.assertEquals(result, 0)
63+
self.service.login() # Because a Splunk restart invalidates our session
6364

6465
def setUp(self):
6566
super(ExamplesTestCase, self).setUp()
@@ -160,7 +161,7 @@ def test_index(self):
160161
"index.py disable sdk-tests",
161162
"index.py enable sdk-tests",
162163
"index.py clean sdk-tests")
163-
self.service.restart(120)
164+
return
164165

165166
def test_info(self):
166167
self.check_commands(

0 commit comments

Comments
 (0)