]> xenbits.xensource.com Git - xenrt-citrix/xenrt.git/commitdiff
Xen-test-framework: Introduce a sleep so to allow time to create
authorAnshul Makkar <anshul.makkar@citrix.com>
Fri, 6 Nov 2015 15:24:18 +0000 (15:24 +0000)
committerAnshul Makkar <anshul.makkar@citrix.com>
Fri, 6 Nov 2015 15:24:18 +0000 (15:24 +0000)
the log file.

exec/testcases/xenserver/tc/ring0/ring0xen.py

index db1e7fe7957244236ad15ea0be30fabc2a9cd3c7..7d4ef2008bed8594cf2cb2de542d3e30b2a2e2e9 100644 (file)
@@ -7,6 +7,12 @@ class XenTestRun(object):
         self.name = name
 
     def results(self):
+        logFile = "/var/log/xen/guest-%s.log" % self.name
+        try:
+            xenrt.checkFileExists(logFile)
+        except xenrt.XRTException, e:
+            raise xenrt.XRTError(e.reason)
+
         res = self.host.execdom0("grep -i 'Test Result:' /var/log/xen/guest-%s.log | tail -1 | awk -F: '{print $4}'" % self.name).strip()
 
         if res == "SUCCESS":
@@ -24,14 +30,14 @@ class TCRing0XenBase(xenrt.TestCase):
 
         #install the xen-test-framework which is a prerequisite for running tests.
         step("install xen-test-framework RPM and copy other pre-requisites")
-        modulePath = "/tmp/xen-test-framework.rpm"
-        moduleRpm = xenrt.TEC().getFile("/usr/groups/build/trunk-ring0/latest/binary-packages/RPMS/domain0/RPMS/x86_64/xen-test-framework-*.rpm")
 
+        moduleRpm = xenrt.TEC().getFile("/usr/groups/build/trunk-ring0/latest/binary-packages/RPMS/domain0/RPMS/x86_64/xen-test-framework-*.rpm")
         try:
             xenrt.checkFileExists(moduleRpm)
         except xenrt.XRTException, e:
             raise xenrt.XRTError(e.reason)
 
+        modulePath = "/tmp/xen-test-framework.rpm"
         sh = self.host.sftpClient()
         try:
             sh.copyTo(moduleRpm, modulePath)
@@ -39,6 +45,12 @@ class TCRing0XenBase(xenrt.TestCase):
             sh.close()
 
         self.host.execdom0("rpm --force -Uvh %s" % (modulePath))
+
+        consoleCfg = xenrt.TEC().getFile("/etc/sysconfig/xencommons")
+        try:
+            xenrt.checkFileExists(consoleCfg)
+        except xenrt.XRTException, e:
+            raise xenrt.XRTError(e.reason)
         self.host.execdom0("sed -i 's/#XENSTORED_TRACE.*/XENSTORED_TRACE=yes/' /etc/sysconfig/xencommons")
         self.host.execdom0("sed -i 's/#XENCONSOLED_TRACE.*/XENCONSOLED_TRACE=all/' /etc/sysconfig/xencommons")
         self.host.execdom0("/bin/systemctl restart xenconsoled.service")
@@ -48,21 +60,25 @@ class TCRing0XenPV32Test(TCRing0XenBase):
         step("32bit PV test")
         xenPV32Test = XenTestRun(self.host, "test-pv32-example");
         xenPV32Test.run()
+        time.sleep(10)
 
 class TCRing0XenPV64Test(TCRing0XenBase):
     def run(self, arglist):
         step("64bit PV Test")
         xenPV64Test = XenTestRun(self.host, "test-pv64-example");
         xenPV64Test.run()
+        time.sleep(10)
 
 class TCRing0XenHVM32Test(TCRing0XenBase):
     def run(self, arglist):
         step("32bit HVM test")
         xenHvm32Test = XenTestRun(self.host, "test-hvm32-example");
         xenHvm32Test.run()
+        time.sleep(10)
 
 class TCRing0XenHVM64Test(TCRing0XenBase):
     def run(self, arglist):
         step("64bit HVM test")
         xenHvm64Test = XenTestRun(self.host, "test-hvm64-example");
         xenHvm64Test.run()
+        time.sleep(10)