miscell cosmetic + pass the substrate object to TestBonding so it can compute an...
Thierry Parmentelat [Mon, 13 Apr 2015 07:13:44 +0000 (09:13 +0200)]
system/Substrate.py
system/TestBonding.py
system/TestMain.py
system/TestPlc.py

index ff18ccd..098ff51 100644 (file)
@@ -1037,12 +1037,12 @@ class Substrate:
         self.default_boxes = self.plc_boxes + self.qemu_boxes
         self.all_boxes = self.build_boxes + [ self.test_box ] + self.plc_boxes + self.qemu_boxes
     def __repr__(self):
-        return "<Substrate>".format()
+        return "<Substrate {}>".format(self.summary_line())
 
     def summary_line (self):
         msg  = "["
         msg += " {} xp".format(len(self.plc_lxc_boxes))
-        msg += " {} tried plc boxes".format(len(self.plc_boxes))
+        msg += " {} xq".format(len(self.qemu_boxes))
         msg += "]"
         return msg
 
index 64fb5ad..d94e4e9 100644 (file)
@@ -27,6 +27,7 @@ def onelab_bonding_spec (buildname):
     # essentially generic ..
     buildname      = buildname
     
+    # visit the other build's test directory to figure its characteristics
     with open ("../{}/arg-fcdistro".format(buildname)) as input:
         fcdistro   = input.read().strip()
     with open ("../{}/arg-pldistro".format(buildname)) as input:
@@ -62,18 +63,18 @@ class TestBonding(object):
     options is a TestMain options
     """
     
-    def __init__(self, test_plc, bonding_spec, options):
+    def __init__(self, test_plc, bonding_spec, substrate, options):
         """
         test_plc is one local TestPlc instance
         bonding_spec is a dictionary that gives details on
         the build we want to be bonding with
         """
+        # the local build & plc is described in options
+        # the bonding build is described in bonding_spec
         self.test_plc = test_plc
         self.bonding_spec = bonding_spec
+        self.substrate = substrate
         self.options = options
-        # the local build & plc is described in options
-        # the bonding build is described in bonding_spec
-
     def nodefamily(self):
         return "{pldistro}-{fcdistro}-{arch}".format(**self.bonding_spec)
         
index 2a6a6fe..1d88af4 100755 (executable)
@@ -116,8 +116,8 @@ class TestMain:
             self.steps_message += 20*'x' + " Macro steps are\n" + \
                                   " ".join(Step.list_macros())
         else:
-            self.steps_message += 20*'x' + " Default steps with bonding are\n" + \
-                                  TestPlc.printable_steps(TestPlc.bonding_steps)
+            self.steps_message += 20*'x' + " Default steps with bonding build are\n" + \
+                                  TestPlc.printable_steps(TestPlc.default_bonding_steps)
 
     def list_steps(self):
         if not self.options.verbose:
@@ -294,7 +294,7 @@ run with -l to see a list of available steps
         if not self.options.steps:
             # defaults, depends on using bonding or not
             if self.options.bonding:
-                self.options.steps = TestPlc.bonding_steps
+                self.options.steps = TestPlc.default_bonding_steps
             else:
                 self.options.steps = TestPlc.default_steps
 
@@ -387,6 +387,7 @@ run with -l to see a list of available steps
             for spec, test_plc in all_plcs:
                 test_plc.test_bonding = TestBonding (test_plc,
                                                      onelab_bonding_spec(self.options.bonding),
+                                                     LocalSubstrate.local_substrate,
                                                      self.options)
         
         overall_result = 'SUCCESS'
index 9853084..72d2060 100644 (file)
@@ -206,7 +206,7 @@ class TestPlc:
         'debug_nodemanager', 'slice_fs_present', SEP,
         'standby_1_through_20','yes','no',SEP,
         ]
-    bonding_steps = [
+    default_bonding_steps = [
         'bonding_init_partial',
         'bonding_add_yum',
         'bonding_install_rpms', SEP,