X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2FTestUserSfa.py;h=68530e5fd4f4d61c2f2248044ac3670cc78e6552;hb=refs%2Ftags%2Ftests-5.3-7;hp=49eb7ebac8b8d037bcfcac61d03f5261166b0cdd;hpb=649f388f61085663d060f100fa011fe81305053d;p=tests.git diff --git a/system/TestUserSfa.py b/system/TestUserSfa.py index 49eb7eb..68530e5 100644 --- a/system/TestUserSfa.py +++ b/system/TestUserSfa.py @@ -15,34 +15,41 @@ class TestUserSfa: self.test_plc=self.test_auth_sfa.test_plc self.login_base=self.test_auth_sfa.login_base - def sfi_path(self): return self.test_auth_sfa.sfi_path() - def qualified(self,name): return self.test_auth_sfa.qualified(name) + def sfi_path(self): + return self.test_auth_sfa.sfi_path() + def hrn(self): + return self.test_auth_sfa.obj_hrn(self.user_spec['name']) + def sfi_pi(self,*args,**kwds): + return self.test_auth_sfa.sfi_pi(*args, **kwds) + def sfi_user(self,*args,**kwds): + return self.test_auth_sfa.sfi_user(*args, **kwds) # 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="sfi -d %s add"%(self.sfi_path()) + def sfa_register_user (self,options): + "add a regular user using sfi register" + user_hrn = self.hrn() + command="register" 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['register_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) - return self.test_plc.run_in_guest(command)==0 + return self.test_plc.run_in_guest(self.sfi_pi(command))==0 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.hrn() + 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" - auth=self.test_auth_sfa.root_hrn() + user_hrn = self.hrn() + command="remove -t user %s"%user_hrn return \ - self.test_plc.run_in_guest("sfi -d %s remove -t user %s.%s.%s"%( - self.sfi_path(),auth,self.login_base,self.regularuser))==0 + self.test_plc.run_in_guest(self.sfi_pi(command))==0