From c60ee8339624903382f0fa98e9afc552bbedc90d Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 13 Apr 2015 09:13:44 +0200 Subject: [PATCH] miscell cosmetic + pass the substrate object to TestBonding so it can compute an available IP for a bonding node --- system/Substrate.py | 4 ++-- system/TestBonding.py | 9 +++++---- system/TestMain.py | 7 ++++--- system/TestPlc.py | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/system/Substrate.py b/system/Substrate.py index ff18ccd..098ff51 100644 --- a/system/Substrate.py +++ b/system/Substrate.py @@ -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 "".format() + return "".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 diff --git a/system/TestBonding.py b/system/TestBonding.py index 64fb5ad..d94e4e9 100644 --- a/system/TestBonding.py +++ b/system/TestBonding.py @@ -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) diff --git a/system/TestMain.py b/system/TestMain.py index 2a6a6fe..1d88af4 100755 --- a/system/TestMain.py +++ b/system/TestMain.py @@ -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' diff --git a/system/TestPlc.py b/system/TestPlc.py index 9853084..72d2060 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -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, -- 2.43.0