Ejemplo n.º 1
0
import pop_operations
import global_variables
import time
import remote_operations
import stat_statistics

#step 1
basic_class.mylogger_record.info(
    'step1:pop login:5 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):
    mxpop1 = pop_operations.POP_Ops(mx1_popserv_host1_ip,
                                    mx1_popserv_host1_pop3Port)
    try:
        mxpop1.pop_apop('u' + str(i) + '@' + mx2_default_domain,
                        test_account_base + str(i))  # using correct passwd
        basic_class.mylogger_record.info('pop alias login success')
    except:
        basic_class.mylogger_record.error('pop alias login fail')
    mxpop1.pop_stat()
    mxpop1.pop_quit()

for i in range(6, 11):
    mxpop2 = pop_operations.POP_Ops(mx1_popserv_host1_ip,
                                    mx1_popserv_host1_pop3Port)
    try:
        mxpop2.pop_apop('u' + str(i) + '@' + mx2_default_domain,
                        'password')  # using wrong passwd :password here
Ejemplo n.º 2
0
remote_operations.remote_operation(
    mx2_mss1_host_ip, root_account, root_passwd,
    'su - {0} -c "~/lib/imservctrl killStart popserv"'.format(mx_account), 0)
time.sleep(50)

#1#########################################################################################################################
basic_class.mylogger_recordnf.title(
    'running testcase:MX-12765:StatMSSRetrMsg_200_pop_retr_same_normal_message_for_5_times'
)
basic_class.mylogger_record.info('clear current popserv.stat file')
remote_operations.remote_operation(
    mx2_host1_ip, root_account, root_passwd,
    'su - {0} -c "> log/popserv.stat"'.format(mx_account), 0)

for i in range(1, 6):
    mypop3 = pop_operations.POP_Ops(mx1_pop1_host_ip, mx1_pop1_port)
    mypop3.pop_login(test_account_base + str(i), test_account_base + str(i))
    mypop3.pop_list()
    mypop3.pop_retr(2)
    mypop3.pop_retr(2)
    mypop3.pop_retr(2)
    mypop3.pop_retr(2)
    mypop3.pop_retr(2)
    mypop3.pop_quit()

basic_class.mylogger_record.info('fetching popserv.stat ...')
time.sleep(50)
basic_class.mylogger_record.info('check and analyze popserv.stat file ...')
popserv_stat_content = remote_operations.remote_operation(
    mx2_host1_ip, root_account, root_passwd,
    'su - {0} -c "cat log/popserv.stat|grep StatMSSRetrMsg"'.format(
Ejemplo n.º 3
0
Archivo: run.py Proyecto: whsasf/WuKong
import pop_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_pop1_host_ip,mx1_pop1_port,mx_account,mx1_host1_ip,root_account,root_passwd,test_account_base,default_domain = \
global_variables.get_values('mx1_pop1_host_ip','mx1_pop1_port','mx_account','mx1_host1_ip','root_account','root_passwd','test_account_base','default_domain')


for i in range(1,6): 
    mxpop1 = pop_operations.POP_Ops(mx1_pop1_host_ip,mx1_pop1_port)
    try:
        mxpop1.pop_auth_plain(test_account_base+str(i),test_account_base+str(i)) # using correct passwd
        basic_class.mylogger_record.info('pop auth_plain success')
    except:
        basic_class.mylogger_record.error('pop auth_plain fail')
    mxpop1.pop_stat()
    mxpop1.pop_quit()

for i in range(6,11): 
    mxpop2 = pop_operations.POP_Ops(mx1_pop1_host_ip,mx1_pop1_port)
    try:
        mxpop2.pop_auth_plain(test_account_base+str(i),'password') # using wrong passwd :password here
    except:
        basic_class.mylogger_record.error('pop auth_plain fail')
    mxpop2.pop_quit()
Ejemplo n.º 4
0
    mx2_mss_host1_ip,
    'su - {0} -c "~/lib/imservctrl killStart popserv"'.format(mx_account),
    root_account, root_passwd, 0)
time.sleep(50)

#1#########################################################################################################################
basic_class.mylogger_recordnf.title(
    'running testcase:MX-12765:StatMSSRetrMsg_200_pop_retr_same_normal_message_for_5_times'
)
basic_class.mylogger_record.info('clear current popserv.stat file')
remote_operations.remote_operation(
    mx2_host1_ip, 'su - {0} -c "> log/popserv.stat"'.format(mx_account),
    root_account, root_passwd, 0)

for i in range(1, 6):
    mypop3 = pop_operations.POP_Ops(mx1_popserv_host1_ip,
                                    mx1_popserv_host1_pop3Port)
    mypop3.pop_login(test_account_base + str(i), test_account_base + str(i))
    mypop3.pop_list()
    mypop3.pop_retr(2)
    mypop3.pop_retr(2)
    mypop3.pop_retr(2)
    mypop3.pop_retr(2)
    mypop3.pop_retr(2)
    mypop3.pop_quit()

basic_class.mylogger_record.info('fetching popserv.stat ...')
time.sleep(50)
basic_class.mylogger_record.info('check and analyze popserv.stat file ...')
flag, popserv_stat_content = remote_operations.remote_operation(
    mx2_host1_ip,
    'su - {0} -c "cat log/popserv.stat|grep StatMSSRetrMsg"'.format(