else: return 'site%s'%chr(index+94)
def sfa_login_base (index, rspec_style):
- return "sfasite%s"%(rspec_style)
+ return "sfa%s"%(rspec_style)
def sfa_root (index):
# use plt (planetlab test) instead of pl
# 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,
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,
},
]
'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 ]
# rspecstyle is 'pl' for sfav1 or 'pg' for pgv2
def sfa_slice_spec (options,index,rspec_style):
the_login_base=sfa_login_base(index,rspec_style)
- piuser='sfapi%d%s'%(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='sfauser%d%s'%(index,rspec_style)
- slicename='slsfa%d%s'%(index,rspec_style)
+ 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()
'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,
}