Commit 8456c7c8 authored by Benjamin Blanc's avatar Benjamin Blanc

Update

parent 38441c3f
...@@ -369,9 +369,7 @@ branch = foo ...@@ -369,9 +369,7 @@ branch = foo
return [] return []
test_node = self.getTestNode() test_node = self.getTestNode()
test_node.slapos_controler = SlapOSControler( runner = UnitTestRunner(test_node)
self.working_directory,
test_node.config, self.log)
# Create and initialise/regenerate a nodetestsuite # Create and initialise/regenerate a nodetestsuite
node_test_suite = test_node.getNodeTestSuite('foo') node_test_suite = test_node.getNodeTestSuite('foo')
...@@ -380,7 +378,7 @@ branch = foo ...@@ -380,7 +378,7 @@ branch = foo
node_test_suite.revision = 'dummy' node_test_suite.revision = 'dummy'
# Path to the dummy runable # Path to the dummy runable
run_test_suite_path = _createPath( run_test_suite_path = _createPath(
os.path.join(test_node.slapos_controler.instance_root,'a/bin'),'runTestSuite') os.path.join(runner.slapos_controler.instance_root,'a/bin'),'runTestSuite')
def checkRunTestSuiteParameters(additional_parameter_list=None): def checkRunTestSuiteParameters(additional_parameter_list=None):
ProcessManager.getSupportedParameterSet = patch_getSupportedParameterSet ProcessManager.getSupportedParameterSet = patch_getSupportedParameterSet
...@@ -388,7 +386,7 @@ branch = foo ...@@ -388,7 +386,7 @@ branch = foo
runner = UnitTestRunner(test_node) runner = UnitTestRunner(test_node)
runner.runTestSuite(node_test_suite,"http://foo.bar") runner.runTestSuite(node_test_suite,"http://foo.bar")
expected_parameter_list = ['%s/a/bin/runTestSuite' expected_parameter_list = ['%s/a/bin/runTestSuite'
%(runner.testnode.slapos_controler.instance_root), '--test_suite', 'Foo', '--revision', %(runner.slapos_controler.instance_root), '--test_suite', 'Foo', '--revision',
'dummy', '--test_suite_title', 'Foo-Test', '--node_quantity', 3, '--master_url', 'dummy', '--test_suite_title', 'Foo-Test', '--node_quantity', 3, '--master_url',
'http://foo.bar'] 'http://foo.bar']
if additional_parameter_list: if additional_parameter_list:
...@@ -504,11 +502,8 @@ branch = foo ...@@ -504,11 +502,8 @@ branch = foo
TaskDistributor.startTestSuite = patch_startTestSuite TaskDistributor.startTestSuite = patch_startTestSuite
original_createTestResult = TaskDistributionTool.createTestResult original_createTestResult = TaskDistributionTool.createTestResult
TaskDistributionTool.createTestResult = patch_createTestResult TaskDistributionTool.createTestResult = patch_createTestResult
test_node = self.getTestNode() test_node = self.getTestNode()
test_node_slapos = SlapOSInstance()
runner = UnitTestRunner(test_node) runner = UnitTestRunner(test_node)
original_prepareSlapOS = runner._prepareSlapOS original_prepareSlapOS = runner._prepareSlapOS
runner._prepareSlapOS = doNothing runner._prepareSlapOS = doNothing
original_runTestSuite = runner.runTestSuite original_runTestSuite = runner.runTestSuite
...@@ -617,7 +612,7 @@ branch = foo ...@@ -617,7 +612,7 @@ branch = foo
original_runTestSuite = runner.runTestSuite original_runTestSuite = runner.runTestSuite
runner.runTestSuite = doNothing runner.runTestSuite = doNothing
SlapOSControler.initializeSlapOSControler = doNothing SlapOSControler.initializeSlapOSControler = doNothing
test_node.run() runner.testnode.run()
self.assertEquals(counter, 3) self.assertEquals(counter, 3)
checkTestSuite(test_node) checkTestSuite(test_node)
time.sleep = original_sleep time.sleep = original_sleep
......
...@@ -43,7 +43,10 @@ from Updater import Updater ...@@ -43,7 +43,10 @@ from Updater import Updater
from erp5.util import taskdistribution from erp5.util import taskdistribution
class SlapOSInstance(object): class SlapOSInstance(object):
"""
Base of an software instance,
store variables used during software installation
"""
def __init__(self): def __init__(self):
self.retry_software_count = 0 self.retry_software_count = 0
self.retry = False self.retry = False
...@@ -57,7 +60,9 @@ class SlapOSInstance(object): ...@@ -57,7 +60,9 @@ class SlapOSInstance(object):
class NodeTestSuite(SlapOSInstance): class NodeTestSuite(SlapOSInstance):
"""
"""
def __init__(self, reference): def __init__(self, reference):
super(NodeTestSuite, self).__init__() super(NodeTestSuite, self).__init__()
self.reference = reference self.reference = reference
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment