commit 1bd7da4a1455697291cee12f4d0bfb89fbad81ef
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Wed Dec 19 13:50:14 2012 +0100
Add attribute to explicitly disable cleanup on slave
This patch adds "skip_cleanup" attribute to the machineconfig's info tag.
If set to "1" or "true" the slave machine's preparation cleanup phase is
skipped and overrides the cleanup (-c) controller option.
Without this attribute it's impossible to run the controller and slave
instances on the same machine with virtual guests or 8021q/bonding/team
driver involved because the cleanup phase removes these network modules
before test execution and breaks the controller's network configuration.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
lnst/Controller/NetTestController.py | 4 +++-
lnst/Controller/NetTestParse.py | 6 ++++++
2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index d673822..042d197 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -254,8 +254,10 @@ class NetTestController:
self._rpc_call(machine_id, "clear_resource_table")
required = self._resource_table
- if self._docleanup:
+ if self._docleanup and not info["skip_cleanup"]:
self._rpc_call(machine_id, 'machine_cleanup')
+ else:
+ logging.info("Skipping cleanup on machine %s" % machine_id)
for res_type, resources in self._resource_table.iteritems():
for res_name, res in resources.iteritems():
diff --git a/lnst/Controller/NetTestParse.py b/lnst/Controller/NetTestParse.py
index 3a24faf..28fe9ed 100644
--- a/lnst/Controller/NetTestParse.py
+++ b/lnst/Controller/NetTestParse.py
@@ -288,6 +288,12 @@ class MachineConfigParse(RecipeParser):
if self._has_attribute(node, "rpcport"):
info["rpcport"] = self._get_attribute(node, "rpcport", int)
+ if self._has_attribute(node, "skip_cleanup"):
+ info["skip_cleanup"] = self._get_attribute(node,
+ "skip_cleanup", bool_it)
+ else:
+ info["skip_cleanup"] = False
+
info["system_config"] = {}
try: