def SaveKeys(peer, keys_path, client_index, num_of_keys): result = -1 prog = utils.GetProg('vault_key_helper') proc = subprocess.Popen([ prog, '-ls', '-k', str(client_index), '--keys_path', keys_path, '--peer=' + peer + ':5483' ], shell=False, stdout=PIPE, stderr=None) if utils.TimeOut(utils.LookingFor, ( proc, 'PublicPmidKey stored and verified', 50, num_of_keys, ), timeout_duration=5 * num_of_keys, default=False): print("keys successfully stored to network") result = 0 else: print("failure in storing keys to network") proc.kill vault_killer.KillVaultKeyHelper() return result
def SaveKeys(): num_of_keys = 44 prog = utils.GetProg('vault_key_helper') proc = subprocess.Popen([prog, '-ls', '-k', 10], shell=False, stdout=PIPE, stderr=None) if utils.TimeOut(utils.LookingFor, ( proc, 'PublicPmidKey stored and verified', 50, num_of_keys, ), timeout_duration=5 * num_of_keys, default=False): print("keys successfully stored to network") result = 0 else: print("failure in storing keys to network") proc.kill lifestuff_killer.KillVaultKeyHelper()
def TestStoreWithDelete(num, index): prog = utils.GetProg('vault_key_helper') proc = subprocess.Popen( [prog, '-lw', '-k', str(index), '--chunk_set_count=' + str(num)], shell=False, stdout=PIPE, stderr=None) if utils.TimeOut(utils.LookingFor, ( proc, 'Delete chunk', 100, num, ), timeout_duration=60 * num, default=False): print("test with delete succeeded") else: print("test with delete failed") proc.kill vault_killer.KillVaultKeyHelper()