Ejemplo n.º 1
0
    def _full_backup_restore_with_DNS_zone(self, reinstall=False):
        """backup, uninstall, restore"""
        with restore_checker(self.master):

            self.master.run_command([
                'ipa', 'dnszone-add',
                self.example_test_zone,
            ])

            tasks.resolve_record(self.master.ip, self.example_test_zone)

            backup_path = backup(self.master)

            self.master.run_command(['ipa-server-install',
                                     '--uninstall',
                                     '-U'])

            if reinstall:
                tasks.install_master(self.master, setup_dns=True)

            dirman_password = self.master.config.dirman_password
            self.master.run_command(['ipa-restore', backup_path],
                                    stdin_text=dirman_password + '\nyes')

            tasks.resolve_record(self.master.ip, self.example_test_zone)

            self.master.run_command([
                'ipa', 'dnszone-add',
                self.example2_test_zone,
            ])

            tasks.resolve_record(self.master.ip, self.example2_test_zone)
Ejemplo n.º 2
0
    def _full_backup_restore_with_DNS_zone(self, reinstall=False):
        """backup, uninstall, restore"""
        with restore_checker(self.master):

            self.master.run_command([
                'ipa', 'dnszone-add',
                self.example_test_zone,
            ])

            tasks.resolve_record(self.master.ip, self.example_test_zone)

            backup_path = backup(self.master)

            self.master.run_command(['ipa-server-install',
                                     '--uninstall',
                                     '-U'])

            if reinstall:
                tasks.install_master(self.master, setup_dns=True)

            dirman_password = self.master.config.dirman_password
            self.master.run_command(['ipa-restore', backup_path],
                                    stdin_text=dirman_password + '\nyes')

            tasks.resolve_record(self.master.ip, self.example_test_zone)

            tasks.kinit_admin(self.master)
            self.master.run_command([
                'ipa', 'dnszone-add',
                self.example2_test_zone,
            ])

            tasks.resolve_record(self.master.ip, self.example2_test_zone)
Ejemplo n.º 3
0
 def install(cls, mh):
     tasks.install_master(cls.master, setup_dns=True)
     args = [
         "ipa-kra-install",
         "-p", cls.master.config.dirman_password,
         "-U",
     ]
     cls.master.run_command(args)
 def install(cls):
     super(TestForcedClientReenrollment, cls).install()
     tasks.install_master(cls.master)
     tasks.install_replica(cls.master, cls.replicas[0], setup_ca=False)
     cls.BACKUP_KEYTAB = os.path.join(
         cls.master.config.test_dir,
         'krb5.keytab'
     )
 def install(cls, mh):
     super(TestForcedClientReenrollment, cls).install(mh)
     tasks.install_master(cls.master)
     tasks.install_replica(cls.master, cls.replicas[0], setup_ca=False)
     cls.BACKUP_KEYTAB = os.path.join(
         cls.master.config.test_dir,
         'krb5.keytab'
     )
Ejemplo n.º 6
0
 def install(cls, mh):
     tasks.install_master(cls.master, setup_dns=True)
     args = [
         "ipa-dns-install",
         "--dnssec-master",
         "--forwarder", cls.master.config.dns_forwarder,
         "-U",
     ]
     cls.master.run_command(args)
Ejemplo n.º 7
0
 def install(cls, mh):
     tasks.install_master(cls.master, setup_dns=True)
     args = [
         "ipa-dns-install",
         "--dnssec-master",
         "--forwarder", cls.master.config.dns_forwarder,
         "-p", cls.master.config.dirman_password,
         "-U",
     ]
     cls.master.run_command(args)
     tasks.install_replica(cls.master, cls.replicas[0], setup_dns=True)
Ejemplo n.º 8
0
    def install(cls, mh):
        tasks.install_master(cls.master, setup_dns=True)
        tasks.install_replica(cls.master, cls.replicas[0], setup_dns=True,
                              setup_ca=False)
        tasks.install_replica(cls.master, cls.replicas[1], setup_dns=True,
                              setup_ca=False)

        for host in (cls.master, cls.replicas[0], cls.replicas[1]):
            ldap = host.ldap_connect()
            tasks.wait_for_replication(ldap)

        # give time to named to retrieve new records
        time.sleep(20)
Ejemplo n.º 9
0
    def install(cls, mh):
        tasks.install_master(cls.master, setup_dns=True)
        tasks.install_replica(cls.master, cls.replicas[0], setup_dns=True,
                              setup_ca=False)
        tasks.install_replica(cls.master, cls.replicas[1], setup_dns=True,
                              setup_ca=False)

        for host in (cls.master, cls.replicas[0], cls.replicas[1]):
            ldap = host.ldap_connect()
            tasks.wait_for_replication(ldap)

        # give time to named to retrieve new records
        time.sleep(20)
Ejemplo n.º 10
0
    def install(cls, mh):
        tasks.install_master(cls.master, setup_dns=False)
        args = [
            "ipa-dns-install",
            "--dnssec-master",
            "--forwarder", cls.master.config.dns_forwarder,
            "-U",
        ]
        cls.master.run_command(args)

        tasks.install_replica(cls.master, cls.replicas[0], setup_dns=True)

        # backup trusted key
        tasks.backup_file(cls.master, paths.DNSSEC_TRUSTED_KEY)
        tasks.backup_file(cls.replicas[0], paths.DNSSEC_TRUSTED_KEY)
Ejemplo n.º 11
0
 def install(cls, mh):
     cls.username = "******"
     tasks.install_master(cls.master, domain_level=cls.domain_level)
     password = cls.master.config.dirman_password
     cls.new_password = "******"
     adduser_stdin_text = "%s\n%s\n" % (cls.master.config.admin_password, cls.master.config.admin_password)
     user_kinit_stdin_text = "%s\n%s\n%s\n" % (password, cls.new_password, cls.new_password)
     tasks.kinit_admin(cls.master)
     cls.master.run_command(
         ["ipa", "user-add", cls.username, "--password", "--first", "John", "--last", "Donn"],
         stdin_text=adduser_stdin_text,
     )
     # Now we need to change the password for the user
     cls.master.run_command(["kinit", cls.username], stdin_text=user_kinit_stdin_text)
     # And again kinit admin
     tasks.kinit_admin(cls.master)
Ejemplo n.º 12
0
    def _full_backup_restore_with_vault(self, reinstall=False):
        with restore_checker(self.master):
            # create vault
            self.master.run_command([
                "ipa", "vault-add",
                self.vault_name,
                "--password", self.vault_password,
                "--type", "symmetric",
            ])

            # archive secret
            self.master.run_command([
                "ipa", "vault-archive",
                self.vault_name,
                "--password", self.vault_password,
                "--data", self.vault_data,
            ])

            # retrieve secret
            self.master.run_command([
                "ipa", "vault-retrieve",
                self.vault_name,
                "--password", self.vault_password,
            ])

            backup_path = backup(self.master)

            self.master.run_command(['ipa-server-install',
                                     '--uninstall',
                                     '-U'])

            if reinstall:
                tasks.install_master(self.master, setup_dns=True)

            dirman_password = self.master.config.dirman_password
            self.master.run_command(['ipa-restore', backup_path],
                                    stdin_text=dirman_password + '\nyes')

            tasks.kinit_admin(self.master)
            # retrieve secret after restore
            self.master.run_command([
                "ipa", "vault-retrieve",
                self.vault_name,
                "--password", self.vault_password,
            ])
Ejemplo n.º 13
0
 def install(cls, mh):
     cls.username = '******'
     tasks.install_master(cls.master, domain_level=cls.domain_level)
     password = cls.master.config.dirman_password
     cls.new_password = '******'
     adduser_stdin_text = "%s\n%s\n" % (cls.master.config.admin_password,
                                        cls.master.config.admin_password)
     user_kinit_stdin_text = "%s\n%s\n%s\n" % (password, cls.new_password,
                                               cls.new_password)
     tasks.kinit_admin(cls.master)
     cls.master.run_command(['ipa', 'user-add', cls.username, '--password',
                             '--first', 'John', '--last', 'Donn'],
                            stdin_text=adduser_stdin_text)
     # Now we need to change the password for the user
     cls.master.run_command(['kinit', cls.username],
                            stdin_text=user_kinit_stdin_text)
     # And again kinit admin
     tasks.kinit_admin(cls.master)
Ejemplo n.º 14
0
 def install(cls, mh):
     cls.username = '******'
     tasks.install_master(cls.master, domain_level=cls.domain_level)
     password = cls.master.config.dirman_password
     cls.new_password = '******'
     adduser_stdin_text = "%s\n%s\n" % (cls.master.config.admin_password,
                                        cls.master.config.admin_password)
     user_kinit_stdin_text = "%s\n%s\n%s\n" % (password, cls.new_password,
                                               cls.new_password)
     tasks.kinit_admin(cls.master)
     cls.master.run_command([
         'ipa', 'user-add', cls.username, '--password', '--first', 'John',
         '--last', 'Donn'
     ],
                            stdin_text=adduser_stdin_text)
     # Now we need to change the password for the user
     cls.master.run_command(['kinit', cls.username],
                            stdin_text=user_kinit_stdin_text)
     # And again kinit admin
     tasks.kinit_admin(cls.master)
Ejemplo n.º 15
0
    def _full_backup_and_restore_with_DNSSEC_zone(self, reinstall=False):
        with restore_checker(self.master):

            self.master.run_command([
                'ipa', 'dnszone-add',
                self.example_test_zone,
                '--dnssec', 'true',
            ])

            assert wait_until_record_is_signed(self.master.ip,
                self.example_test_zone, self.log), "Zone is not signed"

            backup_path = backup(self.master)

            self.master.run_command(['ipa-server-install',
                                     '--uninstall',
                                     '-U'])

            if reinstall:
                tasks.install_master(self.master, setup_dns=True)

            dirman_password = self.master.config.dirman_password
            self.master.run_command(['ipa-restore', backup_path],
                                    stdin_text=dirman_password + '\nyes')

            assert wait_until_record_is_signed(self.master.ip,
                self.example_test_zone, self.log), ("Zone is not signed after "
                                                    "restore")

            tasks.kinit_admin(self.master)
            self.master.run_command([
                'ipa', 'dnszone-add',
                self.example2_test_zone,
                '--dnssec', 'true',
            ])

            assert wait_until_record_is_signed(self.master.ip,
                self.example2_test_zone, self.log), "A new zone is not signed"
Ejemplo n.º 16
0
 def install(cls, mh):
     tasks.install_master(cls.master, setup_dns=True, setup_kra=True)
Ejemplo n.º 17
0
 def install(cls, mh):
     tasks.install_master(cls.master, setup_dns=False)
Ejemplo n.º 18
0
 def test_install_master(self):
     tasks.install_master(self.master, setup_dns=True)
Ejemplo n.º 19
0
 def install(cls, mh):
     tasks.install_master(cls.master, setup_dns=True, setup_kra=True)
 def install(cls, mh):
     # just prepare LDIF file on both master and replica
     cls.replicas[0].put_file_contents(CONFIG_LDIF_PATH, DIRSRV_CONFIG_MODS)
     tasks.install_master(cls.master)
 def test_customized_ds_install_master(self):
     tasks.install_master(
         self.master,
         setup_dns=False,
         extra_args=['--dirsrv-config-file', CONFIG_LDIF_PATH])
Ejemplo n.º 22
0
 def install(cls, mh):
     tasks.install_master(cls.master, setup_dns=True)
     tasks.install_replica(cls.master, cls.replicas[0], setup_dns=True)
Ejemplo n.º 23
0
 def install(cls, mh):
     tasks.install_master(cls.master, domain_level=cls.domain_level)
Ejemplo n.º 24
0
 def install(cls, mh):
     tasks.install_master(cls.master, domain_level=cls.domain_level)
Ejemplo n.º 25
0
 def install(cls, mh):
     tasks.install_master(cls.master, setup_kra=True)
     # do not install KRA on replica, it is part of test
     tasks.install_replica(cls.master, cls.replicas[0], setup_kra=False)
Ejemplo n.º 26
0
 def test_install_master(self):
     tasks.install_master(self.master, setup_dns=True)
Ejemplo n.º 27
0
 def install(cls, mh):
     tasks.install_master(cls.master, setup_dns=False)
Ejemplo n.º 28
0
 def install(cls, mh):
     tasks.install_master(cls.master, setup_kra=True)
     # do not install KRA on replica, it is part of test
     tasks.install_replica(cls.master, cls.replicas[0], setup_kra=False)