admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python |
kelvin-onlab | 898a6c6 | 2015-01-16 14:13:53 -0800 | [diff] [blame] | 2 | """ |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 3 | Created on 12-Feb-2013 |
Jeremy Songster | ae01bba | 2016-07-11 15:39:17 -0700 | [diff] [blame] | 4 | Modified 2015 by ON.Lab |
| 5 | |
| 6 | Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 7 | the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 8 | or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg> |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 9 | |
kelvin-onlab | 898a6c6 | 2015-01-16 14:13:53 -0800 | [diff] [blame] | 10 | author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com ) |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 11 | |
| 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-onlab | 898a6c6 | 2015-01-16 14:13:53 -0800 | [diff] [blame] | 16 | ( at your option ) any later version. |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 17 | |
| 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-onlab | 898a6c6 | 2015-01-16 14:13:53 -0800 | [diff] [blame] | 24 | along with TestON. If not, see <http://www.gnu.org/licenses/>. |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 25 | |
| 26 | |
| 27 | FloodLightCliDriver is the basic driver which will handle the Mininet functions |
kelvin-onlab | 898a6c6 | 2015-01-16 14:13:53 -0800 | [diff] [blame] | 28 | """ |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 29 | from drivers.common.cli.remotetestbeddriver import RemoteTestBedDriver |
| 30 | |
kelvin-onlab | 898a6c6 | 2015-01-16 14:13:53 -0800 | [diff] [blame] | 31 | class 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 ) |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 64 | return self.handle |
kelvin-onlab | 898a6c6 | 2015-01-16 14:13:53 -0800 | [diff] [blame] | 65 | else: |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 66 | return main.FALSE |