blob: ef99ce5363625cee70905466c06a2b5a54e3df61 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
"""Script to Test the AUTO Edge Cloud OpenStack Services."""
# !/usr/bin/python
#
# Copyright (c) 2018 All rights reserved
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#fetch_token
# http://www.apache.org/licenses/LICENSE-2.0
#
# ###########################################################################
# OPNFV AUTO Edge Cloud Script
# **** Scripted by Mohankumar Navaneethan - mnavaneethan@mvista.com ******
# ###########################################################################
# Testcase 1 : Ping OpenStack Endpoints
# Testcase 2 : Creation of Auth-Token
# TestCase 3 : Check OpenStack Active Services
# TestCase 4 : Check OpenStack Nova Service
# TestCase 5 : Check OpenStack Neutron Service
# TestCase 6 : Check OpenStack Glance Service
# TestCase 7 : Check OpenStack Tacker Service.
# ###########################################################################
#
import logging
from AutoOSPlatCheck import OS_env_check
class Env_check:
"""Script to Test AUTO Edge Cloud OpenStack Services."""
logger = logging.getLogger(__name__)
Env_obj = OS_env_check()
print("################################################################")
print(" OPNFV AUTO Script ")
print("################################################################")
logger.info("Prerequisites OpenStack configuration for AUTO")
#########################################################################
logger.info("\t1. Ping OpenStack Endpoints")
if (Env_obj.ping_endpoints == 0):
logger.info("\t\tPing to OpenStack Endpoint is successfull")
else:
logger.error("\t\tPing to OpenStack Endpoint is NOT successfull")
logger.info("\t2. Creation of Auth-Token")
response_code , token = Env_obj.fetch_token()
if (response_code == 201):
logger.info("\t\tCreation of Token is successfull")
else:
logger.error("\t\t : Creation of Token is NOT successfull")
logger.info("\t3. Check OpenStack Active Services")
status, services, endpoint = Env_obj.check_os_running_services()
endpoints = dict(zip(services, endpoint))
if (status == 201):
logger.info("\t\tCheck OpenStack Active Services is successfull")
else:
logger.error("\t\tCheck OpenStack Active Services is NOT successfull")
logger.info("\t4. Check OpenStack Nova Service")
if (Env_obj.check_nova_service(endpoints, token) == 200):
logger.info("\t\tNova service is responsive")
else:
logger.error("\t\tNova service is NOT responsive")
logger.info("\t5. Check OpenStack Neutron Service")
if (Env_obj.check_neutron_service(endpoints, token) == 200):
logger.info("\t\tNeutron service is responsive")
else:
logger.error("\t\tNeutron service is NOT responsive")
logger.info("\t6. Check OpenStack Glance Service")
if (Env_obj.check_glance_service(endpoints, token) == 200):
logger.info("\t\tGlance service is responsive")
else:
logger.error("\t\tGlance service is NOT responsive")
logger.info("\t7. Check OpenStack Tacker Service")
if (Env_obj.check_glance_service(endpoints, token) == 200):
logger.info("\t\tTacker VNF Manager service is responsive")
else:
logger.error("\t\tTacker VNF Manager is NOT responsive")
|