Ejemplo n.º 1
0
    def test_smb_mount_and_access_by_different_users(self, samba_share_public):
        user1 = self.ipa_user1
        password1 = self.ipa_user1_password
        user2 = self.ipa_user2
        password2 = self.ipa_user2_password
        mount_point = '/mnt/smb'

        try:
            self.mount_smb_share(user1, password1, samba_share_public,
                                 mount_point)
            tasks.run_command_as_user(self.smbclient, user2,
                                      ['kdestroy', '-A'])
            tasks.run_command_as_user(self.smbclient,
                                      user2, ['kinit', user2],
                                      stdin_text=password2 + '\n')
            self.smb_sanity_check(user2, mount_point, samba_share_public)
        finally:
            self.cleanup_mount(mount_point)
Ejemplo n.º 2
0
    def install(cls, mh):
        if cls.domain_level is not None:
            domain_level = cls.domain_level
        else:
            domain_level = cls.master.config.domain_level
        tasks.install_topo(cls.topology,
                           cls.master,
                           cls.replicas,
                           cls.clients,
                           domain_level,
                           clients_extra_args=('--mkhomedir', ))

        cls.ad = cls.ads[0]
        cls.smbserver = cls.clients[0]
        cls.smbclient = cls.clients[1]
        cls.ad_user = '******'.format(cls.ad_user_login, cls.ad.domain.name)

        for h in [cls.smbserver, cls.smbclient]:
            tasks.config_host_resolvconf_with_master_data(cls.master, h)

        tasks.install_adtrust(cls.master)
        tasks.configure_dns_for_trust(cls.master, cls.ad)
        tasks.configure_windows_dns_for_trust(cls.ad, cls.master)
        tasks.establish_trust_with_ad(cls.master,
                                      cls.ad.domain.name,
                                      extra_args=['--two-way=true'])

        tasks.create_active_user(cls.master,
                                 cls.ipa_user1,
                                 password=cls.ipa_user1_password)
        tasks.create_active_user(cls.master,
                                 cls.ipa_user2,
                                 password=cls.ipa_user2_password)
        # Trigger creation of home directories on the SMB server
        for user in [cls.ipa_user1, cls.ipa_user2, cls.ad_user]:
            tasks.run_command_as_user(cls.smbserver, user, ['stat', '.'])
Ejemplo n.º 3
0
 def is_auth_cached(self, user):
     cmd = ['su', '-l', user['name'], '-c', 'true']
     res = tasks.run_command_as_user(self.master, self.intermed_user, cmd,
                                     stdin_text=user['password'] + '\n')
     return 'Authenticated with cached credentials.' in res.stdout_text