Commit 3c4bbcdf authored by Julien Muchembled's avatar Julien Muchembled

monitor/test: clean up

parent 985f6159
Pipeline #7255 failed with stage
in 0 seconds
......@@ -29,6 +29,7 @@ import json
import os
import re
import requests
import subprocess
import xml.etree.ElementTree as ET
from slapos.recipe.librecipe import generateHashFromFiles
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
......@@ -225,17 +226,13 @@ class EdgeSlaveMixin(MonitorTestMixin):
def assertSurykatkaStatusJSON(self):
if os.path.exists(self.surykatka_json):
os.unlink(self.surykatka_json)
original_environ = os.environ.copy()
os.environ.pop('PYTHONPATH', None)
try:
self.assertEqual(0, os.system(self.surykatka_status_json))
finally:
os.environ = original_environ
env = os.environ.copy()
env.pop('PYTHONPATH', None)
subprocess.check_call(self.surykatka_status_json, shell=True, env=env)
self.assertTrue(os.path.exists(self.surykatka_json))
with open(self.surykatka_json) as fh:
status_json = json.load(fh)
self.assertTrue('bot_status' in status_json)
self.assertIn('bot_status', status_json)
def test(self):
# Note: Those tests do not run surykatka and do not do real checks, as
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment