Пример #1
0
    def test_all(self):
        _cred = SmppsCredential()
        _cred.setAuthorization('bind', False)
        _cred.setQuota('max_bindings', 11)

        # Assert User adding
        extraCommands = [{
            'command': 'uid user_1'
        }, {
            'command': 'smpps_cred authorization bind no'
        }, {
            'command': 'smpps_cred quota max_bindings 11'
        }]
        self.add_user(r'jcli : ',
                      extraCommands,
                      GID='AnyGroup',
                      Username='******')
        self._test_user_with_SmppsCredential('user_1', 'AnyGroup',
                                             'AnyUsername', _cred)

        # Assert User updating
        _cred.setAuthorization('bind', True)
        _cred.setQuota('max_bindings', 66)
        extraCommands = [{
            'command': 'smpps_cred authorization bind y'
        }, {
            'command': 'smpps_cred quota max_bindings 66'
        }]
        self.update_user(r'jcli : ', 'user_1', extraCommands)
        self._test_user_with_SmppsCredential('user_1', 'AnyGroup',
                                             'AnyUsername', _cred)
Пример #2
0
    def test_authorization(self):
        _cred = SmppsCredential()
        _cred.setAuthorization('bind', False)

        # Assert User adding
        extraCommands = [{
            'command': 'uid user_1'
        }, {
            'command': 'smpps_cred authorization bind no'
        }]
        self.add_user(r'jcli : ',
                      extraCommands,
                      GID='AnyGroup',
                      Username='******')
        self._test_user_with_SmppsCredential('user_1', 'AnyGroup',
                                             'AnyUsername', _cred)

        # Assert User updating
        _cred.setAuthorization('bind', True)
        extraCommands = [{
            'command': 'password anypassword'
        }, {
            'command': 'smpps_cred authorization bind 1'
        }]
        self.update_user(r'jcli : ', 'user_1', extraCommands)
        self._test_user_with_SmppsCredential('user_1', 'AnyGroup',
                                             'AnyUsername', _cred)
Пример #3
0
    def test_authorization(self):
        _cred = SmppsCredential()
        _cred.setAuthorization('bind', False)

        # Assert User adding
        extraCommands = [{'command': 'uid user_1'},
                         {'command': 'smpps_cred authorization bind no'}]
        self.add_user(r'jcli : ', extraCommands, GID = 'AnyGroup', Username = '******')
        self._test_user_with_SmppsCredential('user_1', 'AnyGroup', 'AnyUsername', _cred)

        # Assert User updating
        _cred.setAuthorization('bind', True)
        extraCommands = [{'command': 'password anypassword'},
                         {'command': 'smpps_cred authorization bind 1'}]
        self.update_user(r'jcli : ', 'user_1', extraCommands)
        self._test_user_with_SmppsCredential('user_1', 'AnyGroup', 'AnyUsername', _cred)
Пример #4
0
    def test_all(self):
        _cred = SmppsCredential()
        _cred.setAuthorization('bind', False)
        _cred.setQuota('max_bindings', 11)

        # Assert User adding
        extraCommands = [{'command': 'uid user_1'},
                         {'command': 'smpps_cred authorization bind no'},
                         {'command': 'smpps_cred quota max_bindings 11'}]
        self.add_user(r'jcli : ', extraCommands, GID = 'AnyGroup', Username = '******')
        self._test_user_with_SmppsCredential('user_1', 'AnyGroup', 'AnyUsername', _cred)

        # Assert User updating
        _cred.setAuthorization('bind', True)
        _cred.setQuota('max_bindings', 66)
        extraCommands = [{'command': 'smpps_cred authorization bind y'},
                         {'command': 'smpps_cred quota max_bindings 66'}]
        self.update_user(r'jcli : ', 'user_1', extraCommands)
        self._test_user_with_SmppsCredential('user_1', 'AnyGroup', 'AnyUsername', _cred)