Chetan Gaonker | c1a4c8a | 2017-04-13 00:24:44 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright 2016-present Ciena Corporation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | import unittest |
| 17 | import os,sys |
| 18 | import keystoneclient.v2_0.client as ksclient |
| 19 | import keystoneclient.apiclient.exceptions |
| 20 | import neutronclient.v2_0.client as nclient |
| 21 | import neutronclient.common.exceptions |
| 22 | from novaclient import client as nova_client |
| 23 | from neutronclient.v2_0 import client as neutron_client |
| 24 | import neutronclient.v2_0.client as neutronclient |
| 25 | from nose.tools import assert_equal |
| 26 | from CordTestUtils import get_mac, log_test |
| 27 | from OnosCtrl import OnosCtrl |
| 28 | from OnosFlowCtrl import OnosFlowCtrl |
| 29 | from credentials import * |
| 30 | from OnboardingServiceUtils import OnboardingServiceUtils |
| 31 | from SSHTestAgent import SSHTestAgent |
| 32 | import requests |
| 33 | import time |
| 34 | import json |
| 35 | |
| 36 | class onboarding_exchange(): |
| 37 | |
| 38 | @classmethod |
| 39 | def setUpClass(cls): |
| 40 | OnboardingServiceUtils.setUp() |
| 41 | |
| 42 | @classmethod |
| 43 | def tearDownClass(cls): |
| 44 | OnboardingServiceUtils.tearDown() |
| 45 | |
| 46 | def cliEnter(self, controller = None): |
| 47 | retries = 0 |
| 48 | while retries < 30: |
| 49 | self.cli = OnosCliDriver(controller = controller, connect = True) |
| 50 | if self.cli.handle: |
| 51 | break |
| 52 | else: |
| 53 | retries += 1 |
| 54 | time.sleep(2) |
| 55 | |
| 56 | def cliExit(self): |
| 57 | self.cli.disconnect() |
| 58 | |
| 59 | def onos_shutdown(self, controller = None): |
| 60 | status = True |
| 61 | self.cliEnter(controller = controller) |
| 62 | try: |
| 63 | self.cli.shutdown(timeout = 10) |
| 64 | except: |
| 65 | log.info('Graceful shutdown of ONOS failed for controller: %s' %controller) |
| 66 | status = False |
| 67 | |
| 68 | self.cliExit() |
| 69 | return status |
| 70 | |
| 71 | def test_exampleservice_health(self): |
| 72 | """ |
| 73 | Algo: |
| 74 | 1. Login to compute node VM |
| 75 | 2. Get all exampleservice |
| 76 | 3. Ping to all exampleservice |
| 77 | 4. Verifying Ping success |
| 78 | """ |
| 79 | status = OnboardingServiceUtils.health_check() |
| 80 | assert_equal(status, True) |
| 81 | |
| 82 | def test_exampleservice_onboarding(self): |
| 83 | pass |
| 84 | |
| 85 | def test_exampleservice_connectivity(self): |
| 86 | pass |
| 87 | |
| 88 | def test_exampleservice_for_apache_service(self): |
| 89 | pass |
| 90 | |
| 91 | def test_exampleservice_using__curl(self): |
| 92 | pass |