X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2Fconfig_default.py;h=82331d31c21fff6e8c24714e62105b733bf7f9e5;hb=aec43105089dc65f0f0b32a19aabbd5e1cc58207;hp=6ff71f0450d34e8bb5ec4dc6b06eabf1d768ef82;hpb=ebb13397ac064e2d85861908fa68523d2c1aa942;p=tests.git diff --git a/system/config_default.py b/system/config_default.py index 6ff71f0..82331d3 100644 --- a/system/config_default.py +++ b/system/config_default.py @@ -1,6 +1,6 @@ # -*- python3 -*- # Thierry Parmentelat -# Copyright (C) 2015 INRIA +# Copyright (C) 2015 INRIA # # a configuration module is expected: # (*) to define a config method @@ -11,25 +11,24 @@ # values like 'hostname', 'ip' and the like are rewritten later with a TestPool object -# so that sfa users get different mails whether they are based on pl or pg pldomain = "onelab.eu" -pgdomain = "emulab.eu" ### for the sfa dual setup -def login_base (index): +def login_base (index): if index == 1: return 'inri' elif index == 2: return 'princ' - # index=3=>'sitea' 4=>'siteb' + # index=3=>'sitea' 4=>'siteb' else: return 'site{}'.format(chr(index+94)) -def sfa_login_base (index, rspec_style): - return "sfa{}".format(rspec_style) +# only one rspec style +def sfa_login_base (index): + return "sfa" def sfa_root (index): # use plt (planetlab test) instead of pl # otherwise a triangular test ends up with 'plc' # plta, pltb, ... - return 'plt{}'.format(chr(index+96)) + return '{}'.format(chr(index+96)) def nodes(options, index): return [{'name' : 'node{}'.format(index), @@ -66,11 +65,9 @@ def nodes(options, index): 'route_fields' : { 'subnet' : '0.0.0.0/0', 'next_hop' : 'xxx-deferred-xxx', }, - 'bootmedium_options' : [ 'serial', 'no-hangcheck', 'systemd-debug' ], - # provision for bonding + 'bootmedium_options' : [ 'serial', 'no-hangcheck', 'systemd-console' ], 'tags' : { - # not needed anymore - # 'plain-bootstrapfs' : 'YES' + # no tags anymore }, # boot cd settings # we should have tags here instead of the hard-wired @@ -81,7 +78,7 @@ def all_nodenames (options, index): return [ node['name'] for node in nodes(options, index)] def users (options) : - return [ + return [ {'name' : 'admin', 'key_names' : [ 'key_admin' ], 'user_fields' : {'first_name' : 'Admin', 'last_name' : 'Admin', @@ -106,14 +103,14 @@ def users (options) : 'roles':['pi','tech']}, {'name' : 'tech', 'key_names' : [ 'key_user' ], - 'user_fields' : {'first_name' : 'Tech', 'last_name' : 'Tech', + 'user_fields' : {'first_name' : 'André', 'last_name' : 'Tech', 'enabled' : 'true', 'email' : 'fake-tech1@{}'.format(pldomain), 'password' : 'testtech'}, 'roles':['tech']}, {'name' : 'user', 'key_names' : [ 'key_user' ], - 'user_fields' : {'first_name' : 'User', 'last_name' : 'User', + 'user_fields' : {'first_name' : 'Eylül', 'last_name' : 'User', 'enabled' : 'true', 'email' : 'fake-user1@{}'.format(pldomain), 'password' : 'testuser'}, @@ -285,7 +282,7 @@ QfzAAZLU2BabjwIfmWetj55ZKiFXRQLkYkz1GPXr2m3FopZb+6apq9M7tTERq1J9 ORxipg3+uy/eYngUAmNmzOnK/9zklEPjNm9Nw3xHnZO+SyQLNI421KkdHOja/GGd awKBgQCLtk0+RpswH451PWyAJ6F+U4YDVaHR0s6pwp4TJAkDVlFBiRO28jEb5y0N bI1R7vrRdq07SgI3USLXqDokQ/pXJhC03w2r7W7niAkNaUll3YtJ2DZVSvuQguR9 -xwRNsuo0x60e7bivU+kNZtLn5FqWuGoBONZnbhgP6y7jPsNrig == +xwRNsuo0x60e7bivU+kNZtLn5FqWuGoBONZnbhgP6y7jPsNrig == -----END RSA PRIVATE KEY----- """ @@ -371,7 +368,7 @@ function restart () { stop start } -case $command in +case $command in start) start ;; stop) stop ;; restart) restart ;; @@ -382,7 +379,7 @@ esac initscript_by_code = initscript_by_name.replace("initscript_by_name","initscript_by_code") # one single initscript in the InitScripts table -def initscripts(options, index): +def initscripts(options, index): return [ { 'initscript_fields' : { 'enabled' : True, 'name' : 'initscript_by_name', 'script' : initscript_by_name, @@ -392,7 +389,7 @@ def initscripts(options, index): # returns 3 slices # 1 has an initscript code # 2 has an initscript name -# 3 is an omf-friendly slice +# 3 used to be an omf-friendly slice but this is now deprecated def slices (options, index): def theslice (i): slice_spec = { 'slice_fields': {'name' : '{}_sl{}'.format(login_base(index),i), @@ -414,10 +411,11 @@ def slices (options, index): elif i%3 == 2: slice_spec['initscriptname'] = 'initscript_by_name' slice_spec['initscriptstamp'] = 'initscript_by_name' - # 3rd one is omf-friendly + # 3rd one - not omf-friendly any longer else: - # potentially turned off with config_no_omf - slice_spec ['omf-friendly'] = True + # omf-friendly slices is a deprecated feature + # slice_spec ['omf-friendly'] = True + pass return slice_spec # usual index is 1, additional plc's then get 2... # so index=1 -> 1 - 2 - 3 @@ -435,7 +433,7 @@ def all_slicenames (options, index): def tcp_specs (options, index): # only run the test on the first plc if index != 1: return None - # + # slice1 = '{}_sl1'.format(login_base(1)) slice2 = '{}_sl2'.format(login_base(1)) # with the addition of omf-friendly slices.. @@ -487,7 +485,7 @@ def leases (options, index): return leases def plc (options, index) : - return { + return { 'index' : index, 'name' : 'plctest{}'.format(index), # as of yet, not sure we can handle foreign hosts, but this is required though @@ -503,9 +501,12 @@ def plc (options, index) : 'PLC_ROOT_PASSWORD' : 'test++', 'PLC_SLICE_PREFIX' : 'auto', 'PLC_HRN_ROOT': sfa_root(index), - 'PLC_SHORTNAME' : 'Rlab', + 'PLC_SHORTNAME' : 'Tlab', 'PLC_MAIL_ENABLED' : 'false', 'PLC_MAIL_SUPPORT_ADDRESS' : 'thierry.parmentelat@inria.fr', + # in the real word, use root@host.domain + # like e.g. root@r2labapi.inria.fr + 'PLC_MAIL_FROM_ADDRESS' : 'thierry.parmentelat@inria.fr', 'PLC_DB_HOST' : 'deferred-myplc-hostname', # 'PLC_DB_PASSWORD' : 'mnbvcxzlkjhgfdsapoiuytrewq', 'PLC_API_HOST' : 'deferred-myplc-hostname', @@ -515,8 +516,10 @@ def plc (options, index) : 'PLC_NET_DNS2' : 'deferred-dns-2', 'PLC_RESERVATION_GRANULARITY':1800, 'PLC_VSYS_DEFAULTS' : ' , vif_up, vif_down, fd_tuntap, promisc, ', - 'PLC_OMF_ENABLED' : 'true', - 'PLC_OMF_XMPP_SERVER' : 'deferred-myplc-hostname', +# omf-friendly slices is a deprecated feature +# 'PLC_OMF_ENABLED' : 'true', +# 'PLC_OMF_XMPP_SERVER' : 'deferred-myplc-hostname', + 'PLC_OMF_ENABLED' : 'false', }, 'expected_vsys_tags': [ 'vif_up', 'vif_down', 'fd_tuntap', 'promisc', ], # minimal config so the omf plugins actually trigger @@ -533,7 +536,7 @@ def plc (options, index) : } def sfa (options, index) : - return { + return { # the port used to generate the various aggregates.xml # stack config_sfamesh to point to SMs instead 'neighbours-port':12346, @@ -546,9 +549,6 @@ def sfa (options, index) : 'SFA_INTERFACE_HRN' : sfa_root(index), 'SFA_REGISTRY_HOST' : 'deferred-myplc-hostname', 'SFA_AGGREGATE_HOST' : 'deferred-myplc-hostname', - 'SFA_SM_HOST' : 'deferred-myplc-hostname', -# turning off SM and using only AM; be explicit on this as the default has changed in the code - 'SFA_SM_ENABLED' : 'false', 'SFA_PLC_URL' : 'deferred-myplc-api-url', 'SFA_PLC_USER' : 'root@test.onelab.eu', 'SFA_PLC_PASSWORD' : 'test++', @@ -559,15 +559,14 @@ def sfa (options, index) : 'SFA_AGGREGATE_ENABLED' : 'true', }, # details of the slices to create - 'auth_sfa_specs' : [ test_auth_sfa_spec(options, index,rspec_style) - for rspec_style in options.rspec_styles ] + 'auth_sfa_specs' : [ test_auth_sfa_spec(options, index) ] } -# rspec_style is 'pl' for sfav1 or 'pg' for pgv2 -def test_auth_sfa_spec (options, index, rspec_style): - domain = pldomain if rspec_style == 'pl' else pgdomain +# rspec_style used to be 'pl' for sfav1 or 'pg' for pgv2 - OBSOLETE +def test_auth_sfa_spec (options, index): + domain = pldomain # the auth/site part per se - login_base = sfa_login_base(index,rspec_style) + login_base = sfa_login_base(index) hrn_prefix = '{}.{}'.format(sfa_root(index),login_base) def full_hrn(x): return "{}.{}".format(hrn_prefix,x) def full_mail(x): return "{}@test.{}".format(x,domain) @@ -577,7 +576,7 @@ def test_auth_sfa_spec (options, index, rspec_style): user_alias = 'regular-user' # pi_alias = 'pi' # user_alias = 'user' - # + # pi_spec = { 'name': pi_alias, 'email': full_mail (pi_alias), @@ -588,7 +587,7 @@ def test_auth_sfa_spec (options, index, rspec_style): 'email': full_mail (user_alias), 'key_name': 'key_sfauser', 'register_options': [ '--extra',"first_name=Fake", - '--extra',"last_name=SFA-style-{}".format(rspec_style), + '--extra',"last_name=SFA", ], 'update_options': [ '--extra',"enabled=true", ], @@ -597,30 +596,28 @@ def test_auth_sfa_spec (options, index, rspec_style): slice_spec = { 'name': 'sl', 'register_options': [ '--researchers', full_hrn (user_alias), - # xxx - '--extra', "description=SFA-testing-{}".format(rspec_style), - '--extra', "url=http://slice{}.test.onelab.eu/".format(index), - '--extra', "max_nodes=2", + '--extra', "description=SFA-testing", + '--extra', "url=http://slice{}.test.onelab.eu/".format(index), + '--extra', "max_nodes=2", ], 'key_name': 'key_sfauser', 'nodenames': all_nodenames(options, index), } - + # we're already in a dedicated site/authority so no need to encumber with odd names - return { #'hrn_prefix': hrn_prefix, + return { 'login_base' : login_base, - 'domain':domain, - 'rspec_style':rspec_style, - 'pi_spec': pi_spec, - 'user_spec': user_spec, - 'slice_spec': slice_spec, - } + 'domain' : domain, + 'pi_spec' : pi_spec, + 'user_spec' : user_spec, + 'slice_spec' : slice_spec, + } def config (plc_specs, options): result = plc_specs - # plc 'index' starts with 1 + # plc 'index' starts with 1 for i in range(options.size): result.append(plc(options, i+1)) return result @@ -631,7 +628,6 @@ def sample_test_plc_spec (): options = Void() options.size = 1 - options.rspec_styles = ['pg'] return config([], options)[0]