Commit 4fd5acb9 authored by Julien Muchembled's avatar Julien Muchembled

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 1c73fb3e
......@@ -89,6 +89,7 @@ class ERP5TestNode(TestCase):
config["httpd_ip"] = "ff:ff:ff:ff:ff:ff:ff:ff"
config["httpd_software_access_port"] = "9080"
config["frontend_url"] = "http://frontend/"
config["software_list"] = ["foo", "bar"]
return TestNode(self.log, config)
......@@ -515,12 +516,17 @@ shared = true
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 (
('--firefox_bin', parts + 'firefox/firefox-slapos'),
('--firefox_bin', part('firefox/firefox-slapos')),
('--frontend_url', 'http://frontend/'),
('--node_quantity', 3),
('--xvfb_bin', parts + 'xserver/bin/Xvfb'),
('--xvfb_bin', part('xserver/bin/Xvfb')),
):
parser.add_argument(option[0])
expected_parameter_list += option
......
......@@ -43,6 +43,7 @@ from NodeTestSuite import SlapOSInstance
from Updater import Updater
from Utils import dealShebang
from erp5.util import taskdistribution
from slapos.grid.utils import md5digest
class UnitTestRunner():
def __init__(self, testnode):
......@@ -147,16 +148,19 @@ class UnitTestRunner():
'--test_suite_title', node_test_suite.test_suite_title)
supported_parameter_set = set(self.testnode.process_manager
.getSupportedParameterList(run_test_suite_path))
parts = os.path.dirname(os.path.dirname(run_test_suite_path))
parts += '/software_release/parts/'
for option in (
('--firefox_bin', parts + 'firefox/firefox-slapos'),
('--frontend_url', config['frontend_url']),
('--node_quantity', config['node_quantity']),
('--xvfb_bin', parts + 'xserver/bin/Xvfb'),
def part(path):
path = config['slapos_directory'] + '/soft/%s/parts/' + path
path, = filter(os.path.exists, (path % md5digest(software)
for software in config['software_list']))
return path
for option, value in (
('--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:
invocation_list += option
if option in supported_parameter_set:
invocation_list += option, value()
# TODO : include testnode correction ( b111682f14890bf )
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