Changeset 11215

Show
Ignore:
Timestamp:
07/06/10 08:44:50 (2 months ago)
Author:
amir.fadlon
Message:

First version of scapy with first test that is working from start to end.

Location:
jsystemFramework/trunk/systemObjects/core/scriptingLanguages
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • jsystemFramework/trunk/systemObjects/core/scriptingLanguages/.classpath

    r10664 r11215  
    1111        <classpathentry kind="lib" path="/runner/thirdparty/commonLib/qdox.jar"/> 
    1212        <classpathentry kind="lib" path="/runner/thirdparty/commonLib/mail-1.4.1.jar"/> 
     13        <classpathentry kind="lib" path="/runner/lib/stations.jar" sourcepath="/runner/lib/stations_src.zip"/> 
    1314        <classpathentry kind="output" path="classes"/> 
    1415</classpath> 
  • jsystemFramework/trunk/systemObjects/core/scriptingLanguages/src/jsystem/sysobj/scripting/python/PyShell.java

    r11210 r11215  
    11package jsystem.sysobj.scripting.python; 
    22 
    3 import jsystem.extensions.analyzers.text.TextNotFound; 
    43import jsystem.framework.system.SystemObjectImpl; 
    54import systemobject.terminal.Prompt; 
     
    98import com.aqua.sysobj.conn.CliApplication; 
    109import com.aqua.sysobj.conn.CliCommand; 
    11 import com.aqua.sysobj.conn.CliFactory; 
     10import com.aqua.sysobj.conn.CliConnection; 
    1211 
    1312public class PyShell extends SystemObjectImpl { 
     
    1514        private StationDefaultImpl station; 
    1615        private CliApplication cliApplication; 
     16        private CliConnection cliConnection; 
    1717 
    18         private String host; 
    19         private int port; 
     18        private String worstation; 
     19        private String os; 
    2020        private String user; 
    2121        private String password; 
     22 
     23        private StringBuffer logFileS = null; 
    2224         
    2325        public void init() throws Exception { 
     
    3133                pyPrompts[0].setCommandEnd(true); 
    3234 
    33                 station = StationsFactory.createStation(getHost(), CliFactory.OPERATING_SYSTEM_WINDOWS, "telnet", getUser(), getPassword(), null); 
     35                 
     36                station = StationsFactory.createStation(getWorstation(), getOs(), "telnet", getUser(), getPassword(), null); 
    3437                station.init(); 
    3538                cliApplication = station.getCliSession(false); 
     39                cliConnection = cliApplication.getConnectivityManager().getCli(); 
     40                 
     41                logFileS = new StringBuffer(); 
    3642                 
    3743        } 
    3844         
     45        @Override 
     46        public void close() { 
     47                station.close(); 
     48                super.close(); 
     49        } 
     50         
    3951        public void handleCliCommand(String command) throws Exception { 
    40                 cliApplication.handleCliCommand(command, new CliCommand(command)); 
    41                 cliApplication.analyze(new TextNotFound("Error")); 
     52                logFileS.append(command + "\r"); 
     53                CliCommand cmd = new CliCommand(command); 
     54                cmd.addErrors("Error"); 
     55                cliConnection.handleCliCommand(command, cmd); 
    4256        } 
    4357 
    44         public void handleCliCommandWithoutWait(String title, String command) throws Exception { 
    45 //              report.startLevel(title, Reporter.CurrentPlace); 
    46 //              telnet.WriteLine(command); 
    47 //              Thread.sleep(200); 
    48 //              String result = telnet.Read(""); 
    49 //              setTestAgainstObject(result); 
    50 //              report.stopLevel(); 
     58        public void handleCliCommandWithoutWait(String command) throws Exception { 
     59                logFileS.append(command + "\n\r"); 
     60                cliConnection.sendString(command, false); 
    5161        } 
    5262         
     
    6777        } 
    6878 
    69         public String getHost() { 
    70                 return host; 
     79        public String getWorstation() { 
     80                return worstation; 
    7181        } 
    7282 
    73         public void setHost(String host) { 
    74                 this.host = host; 
     83        public void setWorstation(String worstation) { 
     84                this.worstation = worstation; 
    7585        } 
    7686 
    77         public int getPort() { 
    78                 return port; 
     87        public String getOs() { 
     88                return os; 
    7989        } 
    8090 
    81         public void setPort(int port) { 
    82                 this.port = port; 
     91        public void setOs(String os) { 
     92                this.os = os; 
    8393        } 
    84          
    85          
     94 
     95        public StringBuffer getLogFileS() { 
     96                return logFileS; 
     97        } 
     98                 
    8699}