+# NOTE: SFA currently has SFA_AGGREGATE_API_VERSION=2 baked into the code
+def sfa (options,index) :
+ return {
+ # the default is to use AMs in the various aggregates.xml
+ # stack config_sfamesh to point to SMs instead
+ 'neighbours-port':12346,
+ ## global sfa-config-tty stuff
+ 'SFA_REGISTRY_ROOT_AUTH' : sfa_root(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',
+ 'SFA_PLC_URL' : 'deferred-myplc-api-url',
+ 'SFA_PLC_USER' : 'root@test.onelab.eu',
+ 'SFA_PLC_PASSWORD' : 'test++',
+# use -c sfadebug to increment this one
+ 'SFA_API_LOGLEVEL': 1,
+ # 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)
+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)
+ 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)
+ person_record_xml =\
+'''<record hrn="%(user_hrn)s" type="user" email="%(mail)s" enabled="True"
+first_name="Fake" last_name="Sfa style=%(rspec_style)s" >
+<keys>%(key)s</keys>
+<roles>user</roles>
+<roles>tech</roles>
+</record>'''%locals()
+ slice_record_xml =\
+'''<record hrn="%s" type="slice" description="SFA-testing" url="http://test.onelab.eu/">
+<researcher>%s</researcher>
+</record>'''%(hrn, user_hrn)
+
+
+ return { 'slice_fields': {'name':'%s_%s'%(the_login_base,slicename),
+ 'url':'http://foo%d@foo.com'%index,
+ 'description':'SFA-testing',
+ 'max_nodes':2,
+ },
+ 'login_base' : the_login_base,
+ 'piuser' : piuser,
+ 'regularuser':regularuser,
+ 'domain':domain,
+ 'usernames' : [ (regularuser,'key2') ],
+ 'nodenames' : all_nodenames(options,index),
+ 'sitename' : the_login_base,
+ 'slicename' : slicename,
+ 'slice_record' : slice_record_xml,
+ 'person_record' : person_record_xml,
+ 'rspec_style':rspec_style,
+ }
+
+