コード例 #1
0
ファイル: test_nfs.py プロジェクト: xxblx/freeipa
    def cleanup(self):

        nfssrv = self.clients[0]
        nfsclt = self.replicas[0]
        automntclt = self.replicas[1]

        nfsclt.run_command(["umount", "-a", "-t", "nfs4"])
        nfsclt.run_command(["systemctl", "stop", "rpc-gssd"])

        nfssrv.run_command(["systemctl", "stop", "nfs-server"])
        nfssrv.run_command(["systemctl", "disable", "nfs-server"])
        nfssrv.run_command([
            "rm", "-f", "/etc/exports.d/krbnfs.exports",
            "/etc/exports.d/stdnfs.exports"
        ])

        nfssrv.run_command(["rm", "-rf", "/exports"])

        tasks.uninstall_client(nfsclt)
        tasks.uninstall_client(nfssrv)
        self.master.run_command(
            ["ipa", "host-mod", automntclt.hostname, "--location", "''"])
        # not strictly necessary, but this exercises automountlocation-del
        self.master.run_command(["ipa", "automountlocation-del", "seattle"])
        nfsclt.run_command(["systemctl", "restart", "nfs-utils"])
        nfssrv.run_command(["systemctl", "restart", "nfs-utils"])
        for client in (nfssrv, nfsclt, automntclt):
            self.restore_resolv_conf(client)
        tasks.uninstall_master(self.master)
コード例 #2
0
ファイル: test_ntp_options.py プロジェクト: wladich/freeipa
 def fin():
     """
     Uninstall ipa-server, ipa-replica and ipa-client
     """
     tasks.uninstall_client(self.client)
     tasks.uninstall_master(self.replica)
     tasks.uninstall_master(self.master)
コード例 #3
0
ファイル: test_nfs.py プロジェクト: encukou/freeipa
    def cleanup(self):

        nfssrv = self.clients[0]
        nfsclt = self.replicas[0]
        automntclt = self.replicas[1]

        nfsclt.run_command(["umount", "-a", "-t", "nfs4"])
        nfsclt.run_command(["systemctl", "stop", "rpc-gssd"])

        nfssrv.run_command(["systemctl", "stop", "nfs-server"])
        nfssrv.run_command(["systemctl", "disable", "nfs-server"])
        nfssrv.run_command([
            "rm", "-f", "/etc/exports.d/krbnfs.exports",
            "/etc/exports.d/stdnfs.exports"
        ])

        nfssrv.run_command(["rm", "-rf", "/exports"])

        tasks.uninstall_client(nfsclt)
        tasks.uninstall_client(nfssrv)
        self.master.run_command([
            "ipa", "host-mod", automntclt.hostname,
            "--location", "''"
        ])
        # not strictly necessary, but this exercises automountlocation-del
        self.master.run_command([
            "ipa", "automountlocation-del", "seattle"
        ])
        nfsclt.run_command(["systemctl", "restart", "nfs-utils"])
        nfssrv.run_command(["systemctl", "restart", "nfs-utils"])
        for client in (nfssrv, nfsclt, automntclt):
            self.restore_resolv_conf(client)
        tasks.uninstall_master(self.master)
コード例 #4
0
ファイル: test_ntp_options.py プロジェクト: thalman/freeipa
 def teardown_method(self, method):
     """
     Uninstall ipa-server, ipa-replica and ipa-client
     """
     tasks.uninstall_client(self.client)
     tasks.uninstall_master(self.replica)
     tasks.uninstall_master(self.master)
コード例 #5
0
ファイル: test_nfs.py プロジェクト: zhuomingliang/freeipa
    def nsswitch_backup_restore(
        self,
        no_sssd=False,
    ):

        # In order to get a more pure sum, one that ignores the Generated
        # header and any white space we have to do a bit of work...
        sha256nsswitch_cmd = \
            'egrep -v "Generated|^$" /etc/nsswitch.conf | sed "s/\\s//g" ' \
            '| sort | sha256sum'

        cmd = self.clients[0].run_command(sha256nsswitch_cmd)
        orig_sha256 = cmd.stdout_text

        grep_automount_command = \
            "grep automount /etc/nsswitch.conf | cut -d: -f2"

        tasks.install_client(self.master, self.clients[0])
        cmd = self.clients[0].run_command(grep_automount_command)
        after_ipa_client_install = cmd.stdout_text.split()

        if no_sssd:
            ipa_client_automount_command = [
                "ipa-client-automount", "--no-sssd", "-U"
            ]
        else:
            ipa_client_automount_command = ["ipa-client-automount", "-U"]
        self.clients[0].run_command(ipa_client_automount_command)
        cmd = self.clients[0].run_command(grep_automount_command)
        after_ipa_client_automount = cmd.stdout_text.split()
        if no_sssd:
            assert after_ipa_client_automount == ['files', 'ldap']
        else:
            assert after_ipa_client_automount == ['sss', 'files']

        cmd = self.clients[0].run_command(grep_automount_command)
        assert cmd.stdout_text.split() == after_ipa_client_automount

        self.clients[0].run_command(
            ["ipa-client-automount", "--uninstall", "-U"])

        if not no_sssd:
            # https://pagure.io/freeipa/issue/8190
            # check that no ipa_automount_location is left in sssd.conf
            # also check for autofs_provider for good measure
            grep_automount_in_sssdconf_cmd = \
                "egrep ipa_automount_location\\|autofs_provider " \
                "/etc/sssd/sssd.conf"
            cmd = self.clients[0].run_command(grep_automount_in_sssdconf_cmd,
                                              raiseonerr=False)
            assert cmd.returncode == 1, \
                "PG8190 regression found: ipa_automount_location still " \
                "present in sssd.conf"

        cmd = self.clients[0].run_command(grep_automount_command)
        assert cmd.stdout_text.split() == after_ipa_client_install

        tasks.uninstall_client(self.clients[0])
        cmd = self.clients[0].run_command(sha256nsswitch_cmd)
        assert cmd.stdout_text == orig_sha256
コード例 #6
0
ファイル: test_ntp_options.py プロジェクト: encukou/freeipa
 def teardown_method(self, method):
     """
     Uninstall ipa-server, ipa-replica and ipa-client
     """
     tasks.uninstall_client(self.client)
     tasks.uninstall_master(self.replica)
     tasks.uninstall_master(self.master)
コード例 #7
0
ファイル: test_nfs.py プロジェクト: zpytela/freeipa
 def verify_checksum_after_ipaclient_uninstall(
     self,
     sha256nsswitch_cmd,
     orig_sha256
 ):
     tasks.uninstall_client(self.clients[0])
     cmd = self.clients[0].run_command(sha256nsswitch_cmd)
     assert cmd.stdout_text == orig_sha256
コード例 #8
0
    def nsswitch_backup_restore(
        self,
        no_sssd=False,
    ):

        # In order to get a more pure sum, one that ignores the Generated
        # header and any white space we have to do a bit of work...
        sha256nsswitch_cmd = \
            'egrep -v "Generated|^$" /etc/nsswitch.conf | sed "s/\\s//g" ' \
            '| sort | sha256sum'

        cmd = self.clients[0].run_command(sha256nsswitch_cmd)
        orig_sha256 = cmd.stdout_text

        grep_automount_command = \
            "grep automount /etc/nsswitch.conf | cut -d: -f2"

        tasks.install_client(self.master, self.clients[0])
        cmd = self.clients[0].run_command(grep_automount_command)
        after_ipa_client_install = cmd.stdout_text.split()

        if no_sssd:
            ipa_client_automount_command = [
                "ipa-client-automount", "--no-sssd", "-U"
            ]
        else:
            ipa_client_automount_command = ["ipa-client-automount", "-U"]
        self.clients[0].run_command(ipa_client_automount_command)
        cmd = self.clients[0].run_command(grep_automount_command)
        after_ipa_client_automount = cmd.stdout_text.split()
        if no_sssd:
            assert after_ipa_client_automount == ['files', 'ldap']
        else:
            assert after_ipa_client_automount == ['sss', 'files']

        cmd = self.clients[0].run_command(grep_automount_command)
        assert cmd.stdout_text.split() == after_ipa_client_automount

        self.clients[0].run_command(
            ["ipa-client-automount", "--uninstall", "-U"])

        cmd = self.clients[0].run_command(grep_automount_command)
        assert cmd.stdout_text.split() == after_ipa_client_install

        tasks.uninstall_client(self.clients[0])
        cmd = self.clients[0].run_command(sha256nsswitch_cmd)
        assert cmd.stdout_text == orig_sha256
コード例 #9
0
 def uninstall(cls, mh):
     for replica in cls.replicas:
         try:
             tasks.run_server_del(cls.master,
                                  replica.hostname,
                                  force=True,
                                  ignore_topology_disconnect=True,
                                  ignore_last_of_role=True)
         except subprocess.CalledProcessError:
             # If the master has already been uninstalled,
             # this call may fail
             pass
         tasks.uninstall_master(replica)
     tasks.uninstall_master(cls.master)
     for client in cls.clients:
         tasks.uninstall_client(client)
     if cls.fips_mode:
         cls.disable_fips_mode()
コード例 #10
0
 def teardown_client():
     tasks.uninstall_client(request.cls.clients[0])
     request.cls.delete_client_host_entry()
コード例 #11
0
 def test_dns_lookup_kdc_is_true_with_ipa_server_on_cli(self):
     tasks.install_client(self.master,
                          self.clients[0],
                          extra_args=["--server", self.master.hostname])
     self.check_dns_lookup_kdc(self.clients[0])
     tasks.uninstall_client(self.clients[0])
コード例 #12
0
 def test_dns_lookup_kdc_is_true_with_default_enrollment_options(self):
     self.check_dns_lookup_kdc(self.clients[0])
     tasks.uninstall_client(self.clients[0])
コード例 #13
0
ファイル: test_smb.py プロジェクト: thalman/freeipa
 def uninstall(cls, mh):
     for client in cls.clients + cls.replicas:
         tasks.uninstall_client(client)
         cls.restore_resolv_conf(client)
     tasks.uninstall_master(cls.master)
コード例 #14
0
 def cleanup(self):
     """
     Uninstall ipa-server and ipa-client
     """
     tasks.uninstall_client(self.client)
     tasks.uninstall_master(self.master)
コード例 #15
0
 def uninstall(cls, mh):
     tasks.uninstall_master(cls.master)
     for replica in cls.replicas:
         tasks.uninstall_master(replica)
     for client in cls.clients:
         tasks.uninstall_client(client)
コード例 #16
0
 def teardown_method(self, method):
     tasks.uninstall_client(self.clients[0])
コード例 #17
0
ファイル: base.py プロジェクト: encukou/freeipa
 def uninstall(cls, mh):
     tasks.uninstall_master(cls.master)
     for replica in cls.replicas:
         tasks.uninstall_master(replica)
     for client in cls.clients:
         tasks.uninstall_client(client)
コード例 #18
0
 def fin():
     tasks.uninstall_client(self.clients[0])
コード例 #19
0
 def teardown_client():
     tasks.uninstall_client(request.cls.clients[0])
     request.cls.delete_client_host_entry()