blob: ab11f6abe52272cea9df2be68332c845e8bfac03 [file] [log] [blame]
adminbae64d82013-08-01 10:50:15 -07001#!/usr/bin/env python
2'''
3Created 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'''
22import time
23import pexpect
24import struct, fcntl, os, sys, signal
25import sys
26sys.path.append("../")
27from drivers.common.clidriver import CLI
28
29class 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:
43 self.execute(cmd= "\r",prompt= "\$|>|#",timeout= 10)
44 self.execute(cmd= "ssh -l paxterra 10.128.4.1",prompt= "paxterra@10.128.4.1's password:",timeout= 10)
45 self.execute(cmd= "\r",prompt= "paxterra@10.128.4.1's password:",timeout= 10)
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)
49 self.execute(cmd= "\r",prompt= "$",timeout= 10)
50 #self.execute(cmd = "help",prompt = ">",timeout = 10)
51
52 #self.execute(cmd = "~.",prompt= ".*",timeout= 10)
53 return main.TRUE
54 '''
55