def cpeipToEnbip(self, cpeip): xmldata = cf.Parsing_XML() uedata = xmldata.get_ue_data(xmlname) enbdata = xmldata.get_enb_data(xmlname) for k in uedata.keys(): if uedata[k]['cpeip'] == cpeip: return enbdata[k]['enbip']
def getSendingmsg(self, ueid): xmldata = cf.Parsing_XML() self.sendlist = [] for ue in ueid: s = xmldata.Operation(ue, 'BOTH') self.sendlist.append(s) return self.sendlist
def getparam(self): xmldata = cf.Parsing_XML() enb_ip = xmldata.get_enb_data(xmlname) confi = {} #界面可配IP if str(self.lineEdit_1.text())!= '': confi[str(self.lineEdit_1.text())] = [enb_ip["001"]["earfcn"], enb_ip["001"]["pci"], enb_ip["001"]["mme"], enb_ip["001"]["plmn"], enb_ip["001"]["segw"], enb_ip["001"]["psk"]] if str(self.lineEdit_2.text())!= '': confi[str(self.lineEdit_2.text())] = [enb_ip["002"]["earfcn"], enb_ip["002"]["pci"], enb_ip["002"]["mme"], enb_ip["002"]["plmn"], enb_ip["002"]["segw"], enb_ip["002"]["psk"]] if str(self.lineEdit_3.text())!= '': confi[str(self.lineEdit_3.text())] = [enb_ip["003"]["earfcn"], enb_ip["003"]["pci"], enb_ip["003"]["mme"], enb_ip["003"]["plmn"], enb_ip["003"]["segw"], enb_ip["003"]["psk"]] if str(self.lineEdit_4.text())!= '': confi[str(self.lineEdit_4.text())] = [enb_ip["004"]["earfcn"], enb_ip["004"]["pci"], enb_ip["004"]["mme"], enb_ip["004"]["plmn"], enb_ip["004"]["segw"], enb_ip["004"]["psk"]] if str(self.lineEdit_5.text())!= '': confi[str(self.lineEdit_5.text())] = [enb_ip["005"]["earfcn"], enb_ip["005"]["pci"], enb_ip["005"]["mme"], enb_ip["005"]["plmn"], enb_ip["005"]["segw"], enb_ip["005"]["psk"]] if str(self.lineEdit_6.text())!= '': confi[str(self.lineEdit_6.text())] = [enb_ip["006"]["earfcn"], enb_ip["006"]["pci"], enb_ip["006"]["mme"], enb_ip["006"]["plmn"], enb_ip["006"]["segw"], enb_ip["006"]["psk"]] if str(self.lineEdit_7.text())!= '': confi[str(self.lineEdit_7.text())] = [enb_ip["007"]["earfcn"], enb_ip["007"]["pci"], enb_ip["007"]["mme"], enb_ip["007"]["plmn"], enb_ip["007"]["segw"], enb_ip["007"]["psk"]] if str(self.lineEdit_8.text())!= '': confi[str(self.lineEdit_8.text())] = [enb_ip["008"]["earfcn"], enb_ip["008"]["pci"], enb_ip["008"]["mme"], enb_ip["008"]["plmn"], enb_ip["008"]["segw"], enb_ip["008"]["psk"]] return confi
def IpEdit(self): xmldata = cf.Parsing_XML() enb_ip = xmldata.get_enb_data(xmlname) numlist = xmldata.get_num(xmlname) for num in numlist: ip = enb_ip[num]["enbip"] if num == "001": self.lineEdit_1.setText(ip) if num == "002": self.lineEdit_2.setText(ip) if num == "003": self.lineEdit_3.setText(ip) if num == "004": self.lineEdit_4.setText(ip) if num == "005": self.lineEdit_5.setText(ip) if num == "006": self.lineEdit_6.setText(ip) if num == "007": self.lineEdit_7.setText(ip) if num == "008": self.lineEdit_8.setText(ip)
#!/usr/bin/env python #coding=utf-8 import paramiko import subprocess import time import config import re Timeout = int(config.Parsing_XML().getTimeout("args.xml")) class FactoryTest: client = None session = None isrecovery = False ischeckgps = False def doRecovery(self, enbip, q): result = self.operation_recovery(enbip) if result: q.put('%sRecovery Success' % enbip) else: q.put('%sRecovery Fail' % enbip) def operation_recovery(self, enbip): if not self.recoverdata(enbip): self.usage('eNB %s recovery fails.' % enbip, 6) return False print self.timeinfo( ), 'eNB %s data recovery done, rebooting now, wait for ~3 minutes.' % enbip if not self.accessible(enbip, 600): #10 minutes
def getsocketip(self): xmldata = cf.Parsing_XML() self.socketip = xmldata.getcontrolpc() return self.socketip