def check_pm_as(): global nes_info caseutils.pre_test_case( "check_nbi_pm_" + nes_info["AS"]["ne_type"] + "_rop=" + str(nes_info["AS"]["interval"]) + "_cases", "nbi_pm_automation") NBIPmFunc.PMCmpInstance(nes_info["AS"]["ne_type"], nes_info["AS"]["nename"], nes_info["AS"]["nodeid"], nes_info["AS"]["licid"], nes_info["AS"]["interval"], nes_info["AS"]["time"]).check_pm_accuracy() caseutils.post_test_case()
# -*- coding: utf-8 -*- import os from datetime import datetime, timedelta from com.ericsson.xn.commons import caseutils from com.ericsson.xn.x.pm.PmCommons import PmBaseFunc sep = os.sep module_name = os.path.split(os.path.abspath(__file__))[1][:-3] # Pre of the test case caseutils.pre_test_case(module_name, 'pm_automation') root_dir = os.path.dirname(os.path.abspath(__file__)).split( 'x' + sep + 'pm' + sep + 'test_cases', 1)[0] ne_info_cfg = os.path.normpath(root_dir + sep + 'x' + sep + 'pm' + sep + 'nes' + sep + 'ltehss.cfg') counter_info_cfg = os.path.normpath(root_dir + sep + 'x' + sep + 'pm' + sep + 'counters' + sep + 'ltehss.cfg') me_counter_cfg = os.path.normpath(root_dir + sep + 'x' + sep + 'pm' + sep + 'me_counters' + sep + 'ltehss.cfg') me_types_cfg = os.path.normpath(root_dir + sep + 'x' + sep + 'pm' + sep + 'me_types' + sep + 'ltehss.cfg') server_info_path = os.path.normpath(root_dir + sep + 'x' + sep + 'pm' + sep + 'execute_conf.cfg') t_now = datetime.now() end_time = t_now + timedelta(minutes=-(t_now.minute % 5 + 14)) str_end_time = end_time.strftime('%Y-%m-%d %H:%M') + ":00" PmBaseFunc.check_pm_accurate(ne_info_cfg, counter_info_cfg, server_info_path, str_end_time, 2, 12, me_counter_cfg, me_types_cfg) # Post of the test case
error_code = int(alarm_raw["code"]) if error_code==1: alarm_trap = alarm_raw["trap"] nbi_notif = alarm_raw["nbi"] test.info("get TrapInfo is:" + str(alarm_trap) + " and NotifInfo is:" + str(nbi_notif)) test.info("start to check " + alarm_type) check_notif_items = mappingInstance.get_property("notif_attr_names") attr_list = [] if type(check_notif_items) is types.StringType: attr_list.append(check_notif_items) else: attr_list = check_notif_items check_attr_accuracy(mappingInstance,alarm_trap,nbi_notif,ne_name,nodeid,attr_list,mysqlInst) else: test.failed(dict_ne_info["ne_type"] + ":" + alarm_type + " accuracy test failed, reason:sending alarm trap failed, the error msg is:" + alarm_raw["msg"]) mysqlInst.closeConnection() except Exception as e: mysqlInst.closeConnection() test.error(e.message) if __name__ == '__main__': pre_test_case("check_hss_nbi_notif_accuracy_case","notify_accuracy") check_notify_accuracy(ne_info_cfg,server_info_cfg,notify_mapping_cfg) post_test_case()
# -*- coding: utf-8 -*- import os from datetime import datetime, timedelta from com.ericsson.xn.commons import caseutils from com.ericsson.xn.x.pm.PmCommons import PmBaseFunc sep = os.sep module_name = os.path.split(os.path.abspath(__file__))[1][:-4] # Pre of the test case caseutils.pre_test_case(module_name, 'pm_automation') root_dir = os.path.dirname(os.path.abspath(__file__)).split('x' + sep + 'pm' + sep + 'test_cases', 1)[0] ne_info_cfg = os.path.normpath(root_dir + sep + 'x' + sep + 'pm' + sep + 'nes' + sep + 'imshss.cfg') counter_info_cfg = os.path.normpath(root_dir + sep + 'x' + sep + 'pm' + sep + 'counters' + sep + 'imshss.cfg') me_counter_cfg = os.path.normpath(root_dir + sep + 'x' + sep + 'pm' + sep + 'me_counters' + sep + 'imshss.cfg') me_types_cfg = os.path.normpath(root_dir + sep + 'x' + sep + 'pm' + sep + 'me_types' + sep + 'imshss.cfg') server_info_path = os.path.normpath(root_dir + sep + 'x' + sep + 'pm' + sep + 'execute_conf.cfg') t_now = datetime.now() end_time = t_now + timedelta(minutes=-(t_now.minute % 5 + 14)) str_end_time = end_time.strftime('%Y-%m-%d %H:%M') + ":00" PmBaseFunc.check_pm_accurate(ne_info_cfg, counter_info_cfg, server_info_path, str_end_time, 4, 12, me_counter_cfg, me_types_cfg) # Post of the test case. caseutils.post_test_case()
def check_pm_imshss(): global nes_info caseutils.pre_test_case("check_nbi_pm_"+nes_info["IMSHSS"]["ne_type"]+"_rop="+str(nes_info["IMSHSS"]["interval"])+"_cases", "nbi_pm_automation") NBIPmFunc.PMCmpInstance(nes_info["IMSHSS"]["ne_type"],nes_info["IMSHSS"]["nename"],nes_info["IMSHSS"]["nodeid"],nes_info["IMSHSS"]["licid"],nes_info["IMSHSS"]["interval"],nes_info["IMSHSS"]["time"]).check_pm_accuracy() caseutils.post_test_case()
def check_imshss_nbi_accuracy(): pre_test_case("check_imshss_nbi_accuracy_case", "nbi_notify_accuracy") check_notify_accuracy(ne_info_cfg, server_info_cfg, notify_mapping_cfg) post_test_case()
def check_ltehss_nbi_accuracy(): pre_test_case("check_ltehss_nbi_accuracy_case", "nbi_notify_accuracy") check_notify_accuracy(ne_info_cfg, server_info_cfg, notify_mapping_cfg) post_test_case()
def check_imshss_alarm_accuracy(): pre_test_case("check_imshss_gui_accuracy_case", "gui_fm_accuracy") check_alarm_data_accuracy(ne_info_cfg, server_info_cfg, alarm_mapping_cfg) post_test_case()
def check_imshss_alarm_accuracy(): pre_test_case("check_imshss_gui_accuracy_case","gui_fm_accuracy") check_alarm_data_accuracy(ne_info_cfg,server_info_cfg,alarm_mapping_cfg) post_test_case()
if (options.ne_type.lower() != 'sgsn' and options.ne_type.lower() != 'mme' and options.ne_type.lower() != 'sgw' and options.ne_type.lower() != 'pgw' and options.ne_type.lower() != 'as' and options.ne_type.lower() != 'sbc' and options.ne_type.lower() != 'imshss' and options.ne_type.lower() != 'ltehss'): print "Only support NETYPE including SGSN,MME,SGW,PGW,AS,SBC,IMSHSS and LTEHSS." parser.print_help() return -1 if (options.interval % 5): print "incorrect interval.It must be multiples of 5" parser.print_help() return -1 if options.time != "": pattern = re.compile(r'\d{12}') match = pattern.match(options.time) if match == None: print "The input pm_timestamp must be in format of YYmmddHHMM." parser.print_help() return -1 return options if __name__ == '__main__': options=get_options() if options!=-1: caseutils.pre_test_case("check_nbi_pm_"+options.ne_type.lower()+"_rop="+str(options.interval)+"_cases", "nbi_pm_automation") NBIPmFunc.PMCmpInstance(options.ne_type,options.nename,options.nodeid,options.licid,options.interval,options.time).check_pm_accuracy() caseutils.post_test_case()
if (options.interval % 5): print "incorrect interval.It must be multiples of 5" parser.print_help() return -1 if options.time != "": pattern = re.compile(r'\d{12}') match = pattern.match(options.time) if match == None: print "The input pm_timestamp must be in format of YYmmddHHMM." parser.print_help() return -1 return options if __name__ == '__main__': options = get_options() if options != -1: caseutils.pre_test_case( "check_nbi_pm_" + options.ne_type.lower() + "_rop=" + str(options.interval) + "_cases", "nbi_pm_automation") NBIPmFunc.PMCmpInstance(options.ne_type, options.nename, options.nodeid, options.licid, options.interval, options.time).check_pm_accuracy() caseutils.post_test_case()