blob: 039a9b9b24d03def332f5f6c3bb2361cdc0eea79 [file] [log] [blame]
Chetan Gaonkerb8619e52016-04-12 18:03:05 -07001import unittest
2import time
3import os
4import json
5from nose.tools import *
6from onosclidriver import OnosCliDriver
7from OnosCtrl import OnosCtrl
8from scapy.all import *
9
10log.setLevel('INFO')
11
12class routes_exchange(unittest.TestCase):
13
14 @classmethod
15 def setUpClass(cls):
16 cls.cli = OnosCliDriver(connect = True)
17
18 @classmethod
19 def tearDownClass(cls):
20 cls.cli.disconnect()
21
22 def test_route_cli(self):
23 routes = json.loads(self.cli.routes(jsonFormat = True))
24 log.info('Routes: %s' %routes)
25
26 def test_devices_cli(self):
27 devices = json.loads(self.cli.devices(jsonFormat = True))
28 available_devices = filter(lambda d: d['available'], devices)
29 device_ids = [ d['id'] for d in devices ]
30 log.info('Available Devices: %s' %devices)
31 log.info('Device IDS: %s' %device_ids)
32
33 def test_flows_cli(self):
34 flows = json.loads(self.cli.flows(jsonFormat = True))
35 flows = filter(lambda f: f['flows'], flows)
36 log.info('Flows: %s' %flows)