Пример #1
0
 def test_got_credentials_password_and_secret(self):
     junk_dconf = {
         'cifspassword': '******',
         'cifspassword_secret': 'secret123'
     }
     got_creds = cifutils.containsCredentials(junk_dconf, prefix="cifs")
     self.assertEquals(got_creds, False)
Пример #2
0
 def test_got_credentials_everything_smbsr(self):
     good_dconf = {
         'username': '******',
         'password': '******',
         'password_secret': 'secret123'
     }
     self.assertEquals(cifutils.containsCredentials(good_dconf), True)
Пример #3
0
 def test_got_credentials_everything(self):
     good_dconf = {
         'username': '******',
         'cifspassword': '******',
         'cifspassword_secret': 'secret123'
     }
     got_creds = cifutils.containsCredentials(good_dconf, prefix="cifs")
     self.assertEquals(got_creds, True)
Пример #4
0
 def test_got_credentials_everything_and_padding_smbsr(self):
     good_dconf = {
         'sahara': 'camel',
         'username': '******',
         'password': '******',
         'password_secret': 'secret123',
         'nile': 'crocodile'
     }
     self.assertEquals(cifutils.containsCredentials(good_dconf), True)
Пример #5
0
 def test_got_credentials_everything_and_padding(self):
     good_dconf = {
         'sahara': 'camel',
         'username': '******',
         'cifspassword': '******',
         'cifspassword_secret': 'secret123',
         'nile': 'crocodile'
     }
     got_creds = cifutils.containsCredentials(good_dconf, prefix="cifs")
     self.assertEquals(got_creds, True)
Пример #6
0
Файл: SMBSR.py Проект: stormi/sm
    def getMountOptions(self, domain):
        """Creates option string based on parameters provided"""
        options = ['cache=loose', 'vers=3.0', 'actimeo=0']

        if domain:
            options.append('domain=' + domain)

        if not cifutils.containsCredentials(self.dconf):
            # No login details provided.
            options.append('guest')

        return options
Пример #7
0
Файл: ISOSR.py Проект: xcp-ng/sm
    def appendCIFSMountOptions(self, mountcmd):
        """Append options to mount.cifs"""
        options = []
        try:
            options.append(self.getCacheOptions())

            if not cifutils.containsCredentials(self.dconf, prefix="cifs"):
                options.append('guest')

            options.append(self.getSMBVersion())

            username, domain = (cifutils.splitDomainAndUsername(
                self.dconf['username']))

            if domain:
                options.append('domain=' + domain)
        except:
            util.SMlog("Exception while attempting to append mount options")
            raise

        # Extend mountcmd appropriately
        if options:
            options = ",".join(str(x) for x in options if x)
            mountcmd.extend(["-o", options])
Пример #8
0
 def test_got_credentials_user_and_password_smbsr(self):
     good_dconf = {'username': '******', 'password': '******'}
     self.assertEquals(cifutils.containsCredentials(good_dconf), True)
Пример #9
0
 def test_got_credentials_user_and_password(self):
     good_dconf = {'username': '******', 'cifspassword': '******'}
     got_cred = cifutils.containsCredentials(good_dconf, prefix="cifs")
     self.assertEquals(got_cred, True)
Пример #10
0
 def test_got_credentials_password_and_secret_smbsr(self):
     junk_dconf = {
         'password': '******',
         'password_secret': 'secret123'
     }
     self.assertEquals(cifutils.containsCredentials(junk_dconf), False)
Пример #11
0
 def test_got_credentials_username_only_smbsr(self):
     junk_dconf = {'username': '******'}
     self.assertEquals(cifutils.containsCredentials(junk_dconf), False)
Пример #12
0
 def test_got_credentials_empty_dconf_smbsr(self):
     junk_dconf = {}
     self.assertEquals(cifutils.containsCredentials(junk_dconf), False)