fixed a glitch that cause sfa-delete-user to fail
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 26 Oct 2011 10:26:50 +0000 (12:26 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 26 Oct 2011 10:26:50 +0000 (12:26 +0200)
system/TestSliceSfa.py
system/config_default.py
system/step_sfa.py [new file with mode: 0644]
system/step_sfarestart.py [new file with mode: 0644]

index eb865b7..82fa0ed 100644 (file)
@@ -29,7 +29,7 @@ class TestSliceSfa:
     def name(self):
         return self.sfa_slice_spec['slice_fields']['name']
     
-    def mode (self): return self.sfa_slice_spec['mode']
+    def rspecmode (self): return self.sfa_slice_spec['rspecmode']
 
     def hrn(self): 
        root_auth=self.test_plc.plc_spec['sfa']['SFA_REGISTRY_ROOT_AUTH']
@@ -43,7 +43,7 @@ class TestSliceSfa:
     def reqfile (self): return self.resname("req","rspec")
     def nodefile (self): return self.resname("nodes","txt")
     def discover_option(self):
-        if self.mode()=='pg': return "-r protogeni"
+        if self.rspecmode()=='pg': return "-r protogeni"
         else: return ""
 
     def sfi_path (self):
index 1adf9b7..fca0d68 100644 (file)
@@ -312,26 +312,27 @@ def sfa (options,index) :
        'SFA_PLC_URL' : 'deferred-myplc-api-url',
         'SFA_API_DEBUG': True,
         # details of the slices to create
-        # xxx framework is ready to use pg rspecs, but code is not yet
-        'sfa_slice_specs' : [ sfa_slice_spec(options,index,mode) 
-                              for mode in ['pl']],
+        'sfa_slice_specs' : [ sfa_slice_spec(options,index,rspecmode) 
+                              for rspecmode in ['pl','pg']],
     }
 
 # subindex is 0 (pl slice) or 1 (pg slice)
-def sfa_slice_spec (options,index,mode):
+def sfa_slice_spec (options,index,rspecmode):
     the_login_base=login_base(index)
     piuser='fake-pi%d'%index
-    regularuser='sfauser%d%s'%(index,mode)
-    slicename='slsfa%d%s'%(index,mode)
+    regularuser='sfauser%d%s'%(index,rspecmode)
+    slicename='slsfa%d%s'%(index,rspecmode)
     prefix='%s.%s'%(sfa_root(index),the_login_base)
     hrn=prefix+'.'+slicename
+    person_hrn=prefix+'.'+regularuser
     researcher=prefix+'.'+piuser
     slice_add_xml = '''<record hrn="%s" type="slice" description="SFA-testing" url="http://test.onelab.eu/">
 <researcher>%s</researcher></record>'''%(hrn, researcher)
 
     mail="%s@%s"%(regularuser,domain)
+    print 'in sfa_slice_spec','slicename',slicename,'hrn',hrn,'mail',mail
     key=public_key
-    slice_person_xml ='''<record email="%(mail)s" enabled="True" first_name="Fake" hrn="%(hrn)s" 
+    slice_person_xml ='''<record email="%(mail)s" enabled="True" first_name="Fake" hrn="%(person_hrn)s" 
 last_name="Sfa" name="%(hrn)s" type="user">
 <keys>%(key)s</keys><role_ids>20</role_ids><role_ids>10</role_ids>
 <site_ids>1</site_ids><roles>pi</roles><roles>admin</roles><sites>%(prefix)s</sites></record>'''%locals()
@@ -351,7 +352,7 @@ last_name="Sfa" name="%(hrn)s" type="user">
              'slicename' : slicename,
              'slice_add_xml' : slice_add_xml,
              'slice_person_xml' : slice_person_xml,
-             'mode':mode,
+             'rspecmode':rspecmode,
              } 
 
 
diff --git a/system/step_sfa.py b/system/step_sfa.py
new file mode 100644 (file)
index 0000000..1dc046d
--- /dev/null
@@ -0,0 +1,20 @@
+# Thierry Parmentelat <thierry.parmentelat@inria.fr>
+# Copyright (C) 2010 INRIA 
+#
+from TestPlc import TestPlc
+
+def run01sfa_plcclean (test_plc):   return test_plc.sfa_plcclean()
+def run02sfa_dbclean (test_plc):   return test_plc.sfa_dbclean()
+def run03sfa_import (test_plc):   return test_plc.sfa_import()
+def run04sfi_configure (test_plc):   return test_plc.sfi_configure()
+def run05sfa_add_user (test_plc):   return test_plc.sfa_add_user()
+def run06sfa_add_slice (test_plc):     return test_plc.sfa_add_slice()
+def run07sfa_discover (test_plc):     return test_plc.sfa_discover()
+def run08sfa_create_slice (test_plc):     return test_plc.sfa_create_slice()
+def run09sfa_check_slice_plc (test_plc):     return test_plc.sfa_check_slice_plc()
+def run10sfa_update_user (test_plc):     return test_plc.sfa_update_user()
+def run11sfa_update_slice (test_plc):     return test_plc.sfa_update_slice()
+def run12sfa_view (test_plc):     return test_plc.sfa_view()
+def run13sfa_utest (test_plc):     return test_plc.sfa_utest()
+def run14sfa_delete_slice (test_plc):     return test_plc.sfa_delete_slice()
+def run15sfa_delete_user (test_plc):     return test_plc.sfa_delete_user()
diff --git a/system/step_sfarestart.py b/system/step_sfarestart.py
new file mode 100644 (file)
index 0000000..8840f34
--- /dev/null
@@ -0,0 +1,23 @@
+# Thierry Parmentelat <thierry.parmentelat@inria.fr>
+# Copyright (C) 2010 INRIA 
+#
+from TestPlc import TestPlc
+
+def run01_pcleean (test_plc):
+    return test_plc.sfa_plcclean()
+def run02_dclean (test_plc):
+    return test_plc.sfa_dbclean()
+def run03_lclean (test_plc):
+    return test_plc.logclean_sfa()
+def run04_stop (test_plc):
+    return test_plc.sfa_stop()
+def run11_iclean (test_plc):
+    return test_plc.sfi_clean()
+def run21_conf (test_plc):
+    return test_plc.sfa_configure()
+def run22_import (test_plc):
+    return test_plc.sfa_import()
+def run23_start (test_plc):
+    return test_plc.sfa_start()
+def run31_iconf (test_plc):
+    return test_plc.sfi_configure()