Beispiel #1
0
uuid = mxos_operations_MessageBodyEncryption.fetch_latest_message_uuid(mx1_mxos1_host_ip,mx1_mxos1_port,'*****@*****.**')

basic_class.mylogger_record.debug('step2:fetch message body from cassandrablob directly')
messagebody1 = cassandra_operations.cassandra_cqlsh_fetch_messagebody(mx1_blobstore_host_ip,mx1_blobstore_port,uuid,AES_mode5)

body_check_flag1 = messagebody1.count(' we love world !!!!!!ucucucucucuc')
basic_class.mylogger_record.debug('body_check_flag1= '+str(body_check_flag1))

if body_check_flag1 >=1:
    result_lists.append('fetch messagebody from cassandra success')
else:
    result_lists.append('fetch messagebody from cassandra fail')    


basic_class.mylogger_record.info('step3:fetch message body from IMAP')
myimap = imap_operations.IMAP_Ops(mx1_imap1_host_ip,mx1_imap1_port)
myimap.imap_login('testuser1','testuser1')
myimap.imap_select()
messagebody2 = myimap.imap_fetch('1','rfc822')
myimap.imap_logout()

body_check_flag2 = messagebody2[1].count(' we love world !!!!!!ucucucucucuc')
basic_class.mylogger_record.debug('body_check_flag2 = '+str(body_check_flag2))

    
if body_check_flag2 >=1:
    result_lists.append('fetch messagebody from IMAP success')
else:
    result_lists.append('fetch messagebody from IMAP fail')
    
basic_function.summary(result_lists)
Beispiel #2
0
import imap_operations
import global_variables
import time
import remote_operations
import stat_statistics

#step 1
basic_class.mylogger_record.info(
    'step1:imap login:5 account with correct passwd, the other 5 use wrong pssswd'
)

mx1_imap1_host_ip,mx1_imap1_port,mx_account,mx1_host1_ip,root_account,root_passwd,test_account_base,default_domain = \
global_variables.get_values('mx1_imap1_host_ip','mx1_imap1_port','mx_account','mx1_host1_ip','root_account','root_passwd','test_account_base','default_domain')

for i in range(1, 6):
    mximap1 = imap_operations.IMAP_Ops(mx1_imap1_host_ip, mx1_imap1_port)
    try:
        mximap1.imap_login('u' + str(i) + '@' + default_domain,
                           test_account_base + str(i))  # using correct passwd
        basic_class.mylogger_record.info('imap alias login success')
    except:
        basic_class.mylogger_record.error('imap alias login fail')
    mximap1.imap_select()
    mximap1.imap_logout()

for i in range(6, 11):
    mximap2 = imap_operations.IMAP_Ops(mx1_imap1_host_ip, mx1_imap1_port)
    try:
        mximap2.imap_login('u' + str(i) + '@' + default_domain,
                           'password')  # using wrong passwd :password here
    except:
Beispiel #3
0
#uuid1 = mxos_operations_MessageBodyEncryption.fetch_latest_message_uuid(mx1_mxos_host1_ip,mx1_mxos_host1_eureka_port,'*****@*****.**')
#
#basic_class.mylogger_record.debug('step2:fetch message body from cassandrablob directly')
#
#encrypted_flag,messagebody1 = cassandra_operations.cassandra_cqlsh_fetch_messagebody(mx1_cassblob_ip,mx1_search_cassandraBlobPort,uuid1,AES_mode1)
#
#body_check_flag1 = messagebody1.count('This world could be better')
#basic_class.mylogger_record.debug('body_check_flag1= '+str(body_check_flag1))
#
#if encrypted_flag == 1 and body_check_flag1 >=1:
#    result_lists.append('fetch messagebody from cassandra success')
#else:
#    result_lists.append('fetch messagebody from cassandra fail')

basic_class.mylogger_record.info('step3:fetch message body from IMAP')
myimap = imap_operations.IMAP_Ops(mx1_imapserv_host1_ip,
                                  mx1_imapserv_host1_imap4Port)
myimap.imap_login('testuser1', 'testuser1')
myimap.imap_select()
messagebody2 = myimap.imap_fetch('1', 'rfc822')
myimap.imap_logout()

body_check_flag2 = messagebody2[1].count('This world could be better')
basic_class.mylogger_record.debug('body_check_flag2 = ' +
                                  str(body_check_flag2))

if body_check_flag2 >= 1:
    result_lists.append('fetch messagebody from IMAP success')
else:
    result_lists.append('fetch messagebody from IMAP fail')

basic_class.mylogger_record.info('step 4: update passphrase again')
Beispiel #4
0
import imap_operations
import global_variables
import time
import remote_operations
import stat_statistics


#step 1
basic_class.mylogger_record.info('step1:imap auth_crammd5:10 account with correct passwd, the other 5 use wrong pssswd')

mx2_imapserv_host1_ip,mx2_mss_host1_ip,mx2_mta_host1_SMTPPort,mx2_mta_host1_ip,mx2_host1_ip,mx2_popserv_host1_pop3Port,mx2_popserv_host1,mx2_imapserv_host1_imap4Port,mx2_imapserv_host1,mx1_mss_host1_ip,mx1_mss_host2_ip,mx1_imapserv_host1_ip,mx1_imapserv_host1_imap4Port,mx1_mta_host1_ip,mx1_mta_host1_SMTPPort,mx1_popserv_host1_ip,mx1_popserv_host1_pop3Port,mx_account,mx1_host1_ip,root_account,root_passwd,test_account_base,mx1_default_domain,mx2_default_domain = \
global_variables.get_values('mx2_imapserv_host1_ip','mx2_mss_host1_ip','mx2_mta_host1_SMTPPort','mx2_mta_host1_ip','mx2_host1_ip','mx2_popserv_host1_pop3Port','mx2_popserv_host1','mx2_imapserv_host1_imap4Port','mx2_imapserv_host1','mx1_mss_host1_ip','mx1_mss_host2_ip','mx1_imapserv_host1_ip','mx1_imapserv_host1_imap4Port','mx1_mta_host1_ip','mx1_mta_host1_SMTPPort','mx1_popserv_host1_ip','mx1_popserv_host1_pop3Port','mx_account','mx1_host1_ip','root_account','root_passwd','test_account_base','mx1_default_domain','mx2_default_domain')


for i in range(1,6): 
    mximap1 = imap_operations.IMAP_Ops(mx1_imapserv_host1_ip,mx1_imapserv_host1_imap4Port)
    try:
        mximap1.imap_auth_crammd5(test_account_base+str(i),test_account_base+str(i)) # using correct passwd
        basic_class.mylogger_record.info('auth_cram-md5 success')
    except:
        basic_class.mylogger_record.error('auth_cram-md5 fail')
    mximap1.imap_select()
    mximap1.imap_logout()

for i in range(6,11): 
    mximap2 = imap_operations.IMAP_Ops(mx1_imapserv_host1_ip,mx1_imapserv_host1_imap4Port)
    try:
        mximap2.imap_auth_crammd5(test_account_base+str(i),'password') # using wrong passwd :password here
    except:
        basic_class.mylogger_record.error('auth_cram-md5 fail')
    mximap2.imap_logout()