admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | ''' |
| 3 | Created on 26-Oct-2012 |
| 4 | |
| 5 | @author: Anil Kumar (anilkumar.s@paxterrasolutions.com) |
| 6 | |
| 7 | TestON is free software: you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation, either version 2 of the License, or |
| 10 | (at your option) any later version. |
| 11 | |
| 12 | TestON is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU General Public License |
| 18 | along with TestON. If not, see <http://www.gnu.org/licenses/>. |
| 19 | |
| 20 | |
| 21 | ''' |
| 22 | import time |
| 23 | import pexpect |
| 24 | import struct, fcntl, os, sys, signal |
| 25 | import sys |
| 26 | sys.path.append("../") |
| 27 | from drivers.common.clidriver import CLI |
| 28 | |
| 29 | class RemoteSysDriver(CLI): |
| 30 | # The common functions for emulator included in emulatordriver |
| 31 | def __init__(self): |
| 32 | super(CLI, self).__init__() |
| 33 | |
| 34 | def connect(self,**connectargs): |
| 35 | for key in connectargs: |
| 36 | vars(self)[key] = connectargs[key] |
| 37 | |
| 38 | self.name = self.options['name'] |
| 39 | |
| 40 | self.handle = super(RemoteSysDriver,self).connect(user_name = self.user_name, ip_address = self.ip_address,port = self.port, pwd = self.pwd) |
| 41 | ''' |
| 42 | if self.handle: |
Jon Hall | f89c855 | 2014-04-02 13:14:06 -0700 | [diff] [blame] | 43 | self.execute(cmd= "\n",prompt= "\$|>|#",timeout= 10) |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 44 | self.execute(cmd= "ssh -l paxterra 10.128.4.1",prompt= "paxterra@10.128.4.1's password:",timeout= 10) |
Jon Hall | f89c855 | 2014-04-02 13:14:06 -0700 | [diff] [blame] | 45 | self.execute(cmd= "\n",prompt= "paxterra@10.128.4.1's password:",timeout= 10) |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 46 | self.execute(cmd = "0nLab_gu3st",prompt = "\$",timeout = 10) |
| 47 | self.execute(cmd = "cd TestON/bin/",prompt = "\$",timeout = 10) |
| 48 | self.execute(cmd = "./cli.py run Assert example 1",prompt = "\$",timeout = 10) |
Jon Hall | f89c855 | 2014-04-02 13:14:06 -0700 | [diff] [blame] | 49 | self.execute(cmd= "\n",prompt= "$",timeout= 10) |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 50 | #self.execute(cmd = "help",prompt = ">",timeout = 10) |
| 51 | |
| 52 | #self.execute(cmd = "~.",prompt= ".*",timeout= 10) |
| 53 | return main.TRUE |
| 54 | ''' |
| 55 | |