Commit 1f5dce5b authored by Julien Muchembled's avatar Julien Muchembled Committed by Klaus Wölfel

erp5.util.testnode: fix values of --firefox_bin and --xvfb_bin

Firefox and Xvfb aren not provided by the tested SR,
but rather by a separate SR that is installed by the testnode.
parent c8516019
...@@ -89,6 +89,7 @@ class ERP5TestNode(TestCase): ...@@ -89,6 +89,7 @@ class ERP5TestNode(TestCase):
config["httpd_ip"] = "ff:ff:ff:ff:ff:ff:ff:ff" config["httpd_ip"] = "ff:ff:ff:ff:ff:ff:ff:ff"
config["httpd_software_access_port"] = "9080" config["httpd_software_access_port"] = "9080"
config["frontend_url"] = "http://frontend/" config["frontend_url"] = "http://frontend/"
config["software_list"] = ["foo", "bar"]
return TestNode(self.log, config) return TestNode(self.log, config)
...@@ -515,12 +516,17 @@ shared = true ...@@ -515,12 +516,17 @@ shared = true
checkRunTestSuiteParameters() checkRunTestSuiteParameters()
parts = slapos_controler.instance_root + '/a/software_release/parts/' def part(path): # in "bar" SR
path = test_node.config['slapos_directory'] \
+ '/soft/37b51d194a7513e45b56f6524f2d51f2/parts/' + path
os.makedirs(os.path.dirname(path))
os.close(os.open(path, os.O_CREAT))
return path
for option in ( for option in (
('--firefox_bin', parts + 'firefox/firefox-slapos'), ('--firefox_bin', part('firefox/firefox-slapos')),
('--frontend_url', 'http://frontend/'), ('--frontend_url', 'http://frontend/'),
('--node_quantity', 3), ('--node_quantity', 3),
('--xvfb_bin', parts + 'xserver/bin/Xvfb'), ('--xvfb_bin', part('xserver/bin/Xvfb')),
): ):
parser.add_argument(option[0]) parser.add_argument(option[0])
expected_parameter_list += option expected_parameter_list += option
......
...@@ -43,6 +43,7 @@ from NodeTestSuite import SlapOSInstance ...@@ -43,6 +43,7 @@ from NodeTestSuite import SlapOSInstance
from Updater import Updater from Updater import Updater
from Utils import dealShebang from Utils import dealShebang
from erp5.util import taskdistribution from erp5.util import taskdistribution
from slapos.grid.utils import md5digest
class UnitTestRunner(): class UnitTestRunner():
def __init__(self, testnode): def __init__(self, testnode):
...@@ -147,16 +148,19 @@ class UnitTestRunner(): ...@@ -147,16 +148,19 @@ class UnitTestRunner():
'--test_suite_title', node_test_suite.test_suite_title) '--test_suite_title', node_test_suite.test_suite_title)
supported_parameter_set = set(self.testnode.process_manager supported_parameter_set = set(self.testnode.process_manager
.getSupportedParameterList(run_test_suite_path)) .getSupportedParameterList(run_test_suite_path))
parts = os.path.dirname(os.path.dirname(run_test_suite_path)) def part(path):
parts += '/software_release/parts/' path = config['slapos_directory'] + '/soft/%s/parts/' + path
for option in ( path, = filter(os.path.exists, (path % md5digest(software)
('--firefox_bin', parts + 'firefox/firefox-slapos'), for software in config['software_list']))
('--frontend_url', config['frontend_url']), return path
('--node_quantity', config['node_quantity']), for option, value in (
('--xvfb_bin', parts + 'xserver/bin/Xvfb'), ('--firefox_bin', lambda: part('firefox/firefox-slapos')),
('--frontend_url', lambda: config['frontend_url']),
('--node_quantity', lambda: config['node_quantity']),
('--xvfb_bin', lambda: part('xserver/bin/Xvfb')),
): ):
if option[0] in supported_parameter_set: if option in supported_parameter_set:
invocation_list += option invocation_list += option, value()
# TODO : include testnode correction ( b111682f14890bf ) # TODO : include testnode correction ( b111682f14890bf )
if hasattr(node_test_suite,'additional_bt5_repository_id'): if hasattr(node_test_suite,'additional_bt5_repository_id'):
......
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