def checkFile(self): session = Session( self.hostName, self.userName, self.password, self.rootUser, self.rootPasswd, "telnet", "ServerCheckFileBeforeCalling.log", ) session.logfile = sys.stdout print "***Got the billing before call*** [2/5]" try: session.waitUntil(self.timeout, "login:"******"Password:"******"cdma184%") session.sendLine("cd " + self.fileDirectory + ";" + "ls -l" + "\n\r") session.waitUntil(self.timeout, "cdma184%") print "\033[1;32;40m***Got the billing before call Success*** [OK]\033[0m" return 0 except exception.TimeOutError, e: print "Timeout" return 1
def checkRTBConfiguration(self): try: print "***Checking Configuration*** [1/5]" session = Session( self.hostName, self.userName, self.password, self.rootUser, self.rootPasswd, "telnet", "checkRTBConfiguration.log", ) session.logfile = sys.stdout session.waitUntil(self.timeout, "login:"******"Password:"******"$") session.sendLine("su -") session.waitUntil(self.timeout, "Password:"******"#") session.sendLine("billmtc") session.waitUntil(self.timeout, "BILLMTC") session.waitUntil(self.timeout, "18 Refresh") session.send("schedule") session.waitUntil(self.timeout, "schedule") session.waitUntil(self.timeout, "18 Refresh") session.send("RTB") session.waitUntil(self.timeout, "RTB") session.waitUntil(self.timeout, "18 Refresh") session.send("Query AMA") session.waitUntil(self.timeout, "18 Refresh") session.waitUntil(self.timeout, "----------------------------------------------------") session.traverse("KeyLog_RTB.log", self.traverseTimeout, "INSV", "SYSB", "OFFL", "ISTB") session.send("CONFRTB") session.waitUntil(self.timeout, "18 Refresh") session.send("Query AMA") session.waitUntil(self.timeout, "18 Refresh") session.waitUntil(self.timeout, "----------------------------------------------------") session.traverse("KeyLog_CONFRTB.log", self.traverseTimeout, "CONFIGURED", "UNCONFIGURED") session.send("") session.send("Quit") session.waitUntil(self.timeout, "18 Refresh") session.send("Quit") session.waitUntil(self.timeout, "18 Refresh") session.send("list") session.waitUntil(self.timeout, "Stream") flag = session.traverse2("KeyLog_SCHEDULE.log", self.traverseTimeout, "('Abort' quits)", "Continue") if flag == 0: print "\033[1;32;40m***Checking configuration Success*** [OK]\033[0m" return 0 else: raise Exception.Fault_Error except exception.TimeOutError, e: print "Timeout" return 1
def calling(self): session = Session(self.hostName, self.userName, self.password, self.rootUser, self.rootPasswd, "telnet", "CoreCalling.log") session.logfile = sys.stdout print "***Calling*** [3/5]" try: session.waitUntil(self.timeout, '>') session.sendLine(self.userName + " " + self.password) session.waitUntil(self.timeout, 'CDMG S3MTXV19DN MS2K Sanity') session.sendLine('mtxcrank cdr 10 10 10') session.waitUntil(self.timeout, 'second') print "\033[1;32;40m***Calling Success*** [OK]\033[0m" return 0 except exception.TimeOutError, e: print "Timeout" return 1
def checkBilling(self): print "***Check file in query*** [4/5]" try: session = Session( self.hostName, self.userName, self.password, self.rootUser, self.rootPasswd, "telnet", "checkBilling.log", ) session.logfile = sys.stdout session.waitUntil(self.timeout, "login:"******"Password:"******"$") session.sendLine("su -") session.waitUntil(self.timeout, "Password:"******"#") session.sendLine("billmtc") session.waitUntil(self.timeout, "BILLMTC") session.waitUntil(self.timeout, "18 Refresh") session.send("FILESYS") session.waitUntil(self.timeout, "18 Refresh") session.send("LISTFILE AMA") session.waitUntil(self.timeout, "RUNNING") session.waitUntil(self.timeout, "O") # session.traverse2("KeyLog_Billing.log", self.traverseTimeout, "Size") print "\033[1;32;40m***Check file in query Success*** [OK]\033[0m" return 0 except exception.TimeOutError, e: print "Timeout" return 1