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.'
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.'
def test_Adminstate(self): webcontrol = Webcontrol() android = Android() android.Check_Mobile_Nexus() adbClient = AdbClient() cpu = System_Status() uiautomator_control = Uiautomator_Control() rs232 = RS232_Putty() rs232.RS232_Connect_Putty() for cycle_times in range( int(config_setting.get("cycle_times", "times"))): os.system("taskkill /F /IM iexplore.exe") print 'The Cycle times : ' + str(cycle_times + 1) cpu.cpu_percentage() cpu.used_memory() cpu.free_memory() boolean = config_setting.get("setting", "boolean") for runtime in range(int(config.get("adminstate_setting", "times"))): print 'The Run Times : ' + str(runtime + 1) + ', Set value = ' + boolean print 'Adminstate\'s testcase...' status = config_setting.get("setting", "status") heMS_SetParameterValues = config_element.get( "location", "heMS_SetParameterValues") heNB_SetParameterValuesResponse = config_element.get( "location", "heNB_SetParameterValuesResponse") cpu.cpu_percentage() cpu.used_memory() cpu.free_memory() 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!") ###### Cell wait time ###### # wait 30s, until to cell was launched, the device auto connected total used 90s # # wait 15s, until to cell was not launched, the device auto disconnected total used 20s # adbClient.Start_Airplane() webcontrol.Parameter_List_Adminstate(boolean) webcontrol.ACS_Initiate_Connection() webcontrol.HeNS_Request_Message(boolean, heMS_SetParameterValues) webcontrol.HeNB_Response_Message( status, heNB_SetParameterValuesResponse) adbClient.Stop_Airplane() ############################################################### webcontrol.Security_Logout() time.sleep(1) webcontrol.Exit() cpu.cpu_percentage() cpu.used_memory() cpu.free_memory() time.sleep(1) print 'SpeetTest\'s testcase...' os.system( "adb shell am force-stop org.zwanoo.android.speedtest") uiautomator_control.Restart_ADB() android.Check_Mobile_Nexus() uiautomator_control.Switch_Home() uiautomator_control.Switch_Setting() uiautomator_control.Switch_More() uiautomator_control.Switch_Cellular_Networks() uiautomator_control.Switch_Network_Operators() if boolean == "0": uiautomator_control.Click_Device_Value0() if boolean == "1": uiautomator_control.Click_Device_Value1("nexus") uiautomator_control.Switch_Home() uiautomator_control.Restart_ADB() print 'The setting was finished' if boolean == "1": uiautomator_control.SpeedTest_True("Nexus5x_Speed") cpu.cpu_percentage() cpu.used_memory() cpu.free_memory() boolean = "1" rs232.RS232_Disconnect_Putty() print '\nThe Cycle time is : ' + config_setting.get( "cycle_times", "times") + ' times.\nFinished.'