Merge "Improve description of push policy for vFW" into casablanca
[integration.git] / test / vcpe / healthcheck-k8s.py
1 #! /usr/bin/python
2
3 import logging
4 import json
5 from vcpecommon import *
6 import commands
7 import sys
8
9 if len(sys.argv) <2:
10    print('namespace not provided')
11    print('Usage: healthcheck-k8s.py onap')
12    sys.exit()
13
14 namespace=sys.argv[1]
15
16 logging.basicConfig(level=logging.INFO, format='%(message)s')
17 common = VcpeCommon()
18
19 print('Checking vGMUX REST API from SDNC')
20 cmd = 'curl -u admin:admin -X GET http://10.0.101.21:8183/restconf/config/ietf-interfaces:interfaces'
21 ret = commands.getstatusoutput("kubectl -n {0} exec dev-sdnc-sdnc-0 -- bash -c '{1}'".format(namespace,cmd))
22 sz = ret[-1].split('\n')[-1]
23 print('\n')
24 print(sz)
25
26 print('Checking vBRG REST API from SDNC')
27 cmd = 'curl -u admin:admin -X GET http://10.3.0.2:8183/restconf/config/ietf-interfaces:interfaces'
28 ret = commands.getstatusoutput("kubectl -n {0} exec dev-sdnc-sdnc-0 -- bash -c '{1}'".format(namespace,cmd))
29 sz = ret[-1].split('\n')[-1]
30 print('\n')
31 print(sz)
32
33 print('Checking SDNC DB for vBRG MAC address')
34 mac = common.get_brg_mac_from_sdnc()
35 print(mac)
36