blob: 4f55a90bac42341954f3e04bb1e965dee28c0b65 [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 Songsterae01bba2016-07-11 15:39:17 -07004Modified 2015 by ON.Lab
5
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 ):
37 super( RemoteTestBedDriver, self ).__init__()
38
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 )
54 self.execute( cmd="\r", prompt="\$", timeout=10 )
55 self.execute(
56 cmd="cd /home/openflow/floodlight/",
57 prompt="floodlight\$",
58 timeout=3 )
59 self.execute(
60 cmd="java -jar target/floodlight.jar &",
61 prompt="\$",
62 timeout=3 )
63 self.execute( cmd="\r", 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