summaryrefslogtreecommitdiffstats
path: root/src/service-dbus
diff options
context:
space:
mode:
authorRobin Hack <rhack@redhat.com>2013-10-08 07:44:36 +0200
committerRobin Hack <rhack@redhat.com>2013-10-09 09:27:01 +0200
commitecba053526671962b990bd312b1acb8bc17a7b4e (patch)
tree251a4d7d933a18e20d85bb1b52a65f4620481413 /src/service-dbus
parent657e5bfee810e4a51b33ffd401aa307862491423 (diff)
downloadopenlmi-providers-ecba053526671962b990bd312b1acb8bc17a7b4e.tar.gz
openlmi-providers-ecba053526671962b990bd312b1acb8bc17a7b4e.tar.xz
openlmi-providers-ecba053526671962b990bd312b1acb8bc17a7b4e.zip
Service: Add new test case to QA upstream test.
Diffstat (limited to 'src/service-dbus')
-rw-r--r--src/service-dbus/test/testService.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/service-dbus/test/testService.py b/src/service-dbus/test/testService.py
index e012441..0d1b807 100644
--- a/src/service-dbus/test/testService.py
+++ b/src/service-dbus/test/testService.py
@@ -28,6 +28,7 @@ import shutil
HOST = "localhost"
USER = os.environ.get("LMI_CIMOM_USERNAME", "root")
PASSWD = os.environ.get("LMI_CIMOM_PASSWORD", "blank")
+BROKER = os.environ.get("LMI_CIMOM_BROKER", "tog-pegasus")
DEV_NULL = open("/dev/null", 'w')
@@ -49,7 +50,7 @@ class TestConnection(unittest.TestCase):
Cases:
LMIConnection is properly returned
"""
- conn = lmishell.connect(HOST, verify_server_cert=False)
+ conn = lmishell.connect(HOST)
self.assertTrue(isinstance(conn, lmishell.LMIConnection), "Couldn't connect to remote provider")
def test_connection_http(self):
@@ -60,7 +61,7 @@ class TestConnection(unittest.TestCase):
Cases:
LMIConnection is properly returned
"""
- conn = lmishell.connect(HOST, USER, PASSWD, verify_server_cert=False)
+ conn = lmishell.connect(HOST, USER, PASSWD)
self.assertTrue(isinstance(conn, lmishell.LMIConnection), "Couldn't connect to remote provider")
@@ -71,7 +72,7 @@ class TestServiceProvider(unittest.TestCase):
def setUp(self):
"""Set up and check connection to remote server."""
- self.conn = lmishell.connect(HOST, USER, PASSWD, verify_server_cert=False)
+ self.conn = lmishell.connect(HOST, USER, PASSWD)
self.assertTrue(isinstance(self.conn, lmishell.LMIConnection), "Couldn't connect to remote provider")
@@ -252,6 +253,22 @@ class TestServiceProvider(unittest.TestCase):
service = self.conn.root.cimv2.LMI_Service.first_instance({"Name": service_evil_name + ".service"})
self.assertEqual(service, None, "Non None object returned of non-existing service")
+ def test_restart_service_broker(self):
+ """
+ Test if is possible to restart broker over OpenLMI
+ """
+ service = self.conn.root.cimv2.LMI_Service.first_instance({"Name": BROKER + ".service"})
+ service.RestartService()
+
+ self.assertTrue (service.Started)
+
+ # some silent connection restart will be good
+
+ # now try to cumunicate with broker
+ servicecups = self.conn.root.cimv2.LMI_Service.first_instance({"Name": "cups.service"})
+ self.assertNotEqual(servicecups, None)
+ servicecups.RestartService()
+ self.assertTrue (servicecups.Started)
def test_service_with_null_name(self):
"""