From f5923aed88c2d163d76e16de82e9a9999609372f Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Wed, 7 May 2014 10:51:30 +0200 Subject: logicalfile: test providers' configuration --- src/python/lmi/test/cimbase.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/python') 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) -- cgit