diff options
Diffstat (limited to 'src/python/lmi/test/cimbase.py')
-rw-r--r-- | src/python/lmi/test/cimbase.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/python/lmi/test/cimbase.py b/src/python/lmi/test/cimbase.py index f5155a3..4582d8e 100644 --- a/src/python/lmi/test/cimbase.py +++ b/src/python/lmi/test/cimbase.py @@ -27,6 +27,7 @@ import BaseHTTPServer import pywbem import Queue import random +import subprocess import threading import time @@ -360,3 +361,21 @@ class CIMTestCase(base.BaseLmiTestCase): jobname = outparams['Job'] (ret, outparams) = self.finish_job(jobname, return_constructor) return (ret, outparams) + + def restart_cim(self): + """ + Restart CIMOM + """ + ret = self.log_run(["systemctl", "restart", self.cimom]) + time.sleep(1) + if ret == 0: + CIMTestCase._WBEMCONNECTION = None + return ret + + def log_run(self, args): + """ + Print arguments and run them. + args must be prepared for subprocess.call() + """ + print "Running:", " ".join(args) + return subprocess.call(args) |