aboutsummaryrefslogtreecommitdiffstats
path: root/test/vcpe/healthcheck-k8s.py
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-09-10 13:50:15 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-09-10 13:50:15 +0200
commit4baa51c89bd56894646458273a62bf3b2963b298 (patch)
treebfdbd9d98344dd452f3b9c31d4d5f740b23c36ae /test/vcpe/healthcheck-k8s.py
parent98978513564b1f0fbb25d2d3888b7e603956baa1 (diff)
Update healthcheck-k8s script synopsis in vCPE manual
This reflects changes made in regard of input parameters done in Change-Id: Ib6e2875f351f095bd64acd706a6060e169c54e79 Also contains minor fix for 'namespace' and 'environment' vars usage which are unused otherwise. Change-Id: Ie479400dfa0d61c89a256d4aafb2c2d184f9b935 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com> Issue-ID: INT-1213
Diffstat (limited to 'test/vcpe/healthcheck-k8s.py')
-rwxr-xr-xtest/vcpe/healthcheck-k8s.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/vcpe/healthcheck-k8s.py b/test/vcpe/healthcheck-k8s.py
index d16128510..45832418b 100755
--- a/test/vcpe/healthcheck-k8s.py
+++ b/test/vcpe/healthcheck-k8s.py
@@ -12,7 +12,7 @@ def parse_args():
Parse command line arguments
:return: arguments
"""
- parser = argparse.ArgumentParser(description='Processing arguments for vCPE healthcheck')
+ parser = argparse.ArgumentParser(description='Processing arguments for vCPE healthcheck',formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--namespace', default="onap",
metavar=('<namespace_name>'),
help='Namespace name for existing ONAP deployment')
@@ -30,21 +30,20 @@ environment = args.environment
print('Checking vGMUX REST API from SDNC')
cmd = 'curl -s -u admin:admin -X GET http://10.0.101.21:8183/restconf/config/ietf-interfaces:interfaces'
-ret = commands.getstatusoutput("kubectl -n {0} exec {1}-sdnc-sdnc-0 -- bash -c '{2}'".format(args.namespace, args.environment, cmd))
+ret = commands.getstatusoutput("kubectl -n {0} exec {1}-sdnc-sdnc-0 -- bash -c '{2}'".format(namespace, environment, cmd))
sz = ret[-1].split('\n')[-1]
print(json.dumps(json.loads(sz), indent=4))
print('\n')
print('Checking vBRG REST API from SDNC')
cmd = 'curl -s -u admin:admin -X GET http://10.3.0.2:8183/restconf/config/ietf-interfaces:interfaces'
-ret = commands.getstatusoutput("kubectl -n {0} exec {1}-sdnc-sdnc-0 -- bash -c '{2}'".format(args.namespace, args.environment, cmd))
+ret = commands.getstatusoutput("kubectl -n {0} exec {1}-sdnc-sdnc-0 -- bash -c '{2}'".format(namespace, environment, cmd))
sz = ret[-1].split('\n')[-1]
print(json.dumps(json.loads(sz), indent=4))
print('\n')
print('Checking SDNC DB for vBRG MAC address')
-cmd = "kubectl -n {0} exec {1}-mariadb-galera-mariadb-galera-0 -- mysql -uroot -psecretpassword sdnctl -e 'select * from DHCP_MAP'".format(args.namespace, args.environment)
+cmd = "kubectl -n {0} exec {1}-mariadb-galera-mariadb-galera-0 -- mysql -uroot -psecretpassword sdnctl -e 'select * from DHCP_MAP'".format(namespace, environment)
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
(output, error) = p.communicate()
print(output)
-