X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2Fconfig_default.py;h=8fd549aac56e19d0e7290850b3aba506e9c7e96f;hb=47327e9d3a9ee1d09f0dd6689ec89f6e87a27b32;hp=ddf85783f536d5973391586bd96a1bfa95d3eb6a;hpb=d30485ea9499738882660885ffa2ac641c2f3321;p=tests.git diff --git a/system/config_default.py b/system/config_default.py index ddf8578..8fd549a 100644 --- a/system/config_default.py +++ b/system/config_default.py @@ -1,5 +1,6 @@ +# -*- python3 -*- # Thierry Parmentelat -# Copyright (C) 2010 INRIA +# Copyright (C) 2015 INRIA # # a configuration module is expected: # (*) to define a config method @@ -65,6 +66,9 @@ def nodes(options,index): 'route_fields' : { 'subnet' : '0.0.0.0/0', 'next_hop' : 'xxx-deferred-xxx', }, + # boot cd settings + # we should have tags here instead of the hard-wired + # options set for GetBootMedium in TestNode.py }] def all_nodenames (options,index): @@ -431,6 +435,9 @@ def tcp_specs (options,index): # with the addition of omf-friendly slices.. slice3='%s_sl4'%login_base(2) slice4='%s_sl5'%login_base(2) + +# NOTE: port 9999 is hard-wired in the code to be used for checking network readiness +# so it is not to be used here # bind on 0.0.0.0 and try to reach this on localhost # not expected to work same_node_same_slice_lo = { 'server_node': 'node1', 'server_slice': slice1, @@ -455,7 +462,7 @@ def tcp_specs (options,index): specs += [ same_node_same_slice ] # worth another try specs += [ same_node_2_slices ] - if options.size >1 : + if options.size > 1: specs += [ two_nodes_same_slice, two_nodes_2_slices ] return specs @@ -512,7 +519,7 @@ def plc (options,index) : 'initscripts': initscripts(options,index), 'slices' : slices(options,index), 'tcp_specs' : tcp_specs(options,index), - 'sfa' : sfa(options,index), + 'sfa' : sfa(options,index), 'leases' : leases (options, index), # big distros need more time to install nodes 'ssh_node_boot_timers': (40,38), @@ -605,9 +612,26 @@ def test_auth_sfa_spec (options,index,rspec_style): } -def config (plc_specs,options): - result=plc_specs +def config (plc_specs, options): + result = plc_specs # plc 'index' starts with 1 - for i in range (options.size): - result.append(plc(options,i+1)) + for i in range(options.size): + result.append(plc(options, i+1)) return result + +### for creating a sample config interactively +def sample_test_plc_spec (): + class Void: pass + + options = Void() + options.size = 1 + options.rspec_styles = ['pg'] + + return config([], options)[0] + +if __name__ == '__main__': + s = sample_test_plc_spec() + print('Sample plc_spec has the following keys') + for k in sorted(s.keys()): + print(k) +