def test_valuefilter(self): _cred = MtMessagingCredential() _cred.setValueFilter('content', '^HELLO$') # Assert User adding extraCommands = [{ 'command': 'uid user_1' }, { 'command': 'mt_messaging_cred valuefilter content ^HELLO$' }] self.add_user(r'jcli : ', extraCommands, GID='AnyGroup', Username='******') self._test_user_with_MtMessagingCredential('user_1', 'AnyGroup', 'AnyUsername', _cred) # Assert User updating _cred.setValueFilter('content', '^WORLD$') extraCommands = [{ 'command': 'password anypassword' }, { 'command': 'mt_messaging_cred valuefilter content ^WORLD$' }] self.update_user(r'jcli : ', 'user_1', extraCommands) self._test_user_with_MtMessagingCredential('user_1', 'AnyGroup', 'AnyUsername', _cred)
def test_valuefilter(self): _cred = MtMessagingCredential() _cred.setValueFilter('content', '^HELLO$') # Assert User adding extraCommands = [{'command': 'uid user_1'}, {'command': 'mt_messaging_cred valuefilter content ^HELLO$'}] self.add_user(r'jcli : ', extraCommands, GID = 'AnyGroup', Username = '******') self._test_user_with_MtMessagingCredential('user_1', 'AnyGroup', 'AnyUsername', _cred) # Assert User updating _cred.setValueFilter('content', '^WORLD$') extraCommands = [{'command': 'password anypassword'}, {'command': 'mt_messaging_cred valuefilter content ^WORLD$'}] self.update_user(r'jcli : ', 'user_1', extraCommands) self._test_user_with_MtMessagingCredential('user_1', 'AnyGroup', 'AnyUsername', _cred)
def test_all(self): _cred = MtMessagingCredential() _cred.setAuthorization('http_send', False) _cred.setAuthorization('http_long_content', False) _cred.setAuthorization('set_dlr_level', False) _cred.setAuthorization('http_set_dlr_method', False) _cred.setAuthorization('set_source_address', False) _cred.setAuthorization('set_priority', False) _cred.setAuthorization('set_validity_period', False) _cred.setValueFilter('destination_address', '^HELLO$') _cred.setValueFilter('source_address', '^World$') _cred.setValueFilter('priority', '^1$') _cred.setValueFilter('validity_period', '^1$') _cred.setValueFilter('content', '[0-9].*') _cred.setDefaultValue('source_address', 'BRAND NAME') _cred.setQuota('balance', 40.3) _cred.setQuota('http_throughput', 2.2) _cred.setQuota('smpps_throughput', 0.5) # Assert User adding extraCommands = [{'command': 'uid user_1'}, {'command': 'mt_messaging_cred Authorization http_send no'}, {'command': 'mt_messaging_cred authorization http_long_content n'}, {'command': 'mt_messaging_cred authorization dlr_level 0'}, {'command': 'mt_messaging_cred authorization http_dlr_method NO'}, {'command': 'mt_messaging_cred authorization src_addr false'}, {'command': 'mt_messaging_cred authorization priority f'}, {'command': 'mt_messaging_cred authorization validity_period f'}, {'command': 'mt_messaging_cred Valuefilter dst_addr ^HELLO$'}, {'command': 'mt_messaging_cred valuefilter src_addr ^World$'}, {'command': 'mt_messaging_cred valuefilter priority ^1$'}, {'command': 'mt_messaging_cred valuefilter validity_period ^1$'}, {'command': 'mt_messaging_cred valuefilter content [0-9].*'}, {'command': 'mt_messaging_cred Defaultvalue src_addr BRAND NAME'}, {'command': 'mt_messaging_cred Quota balance 40.3'}, {'command': 'mt_messaging_cred quota http_throughput 2.2'}, {'command': 'mt_messaging_cred quota smpps_throughput 0.5'}, ] self.add_user(r'jcli : ', extraCommands, GID = 'AnyGroup', Username = '******') self._test_user_with_MtMessagingCredential('user_1', 'AnyGroup', 'AnyUsername', _cred) # Assert User updating _cred.setAuthorization('http_send', True) _cred.setAuthorization('http_long_content', True) _cred.setAuthorization('set_dlr_level', True) _cred.setAuthorization('http_set_dlr_method', True) _cred.setAuthorization('set_source_address', True) _cred.setAuthorization('set_priority', True) _cred.setAuthorization('set_validity_period', True) _cred.setValueFilter('destination_address', '^WORLD$') _cred.setValueFilter('source_address', '^HELLO$') _cred.setValueFilter('priority', '^2$') _cred.setValueFilter('validity_period', '^2$') _cred.setValueFilter('content', '[2-6].*') _cred.setDefaultValue('source_address', 'SEXY NAME') _cred.setQuota('balance', 66) extraCommands = [{'command': 'mt_messaging_cred authorization http_send yes'}, {'command': 'mt_messaging_cred authorization http_long_content y'}, {'command': 'mt_messaging_cred authorization dlr_level 1'}, {'command': 'mt_messaging_cred authorization http_dlr_method YES'}, {'command': 'mt_messaging_cred authorization src_addr true'}, {'command': 'mt_messaging_cred authorization priority t'}, {'command': 'mt_messaging_cred authorization validity_period t'}, {'command': 'mt_messaging_cred valuefilter dst_addr ^WORLD$'}, {'command': 'mt_messaging_cred valuefilter src_addr ^HELLO$'}, {'command': 'mt_messaging_cred valuefilter priority ^2$'}, {'command': 'mt_messaging_cred valuefilter validity_period ^2$'}, {'command': 'mt_messaging_cred valuefilter content [2-6].*'}, {'command': 'mt_messaging_cred defaultvalue src_addr SEXY NAME'}, {'command': 'mt_messaging_cred quota balance 66'}] self.update_user(r'jcli : ', 'user_1', extraCommands) self._test_user_with_MtMessagingCredential('user_1', 'AnyGroup', 'AnyUsername', _cred)
def test_all(self): _cred = MtMessagingCredential() _cred.setAuthorization('http_send', False) _cred.setAuthorization('http_long_content', False) _cred.setAuthorization('set_dlr_level', False) _cred.setAuthorization('http_set_dlr_method', False) _cred.setAuthorization('set_source_address', False) _cred.setAuthorization('set_priority', False) _cred.setAuthorization('set_validity_period', False) _cred.setValueFilter('destination_address', '^HELLO$') _cred.setValueFilter('source_address', '^World$') _cred.setValueFilter('priority', '^1$') _cred.setValueFilter('validity_period', '^1$') _cred.setValueFilter('content', '[0-9].*') _cred.setDefaultValue('source_address', 'BRAND NAME') _cred.setQuota('balance', 40.3) _cred.setQuota('http_throughput', 2.2) _cred.setQuota('smpps_throughput', 0.5) # Assert User adding extraCommands = [ { 'command': 'uid user_1' }, { 'command': 'mt_messaging_cred authorization http_send no' }, { 'command': 'mt_messaging_cred authorization http_long_content n' }, { 'command': 'mt_messaging_cred authorization dlr_level 0' }, { 'command': 'mt_messaging_cred authorization http_dlr_method NO' }, { 'command': 'mt_messaging_cred authorization src_addr false' }, { 'command': 'mt_messaging_cred authorization priority f' }, { 'command': 'mt_messaging_cred authorization validity_period f' }, { 'command': 'mt_messaging_cred valuefilter dst_addr ^HELLO$' }, { 'command': 'mt_messaging_cred valuefilter src_addr ^World$' }, { 'command': 'mt_messaging_cred valuefilter priority ^1$' }, { 'command': 'mt_messaging_cred valuefilter validity_period ^1$' }, { 'command': 'mt_messaging_cred valuefilter content [0-9].*' }, { 'command': 'mt_messaging_cred defaultvalue src_addr BRAND NAME' }, { 'command': 'mt_messaging_cred quota balance 40.3' }, { 'command': 'mt_messaging_cred quota http_throughput 2.2' }, { 'command': 'mt_messaging_cred quota smpps_throughput 0.5' }, ] self.add_user(r'jcli : ', extraCommands, GID='AnyGroup', Username='******') self._test_user_with_MtMessagingCredential('user_1', 'AnyGroup', 'AnyUsername', _cred) # Assert User updating _cred.setAuthorization('http_send', True) _cred.setAuthorization('http_long_content', True) _cred.setAuthorization('set_dlr_level', True) _cred.setAuthorization('http_set_dlr_method', True) _cred.setAuthorization('set_source_address', True) _cred.setAuthorization('set_priority', True) _cred.setAuthorization('set_validity_period', True) _cred.setValueFilter('destination_address', '^WORLD$') _cred.setValueFilter('source_address', '^HELLO$') _cred.setValueFilter('priority', '^2$') _cred.setValueFilter('validity_period', '^2$') _cred.setValueFilter('content', '[2-6].*') _cred.setDefaultValue('source_address', 'SEXY NAME') _cred.setQuota('balance', 66) extraCommands = [{ 'command': 'mt_messaging_cred authorization http_send yes' }, { 'command': 'mt_messaging_cred authorization http_long_content y' }, { 'command': 'mt_messaging_cred authorization dlr_level 1' }, { 'command': 'mt_messaging_cred authorization http_dlr_method YES' }, { 'command': 'mt_messaging_cred authorization src_addr true' }, { 'command': 'mt_messaging_cred authorization priority t' }, { 'command': 'mt_messaging_cred authorization validity_period t' }, { 'command': 'mt_messaging_cred valuefilter dst_addr ^WORLD$' }, { 'command': 'mt_messaging_cred valuefilter src_addr ^HELLO$' }, { 'command': 'mt_messaging_cred valuefilter priority ^2$' }, { 'command': 'mt_messaging_cred valuefilter validity_period ^2$' }, { 'command': 'mt_messaging_cred valuefilter content [2-6].*' }, { 'command': 'mt_messaging_cred defaultvalue src_addr SEXY NAME' }, { 'command': 'mt_messaging_cred quota balance 66' }] self.update_user(r'jcli : ', 'user_1', extraCommands) self._test_user_with_MtMessagingCredential('user_1', 'AnyGroup', 'AnyUsername', _cred)