Commit 1067853c authored by Jérome Perrin's avatar Jérome Perrin

monitor/test: use slapos.testing

parent f2e6a60f
...@@ -25,12 +25,11 @@ ...@@ -25,12 +25,11 @@
# #
############################################################################## ##############################################################################
from setuptools import setup, find_packages from setuptools import setup, find_packages
import glob
import os
version = '0.0.1.dev0' version = '0.0.1.dev0'
name = 'slapos.test.monitor' name = 'slapos.test.monitor'
long_description = open("README.md").read() with open("README.md") as f:
long_description = f.read()
setup(name=name, setup(name=name,
version=version, version=version,
......
...@@ -26,33 +26,17 @@ ...@@ -26,33 +26,17 @@
############################################################################## ##############################################################################
import os import os
import shutil
import urlparse
import tempfile
import requests
import socket
import StringIO
import subprocess
import json
import utils
from slapos.recipe.librecipe import generateHashFromFiles from slapos.recipe.librecipe import generateHashFromFiles
# for development: debugging logs and install Ctrl+C handler from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
if os.environ.get('SLAPOS_TEST_DEBUG'):
import logging
logging.basicConfig(level=logging.DEBUG)
import unittest
unittest.installHandler()
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
class InstanceTestCase(utils.SlapOSInstanceTestCase):
@classmethod
def getSoftwareURLList(cls):
return (os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'software.cfg')), )
class ServicesTestCase(SlapOSInstanceTestCase):
class ServicesTestCase(InstanceTestCase):
def test_hashes(self): def test_hashes(self):
hash_files = [ hash_files = [
...@@ -63,7 +47,7 @@ class ServicesTestCase(InstanceTestCase): ...@@ -63,7 +47,7 @@ class ServicesTestCase(InstanceTestCase):
'crond-{hash}-on-watch', 'crond-{hash}-on-watch',
] ]
supervisor = self.getSupervisorRPCServer().supervisor with self.slap.instance_supervisor_rpc as supervisor:
process_names = [process['name'] process_names = [process['name']
for process in supervisor.getAllProcessInfo()] for process in supervisor.getAllProcessInfo()]
......
This diff is collapsed.
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