turn off the SFA tests when this is not redone
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Sat, 12 Jun 2010 21:03:57 +0000 (23:03 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Sat, 12 Jun 2010 21:03:57 +0000 (23:03 +0200)
system/TestMain.py
system/TestPlc.py

index 4839b43..440f9ee 100755 (executable)
@@ -186,6 +186,8 @@ steps refer to a method in TestPlc or to a step_* module
             if self.options.verbose:
                 utils.header('* Using %s = %s'%(recname,getattr(self.options,recname)))
 
+        # hack : if sfa is not among the published rpms, skip these tests
+        TestPlc.check_whether_build_has_sfa(options.arch_rpms_url)
 
         # steps
         if not self.options.steps:
index eb5c9e3..6127da7 100644 (file)
@@ -120,6 +120,16 @@ class TestPlc:
     def valid_step (step):
         return step != SEP
 
+    # turn off the sfa-related steps when build has skipped SFA
+    # this is originally for centos5 as recent SFAs won't build on this platformb
+    @staticmethod
+    def check_build_has_sfa (rpms_url):
+        retcod=os.system ("curl --silent %s/ | grep -q sfa"%rpms_url)
+        # full builds are expected to return with 0 here
+        if retcod!=0:
+            TestPlc.default_steps = [ step for step in TestPlc.default_steps
+                                      if step.find('sfa') < 0 ]
+
     def __init__ (self,plc_spec,options):
        self.plc_spec=plc_spec
         self.options=options