blob: 58667a1cc2469593c64cdc39689da0078a93bff9 [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 Ronquillo23fb2162017-09-15 14:59:57 -07004Copyright 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
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070031
kelvin-onlab898a6c62015-01-16 14:13:53 -080032class FloodLightCliDriver( RemoteTestBedDriver ):
33
34 """
35 FloodLightCliDriver is the basic driver which will handle the Mininet functions
36 """
37 def __init__( self ):
Devin Limdc78e202017-06-09 18:30:07 -070038 super( FloodLightCliDriver, self ).__init__()
kelvin-onlab898a6c62015-01-16 14:13:53 -080039
40 def connect( self, **connectargs ):
41 for key in connectargs:
42 vars( self )[ key ] = connectargs[ key ]
43
44 self.name = self.options[ 'name' ]
45
46 self.handle = super(
47 FloodLightCliDriver,
48 self ).connect(
49 user_name=self.user_name,
50 ip_address=self.ip_address,
51 port=self.port,
52 pwd=self.pwd )
53 if self.handle:
54 main.log.info( "Connected " + self.name )
Devin Limdc78e202017-06-09 18:30:07 -070055 self.execute( cmd="\r", prompt=self.prompt, timeout=10 )
kelvin-onlab898a6c62015-01-16 14:13:53 -080056 self.execute(
57 cmd="cd /home/openflow/floodlight/",
Devin Limdc78e202017-06-09 18:30:07 -070058 prompt="floodlight" + self.prompt,
kelvin-onlab898a6c62015-01-16 14:13:53 -080059 timeout=3 )
60 self.execute(
61 cmd="java -jar target/floodlight.jar &",
Devin Limdc78e202017-06-09 18:30:07 -070062 prompt=self.prompt,
kelvin-onlab898a6c62015-01-16 14:13:53 -080063 timeout=3 )
Devin Limdc78e202017-06-09 18:30:07 -070064 self.execute( cmd="\r", prompt=self.prompt, timeout=10 )
adminbae64d82013-08-01 10:50:15 -070065 return self.handle
kelvin-onlab898a6c62015-01-16 14:13:53 -080066 else:
adminbae64d82013-08-01 10:50:15 -070067 return main.FALSE