blob: b923a20372207afb9a163014843bfc3afa7fb037 [file] [log] [blame]
adminbae64d82013-08-01 10:50:15 -07001#!/usr/bin/env python
kelvin-onlab898a6c62015-01-16 14:13:53 -08002"""
adminbae64d82013-08-01 10:50:15 -07003Created on 12-Feb-2013
Jeremy Ronquillo4d5f1d02017-10-13 20:23:57 +00004Copyright 2013 Open Networking Foundation (ONF)
Jeremy Songsterae01bba2016-07-11 15:39:17 -07005
6Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
7the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
8or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
adminbae64d82013-08-01 10:50:15 -07009
kelvin-onlab898a6c62015-01-16 14:13:53 -080010author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
adminbae64d82013-08-01 10:50:15 -070011
12
13 TestON is free software: you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 2 of the License, or
kelvin-onlab898a6c62015-01-16 14:13:53 -080016 ( at your option ) any later version.
adminbae64d82013-08-01 10:50:15 -070017
18 TestON is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
kelvin-onlab898a6c62015-01-16 14:13:53 -080024 along with TestON. If not, see <http://www.gnu.org/licenses/>.
adminbae64d82013-08-01 10:50:15 -070025
26
27FloodLightCliDriver is the basic driver which will handle the Mininet functions
kelvin-onlab898a6c62015-01-16 14:13:53 -080028"""
adminbae64d82013-08-01 10:50:15 -070029from drivers.common.cli.remotetestbeddriver import RemoteTestBedDriver
30
kelvin-onlab898a6c62015-01-16 14:13:53 -080031class FloodLightCliDriver( RemoteTestBedDriver ):
32
33 """
34 FloodLightCliDriver is the basic driver which will handle the Mininet functions
35 """
36 def __init__( self ):
Devin Limdc78e202017-06-09 18:30:07 -070037 super( FloodLightCliDriver, self ).__init__()
kelvin-onlab898a6c62015-01-16 14:13:53 -080038
39 def connect( self, **connectargs ):
40 for key in connectargs:
41 vars( self )[ key ] = connectargs[ key ]
42
43 self.name = self.options[ 'name' ]
44
45 self.handle = super(
46 FloodLightCliDriver,
47 self ).connect(
48 user_name=self.user_name,
49 ip_address=self.ip_address,
50 port=self.port,
51 pwd=self.pwd )
52 if self.handle:
53 main.log.info( "Connected " + self.name )
Devin Limdc78e202017-06-09 18:30:07 -070054 self.execute( cmd="\r", prompt=self.prompt, timeout=10 )
kelvin-onlab898a6c62015-01-16 14:13:53 -080055 self.execute(
56 cmd="cd /home/openflow/floodlight/",
Devin Limdc78e202017-06-09 18:30:07 -070057 prompt="floodlight" + self.prompt,
kelvin-onlab898a6c62015-01-16 14:13:53 -080058 timeout=3 )
59 self.execute(
60 cmd="java -jar target/floodlight.jar &",
Devin Limdc78e202017-06-09 18:30:07 -070061 prompt=self.prompt,
kelvin-onlab898a6c62015-01-16 14:13:53 -080062 timeout=3 )
Devin Limdc78e202017-06-09 18:30:07 -070063 self.execute( cmd="\r", prompt=self.prompt, timeout=10 )
adminbae64d82013-08-01 10:50:15 -070064 return self.handle
kelvin-onlab898a6c62015-01-16 14:13:53 -080065 else:
adminbae64d82013-08-01 10:50:15 -070066 return main.FALSE