def runIOCmanual(): sshh = pexpect.spawn('ssh root@%s' % IP) fd = open("/dev/null", "w") sshh.logfile = fd#sys.stdout try: i = sshh.expect(['password:'******'continue connecting (yes/no)?']) if i == 0 : sshh.sendline(PASSWORD) elif i == 1: sshh.sendline('yes') sshh.expect('password:'******'-bash-') sshh.sendline('cd /opt/epics/iocTest/iocBoot/iocTest/') sshh.expect('-bash-') sshh.sendline('../../bin/linux-f3rp61/Test st.cmd') Log = log("manualTestCom_Report.txt") commandTestCases(sshh, Log) Log.report() Log.close() print "Finished testing iocsh commands - proceed with the test in the other terminal." #sshh.interact() time.sleep(3) ans = 'e' while ans != 'exit': ans = raw_input("Type 'exit' when the test in the other terminal has finished : ") sshh.close() except pexpect.EOF: print("error") sshh.close()
status = self.pv_biSysCtl_REG.read("STRING") #ans = raw_input("Enter status of system register (OK/ALARM): ") ans = raw_input("Enter status of battery LED (ON/OFF): ") # To match status register enums if ans == 'ON': ans = 'ALARM' if ans == 'OFF': ans = 'OK' log_.assert_ (ans, status)#, 'Entered status does not match read status.') #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ if __name__ == '__main__': log = log("manualTest_Report.txt") # Write timestamp to log start = datetime.datetime.now() log("--------------------------------------------------") log("Manual Test started on " + start.strftime("%Y-%m-%d %H:%M:%S")) log("--------------------------------------------------\n") # start the test manualTest = manualTest() # Add new test cases to this list in order for them to be run Test_Cases = [manualTest.test_TC_01, manualTest.test_TC_02, manualTest.test_TC_03,\ manualTest.test_TC_04, manualTest.test_TC_05] # Run each test case for case in Test_Cases: manualTest.setup_method()