From 3b3d113e498e6a9c1ed0b9d1a12fb9d49c025d5c Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Sat, 2 Jun 2012 13:08:06 +0200 Subject: [PATCH] enable regular sfa user with sfi update --- system/TestPlc.py | 5 ++--- system/TestSliceSfa.py | 2 +- system/TestUserSfa.py | 15 ++++++++------- system/config_default.py | 7 ++++--- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/system/TestPlc.py b/system/TestPlc.py index 0f78c84..ccb90a5 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -89,9 +89,8 @@ class TestPlc: 'qemu_export', 'qemu_kill_mine', 'qemu_start', 'timestamp_qemu', SEP, 'sfa_install_all', 'sfa_configure', 'cross_sfa_configure', 'sfa_start', 'sfa_import', SEPSFA, 'sfi_configure@1', 'sfa_add_site@1','sfa_add_pi@1', SEPSFA, - 'sfa_add_user@1', 'sfa_add_slice@1', 'sfa_discover@1', SEPSFA, - 'sfa_create_slice@1', 'sfa_check_slice_plc@1', SEPSFA, - 'sfa_update_user@1', 'sfa_update_slice@1', SEPSFA, + 'sfa_add_user@1', 'sfa_update_user@1', 'sfa_add_slice@1', 'sfa_discover@1', SEPSFA, + 'sfa_create_slice@1', 'sfa_check_slice_plc@1', 'sfa_update_slice@1', SEPSFA, 'sfi_list@1', 'sfi_show@1', 'sfi_slices@1', 'sfa_utest@1', SEPSFA, # we used to run plcsh_stress_test, and then ssh_node_debug and ssh_node_boot # but as the stress test might take a while, we sometimes missed the debug mode.. diff --git a/system/TestSliceSfa.py b/system/TestSliceSfa.py index 125eb59..357b7c8 100644 --- a/system/TestSliceSfa.py +++ b/system/TestSliceSfa.py @@ -39,7 +39,7 @@ class TestSliceSfa: sfi_command="add" sfi_command += " --type slice" sfi_command += " --xrn %s"%self.qualified(self.slice_spec['name']) - for opt in self.slice_spec['sfi_options']: + for opt in self.slice_spec['add_options']: sfi_command += " %s"%(opt) return self.test_plc.run_in_guest(self.sfi_pi(sfi_command))==0 diff --git a/system/TestUserSfa.py b/system/TestUserSfa.py index d0bf3c8..c95733f 100644 --- a/system/TestUserSfa.py +++ b/system/TestUserSfa.py @@ -23,14 +23,12 @@ class TestUserSfa: # xxx todo - not the right place any longer - or is it ? def sfa_add_user (self,options): "add a regular user using sfi add" - sfi_add_options = self.user_spec['sfi_options'] user_hrn = self.qualified(self.user_spec['name']) - command="%s add"%(self.sfi_path()) + command="add" command += " --type user" command += " --xrn %s"%user_hrn command += " --email %s"%self.user_spec['email'] - for opt in sfi_add_options: - command += " %s"%(opt,) + command += " " + " ".join(self.user_spec['add_options']) # handle key separately because of embedded whitespace # hack - the user's pubkey is avail from his hrn command += " -k %s/%s.pub"%(self.sfi_path(),user_hrn) @@ -38,9 +36,12 @@ class TestUserSfa: def sfa_update_user (self,options): "update a user record using sfi update" - # xxx TODO now that we use sfi arguments - utils.header ("WARNING: TestUserSfa.update_user needs more work") - return True + user_hrn = self.qualified(self.user_spec['name']) + command="update" + command += " --type user" + command += " --xrn %s"%user_hrn + command += " " + " ".join(self.user_spec['update_options']) + return self.test_plc.run_in_guest(self.sfi_pi(command))==0 def sfa_delete_user(self,options): "run sfi delete on user record" diff --git a/system/config_default.py b/system/config_default.py index 3c3cb9f..53b43aa 100644 --- a/system/config_default.py +++ b/system/config_default.py @@ -523,15 +523,16 @@ def test_auth_sfa_spec (options,index,rspec_style): 'name': 'us', 'email': full_mail ('regularuser'), 'key_name': 'key_sfauser', - 'sfi_options': [ '--extra',"enabled=true", - '--extra',"first_name=Fake", + 'add_options': [ '--extra',"first_name=Fake", '--extra',"last_name=SFA-style-%s"%rspec_style, ], + 'update_options': [ '--extra',"enabled=true", + ], } slice_spec = { 'name': 'sl', - 'sfi_options': [ '--researchers', user_hrn, + 'add_options': [ '--researchers', user_hrn, # xxx '--extra', "description=SFA-testing-%s"%rspec_style, '--extra', "url=http://slice%d.test.onelab.eu/"%index, -- 2.43.0