Example #1
0
 def test_PLMN(self):
     rs232 = RS232_Putty()
     rs232.RS232_Connect_Putty()
     android = Android()
     android.Check_Mobile_Note4()
     heMS_SetParameterValues = config_element.get(
         "location", "heMS_SetParameterValues")
     heNB_SetParameterValuesResponse = config_element.get(
         "location", "heNB_SetParameterValuesResponse")
     print 'PLMN\'s testcase...'
     for cycle_times in range(
             int(config_setting.get("cycle_times", "times"))):
         print 'The Cycle times : ' + str(cycle_times + 1)
         plmn = config_setting.get("setting", "PLMN")
         merge_plmn = plmn.split(" ")[0] + plmn.split(" ")[1]
         cellmapper_plmn = config.get("cellmapper_setting", "PLMN")
         # Click the PLMNID via PLMNList folder
         for runtime in range(int(config.get("plmn_setting", "times"))):
             status = config_setting.get("setting", "status")
             os.system("taskkill /F /IM iexplore.exe")
             print 'The Run Times : ' + str(runtime + 1)
             print 'PLMN of ACS : ' + merge_plmn + ' Frequence of mobile : ' + cellmapper_plmn
             # Open the airplane mode
             adbClient = AdbClient()
             adbClient.Start_Airplane()
             # Open the acs website homepage
             webcontrol = Webcontrol()
             webcontrol.Initial()
             webcontrol.Login()
             webcontrol.Clear_All_Data(
                 config_element.get("system", "system_message_queue"),
                 config_element.get("delete_file",
                                    "delete_all_message_queue_button"),
                 "Delete Message successfully!")
             # Set the boolean to false
             webcontrol.Parameter_List_PLMN(
                 config_element.get("PLMN", "enable_checkbox"),
                 config_element.get("PLMN", "enable_value"), status)
             webcontrol.ACS_Initiate_Connection()
             webcontrol.HeNS_Request_Message_PLMN(status,
                                                  heMS_SetParameterValues)
             webcontrol.HeNB_Response_Message(
                 status, heNB_SetParameterValuesResponse)
             # Set the plmnid
             webcontrol.Parameter_List_PLMN(
                 config_element.get("PLMN", "plmnid_checkbox"),
                 config_element.get("PLMN", "plmnid_value"), merge_plmn)
             webcontrol.ACS_Initiate_Connection()
             webcontrol.HeNS_Request_Message_PLMN(merge_plmn,
                                                  heMS_SetParameterValues)
             webcontrol.HeNB_Response_Message(
                 status, heNB_SetParameterValuesResponse)
             # Set the boolean to true
             webcontrol.Parameter_List_PLMN(
                 config_element.get("PLMN", "enable_checkbox"),
                 config_element.get("PLMN", "enable_value"),
                 str(int(status) + 1))
             webcontrol.ACS_Initiate_Connection()
             webcontrol.HeNS_Request_Message_PLMN(str(int(status) + 1),
                                                  heMS_SetParameterValues)
             webcontrol.HeNB_Response_Message(
                 status, heNB_SetParameterValuesResponse)
             webcontrol.Security_Logout()
             time.sleep(1)
             webcontrol.Exit()
             tc = Uiautomator_Control()
             tc.Switch_Home()
             # Reboot the cell
             rs232 = RS232_Putty()
             rs232.RS232_Connect_Putty()
             time.sleep(2)
             ssh = SSH()
             ssh.SSH_Command('./rsys/scripts/reboot-fap')
             time.sleep(150)
             rs232.RS232_Verify_Message_Putty('Time :')
             # Close the airplane mode
             adbClient.Stop_Airplane()
             # Make sure the cell is launched or not by *#0011#
             tc.Switch_Home()
             tc.Switch_Setting_Note4()
             tc.Switch_More_networks()
             tc.Switch_Mobile_networks()
             tc.Switch_Network_Operators()
             tc.Information_Alert()
             tc.Click_Device_Value1('note4')
             tc.Information_Alert()
             time.sleep(10)
             tc.Switch_Home()
             tc.CellMapper()
             tc.ServiceMode_Verify_PLMN(cellmapper_plmn)
             merge_plmn = "12301"
             cellmapper_plmn = "123-01"
     print '\nThe Cycle time is : ' + config_setting.get(
         "cycle_times", "times") + ' times.\nFinished.'
Example #2
0
 def test_Earfcn(self):
     android = Android()
     android.Check_Mobile_Note4()
     rs232 = RS232_Putty()
     rs232.RS232_Connect_Putty()
     heMS_SetParameterValues = config_element.get(
         "location", "heMS_SetParameterValues")
     print 'Earfcn\'s testcase...'
     for cycle_times in range(
             int(config_setting.get("cycle_times", "times"))):
         print 'The Cycle times : ' + str(cycle_times + 1)
         earfcn = config_setting.get("setting", "earfcn")
         frequency = config.get("cellmapper_setting", "frequency")
         # Click the EarfcnDL and EarfcnFL via RF folder
         for runtime in range(int(config.get("earfcn_setting", "times"))):
             os.system("taskkill /F /IM iexplore.exe")
             print 'The Run Times : ' + str(runtime + 1)
             print 'Earfcn of ACS : ' + earfcn + ' Frequence of mobile : ' + frequency
             # Open the airplane mode
             adbClient = AdbClient()
             adbClient.Start_Airplane()
             # Open the acs website homepage
             webcontrol = Webcontrol()
             webcontrol.Initial()
             webcontrol.Login()
             webcontrol.Clear_All_Data(
                 config_element.get("system", "system_message_queue"),
                 config_element.get("delete_file",
                                    "delete_all_message_queue_button"),
                 "Delete Message successfully!")
             webcontrol.Parameter_List_Earfcn(earfcn)
             webcontrol.ACS_Initiate_Connection()
             webcontrol.HeNS_Request_Message_Earfcn(
                 earfcn, heMS_SetParameterValues)
             webcontrol.Security_Logout()
             time.sleep(1)
             webcontrol.Exit()
             tc = Uiautomator_Control()
             tc.Switch_Home()
             # Reboot the cell
             rs232 = RS232_Putty()
             rs232.RS232_Connect_Putty()
             time.sleep(2)
             ssh = SSH()
             ssh.SSH_Command('./rsys/scripts/reboot-fap')
             time.sleep(150)
             rs232.RS232_Verify_Message_Putty('Time :')
             # Close the airplane mode
             adbClient.Stop_Airplane()
             # Make sure the cell is launched or not by *#0011#
             tc.Switch_Home()
             tc.Switch_Setting_Note4()
             tc.Switch_More_networks()
             tc.Switch_Mobile_networks()
             tc.Switch_Network_Operators()
             tc.Information_Alert()
             tc.Click_Device_Value1('note4')
             tc.Information_Alert()
             time.sleep(10)
             tc.Switch_Home()
             tc.CellMapper()
             tc.ServiceMode(frequency)
             earfcn = "38750"
             frequency = "38750"
     print '\nThe Cycle time is : ' + config_setting.get(
         "cycle_times", "times") + ' times.\nFinished.'