user creation is done with new sfi options instead of xml-based
[tests.git] / system / config_default.py
index 0a3c9be..8507d17 100644 (file)
@@ -19,6 +19,9 @@ def login_base (index):
     # index=3=>'sitea'  4=>'siteb' 
     else: return 'site%s'%chr(index+94)
 
+def sfa_login_base (index, rspec_style):
+    return "sfa%s"%(rspec_style)
+
 def sfa_root (index):
     # use plt (planetlab test) instead of pl
     # otherwise a triangular test ends up with 'plc'
@@ -42,22 +45,21 @@ def nodes(options,index):
                                           'dns1': 'xxx-deferred-xxx',
                                           'dns2': 'xxx-deferred-xxx',
                                           },
-             # how to deal with the new plcapi way of modeling interfaces
-             # last_updated - ip_address_ids - is_primary - hostname 
-             # method 'static' or 'dhcp' - mac - interface_tag_ids
-             # if_name - ifname (accessor) - bwlimit
-             # xxx remains to deal with dns1 dns2 and gateway
-             # this gets appended to node_fields with the new interface
+             ######## how to deal with the new plcapi way of modeling interfaces
+             # this pertains to the node as per the new interface - using UpdateNode
+             # after node_fields above is used to create the Node
              'node_fields_nint' :       { 'dns':'xxx-deferred-xxx',
                                           },
+             # used in replacement of interface_fields above
              'interface_fields_nint' :  { 'is_primary' : True,
                                           'method' : 'static',
                                           },
-             # last_updated - netmask - ip_addr - type (e.g., 'ipv4')
+             # used to create an IpAddress
              'ipaddress_fields' :       { 'type' : 'ipv4',
                                           'ip_addr' : 'xxx-deferred-xxx',
                                           'netmask' : 'xxx-deferred-xxx',
                                           } ,
+             # used to create a Route
              'route_fields' :           { 'subnet' : '0.0.0.0/0',
                                           'next_hop' : 'xxx-deferred-xxx',
                                           },
@@ -197,6 +199,40 @@ rUck4dxa0t30wUFK0XVQjNEArXqvU23EB8Z7bQQMRx0yhd4pF5k29Q==
 -----END RSA PRIVATE KEY-----
 """
 
+### for a PI
+public_key3="""ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA9LrXvUvGZK092R+0+xNZAOUrywDmfdtOL2XqtO26PCjns2GmxLmphJkvBBtXCt4d8s9jdPILHKnTC0/8/WfrwhZ68AWHay1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iHheZ1fXeL7SUQHaSLwJhCgB9Q
+gTGy6xbGvDLz557ninkh6I4EOaZBZBI3DIFxG/ZZcmEdMIrf4kpFF4yXW/ujjdHk
+uqUX09FBRBPodvZRuHNLXg6g/0uWd7sIuUx/GMQjo37v6W54TuXpAoGBAPi5si4j
+BgBLwkyhdpbHC3GBlqqUUyNfqnZO78yMEDCBY5ANxMZixdEjUpR+Sy6oqYwwo7ub
+2U5cIWCaZ8+3QIFOo6TZ8kyfeEpxbVqbEcezuF8s+nTl4tndmq8U5cOA/bA+zNAR
+UgQcTehuf3KizMERe2IL3F/Ex7689XwgViFpAoGAelhtJGPEefBfixumPaBCtTbb
+cgQS7qg5uRR+xQlzL0JXim/D8i7txhEozv8hupsK9C1TPo24SXbeq2EjUMCs8ueJ
+uzbwUxWAstOp3Q2obTeAd3y3phw9kdV/Oj7F9+yAJu1BGI4Xwvi4qAUOSUkVlVwC
+OxkpSVMjhsxMz0G/7AMCgYAcbP5rrDszO9uw/IKU44xHfIY/YWiWVBN7PDipqZtz
+QfzAAZLU2BabjwIfmWetj55ZKiFXRQLkYkz1GPXr2m3FopZb+6apq9M7tTERq1J9
+ORxipg3+uy/eYngUAmNmzOnK/9zklEPjNm9Nw3xHnZO+SyQLNI421KkdHOja/GGd
+awKBgQCLtk0+RpswH451PWyAJ6F+U4YDVaHR0s6pwp4TJAkDVlFBiRO28jEb5y0N
+bI1R7vrRdq07SgI3USLXqDokQ/pXJhC03w2r7W7niAkNaUll3YtJ2DZVSvuQguR9
+xwRNsuo0x60e7bivU+kNZtLn5FqWuGoBONZnbhgP6y7jPsNrig==
+-----END RSA PRIVATE KEY-----
+"""
+
 def keys (options,index):
     return [ {'name': 'key1',
               'private' : private_key,
@@ -206,7 +242,6 @@ def keys (options,index):
               'private' : private_key2,
               'key_fields' : {'key_type':'ssh',
                               'key': public_key2}}
-            
              ]
 
 ############################## initscripts
@@ -253,7 +288,7 @@ def initscripts(options,index):
 # one has an initscript code, the other one an initscript name
 def slices (options,index):
     def theslice (i):
-        slice_spec = { 'slice_fields': {'name':'%s_slpl%d'%(login_base(index),i),
+        slice_spec = { 'slice_fields': {'name':'%s_sl%d'%(login_base(index),i),
                                         'instantiation':'plc-instantiated',
                                         'url':'http://foo%d.com'%index,
                                         'description':'testslice number %d'%i,
@@ -283,18 +318,18 @@ def tcp_tests (options,index):
         return [
             # local test
             { 'server_node': 'node1',
-              'server_slice' : '%s_slpl1'%login_base(index),
+              'server_slice' : '%s_sl1'%login_base(index),
               'client_node' : 'node1',
-              'client_slice' : '%s_slpl1'%login_base(index),
+              'client_slice' : '%s_sl1'%login_base(index),
               'port' : 2000,
               }]
     elif index == 2:
         return [
             # remote test
             { 'server_node': 'node2',
-              'server_slice' : '%s_slpl3'%login_base(index),
+              'server_slice' : '%s_sl3'%login_base(index),
               'client_node' : 'node2',
-              'client_slice' : '%s_slpl4'%login_base(index),
+              'client_slice' : '%s_sl4'%login_base(index),
               'port' : 4000,
               },
             ]
@@ -369,27 +404,42 @@ def sfa (options,index) :
         'SFA_PLC_PASSWORD' : 'test++',
 # use -c sfadebug to increment this one
         'SFA_API_LOGLEVEL': 1,
+# use -c sfavoid to set this to 'void'
+        'SFA_GENERIC_FLAVOUR' : 'pl',
+        'SFA_AGGREGATE_ENABLED' : 'true',
         # details of the slices to create
         'sfa_slice_specs' : [ sfa_slice_spec(options,index,rspec_style) 
                               for rspec_style in options.rspec_styles ]
     }
 
-# subindex is 0 (pl slice) or 1 (pg slice)
+# rspecstyle is 'pl' for sfav1 or 'pg' for pgv2
 def sfa_slice_spec (options,index,rspec_style):
-    the_login_base=login_base(index)
-    piuser='fake-pi%d'%index
-    regularuser='sfauser%d%s'%(index,rspec_style)
-    slicename='slsfa%d%s'%(index,rspec_style)
+    the_login_base=sfa_login_base(index,rspec_style)
+    # we're already in a dedicated site/authority so no need to encumber with odd names
+    piuser='pi'
+    pimail=piuser+'@test.onelab.eu'
+    regularuser='us'
+    slicename='sl'
     prefix='%s.%s'%(sfa_root(index),the_login_base)
     hrn=prefix+'.'+slicename
     user_hrn=prefix+'.'+regularuser
     pi_hrn=prefix+'.'+piuser
-    key=public_key2
     mail="%s@%s"%(regularuser,domain)
+    user_key=public_key2
+    # xxx as compared with the xml-record-based approach
+    # is enabled=True needed here ?
+    # ditto for roles = user+tech
+    person_options = { '-t': 'user',
+                       '-x': user_hrn,
+                       '-e': mail,
+                       '-f': "Fake",
+                       '-l': "SFA-style-%s"%rspec_style,
+                       }
+                       
     person_record_xml =\
-'''<record hrn="%(user_hrn)s" type="user" email="%(mail)s" enabled="True" 
+'''<record enabled="True" 
 first_name="Fake" last_name="Sfa style=%(rspec_style)s" >
-<keys>%(key)s</keys>
+<keys>%(user_key)s</keys>
 <roles>user</roles>
 <roles>tech</roles>
 </record>'''%locals()
@@ -406,14 +456,17 @@ first_name="Fake" last_name="Sfa style=%(rspec_style)s" >
                               },
              'login_base' : the_login_base,
              'piuser' : piuser,
+             'pimail' : pimail,
              'regularuser':regularuser,
              'domain':domain,
              'usernames' : [ (regularuser,'key2') ],
              'nodenames' : all_nodenames(options,index),
              'sitename' : the_login_base,
              'slicename' : slicename,
-             'slice_record' : slice_record_xml,
+             # handle key separately because of embedded whitespace
+             'person_options': person_options,
              'person_record' : person_record_xml,
+             'slice_record' : slice_record_xml,
              'rspec_style':rspec_style,
              }