def test_create_and_retrieve_vault_replica_with_kra(self): # install KRA on replica tasks.install_kra(self.replicas[0], first_instance=False) # create vault self.replicas[0].run_command([ "ipa", "vault-add", self.vault_name_replica_with_KRA, "--password", self.vault_password, "--type", "symmetric", ]) # archive secret self.replicas[0].run_command([ "ipa", "vault-archive", self.vault_name_replica_with_KRA, "--password", self.vault_password, "--data", self.vault_data, ]) time.sleep(WAIT_AFTER_ARCHIVE) self._retrieve_secret([self.vault_name_replica_with_KRA]) ################# master ################# # test master again after KRA was installed on replica # create vault self.master.run_command([ "ipa", "vault-add", self.vault_name_master2, "--password", self.vault_password, "--type", "symmetric", ]) # archive secret self.master.run_command([ "ipa", "vault-archive", self.vault_name_master2, "--password", self.vault_password, "--data", self.vault_data, ]) time.sleep(WAIT_AFTER_ARCHIVE) self._retrieve_secret([self.vault_name_master2]) ################ old vaults ############### # test if old vaults are still accessible self._retrieve_secret([ self.vault_name_master, self.vault_name_replica_without_KRA, ])
def test_kra_install_master(self): result1 = tasks.install_kra(self.master, first_instance=True, raiseonerr=False) assert result1.returncode == 0, result1.stderr_text tasks.kinit_admin(self.master) result2 = self.master.run_command(["ipa", "vault-find"], raiseonerr=False) found = result2.stdout_text.find("0 vaults matched") assert found > 0, result2.stdout_text
def test_kra_install_master(self): result1 = tasks.install_kra(self.master, first_instance=True, raiseonerr=False) assert result1.returncode == 0, result1.stderr_text tasks.kinit_admin(self.master) result2 = self.master.run_command(["ipa", "vault-find"], raiseonerr=False) found = result2.stdout_text.find("0 vaults matched") assert (found > 0), result2.stdout_text
def test_kra_install_without_replica_file(self): master = self.master replica1 = self.replicas[0] replica2 = self.replicas[1] tasks.install_kra(master, first_instance=True) tasks.install_replica(master, replica1) result1 = tasks.install_kra(replica1, domain_level=DOMAIN_LEVEL_1, raiseonerr=False) assert_error(result1, "A replica file is required", 1) tasks.install_kra(replica1, domain_level=DOMAIN_LEVEL_0, raiseonerr=True) # Now prepare the replica file, copy it to the client and raise # domain level on master to test the reverse situation tasks.replica_prepare(master, replica2) master.run_command(["ipa", "domainlevel-set", str(DOMAIN_LEVEL_1)]) tasks.install_replica(master, replica2) result2 = tasks.install_kra(replica2, domain_level=DOMAIN_LEVEL_0, raiseonerr=False) assert_error(result2, "No replica file is required", 1) tasks.install_kra(replica2)
def test_replica2_ipa_kra_install(self): tasks.install_kra(self.replicas[2])
def test_replica0_ipa_kra_install(self): tasks.install_kra(self.replicas[0], first_instance=True)
def test_install_kra(self): tasks.install_kra(self.master, first_instance=True)