diff options
author | Eddie Arrage <eddie.arrage@huawei.com> | 2018-04-24 23:48:09 +0000 |
---|---|---|
committer | Eddie Arrage <eddie.arrage@huawei.com> | 2018-04-24 23:49:49 +0000 |
commit | 0ce5bc7e3df6f021f2c103de5777f655161388ab (patch) | |
tree | dda69e3f3f229325db02aaf07e3999b54db3dc01 /clover | |
parent | 8d8abe26ba133345213b4afaca729659ad81c385 (diff) |
Modified validation script for tracing to support CI
- Manual cherry pick to stable/fraser of patch:
https://gerrit.opnfv.org/gerrit/#/c/55387/
Change-Id: I965326b30b2f6266f147de77c4064833856aa186
Signed-off-by: Eddie Arrage <eddie.arrage@huawei.com>
Diffstat (limited to 'clover')
-rw-r--r-- | clover/tracing/tracing.py | 2 | ||||
-rw-r--r-- | clover/tracing/validate.py | 38 |
2 files changed, 29 insertions, 11 deletions
diff --git a/clover/tracing/tracing.py b/clover/tracing/tracing.py index 16b952c..f646268 100644 --- a/clover/tracing/tracing.py +++ b/clover/tracing/tracing.py @@ -10,7 +10,7 @@ import time import redis TRACING_IP = "localhost" -TRACING_PORT = "30888" +TRACING_PORT = "16686" class Tracing: diff --git a/clover/tracing/validate.py b/clover/tracing/validate.py index 9cbfdd0..e1f810f 100644 --- a/clover/tracing/validate.py +++ b/clover/tracing/validate.py @@ -6,12 +6,10 @@ # http://www.apache.org/licenses/LICENSE-2.0 from kubernetes import client, config +import argparse from clover.tracing.tracing import Tracing -JAEGER_IP = "localhost" -# JAEGER_IP = "1.1.1.1" -JAEGER_PORT = "30888" JAEGER_DEPLOYMENT = "jaeger-deployment" ISTIO_NAMESPACE = "istio-system" ISTIO_SERVICES = ["istio-ingress", "istio-mixer"] @@ -36,10 +34,12 @@ def validateDeploy(): validate = True return validate -# Services in Jaeger will only be present when traffic passes through Istio -# Requires a deployment in Istio service mesh with some traffic targeting nodes -def validateServices(): - t = Tracing(JAEGER_IP, JAEGER_PORT) + +# Services in Jaeger will only be present when traffic targets istio-ingress +# Even a failed HTTP GET request to istio-ingress will add istio-ingress and +# istio-mixer services +def validateServices(args): + t = Tracing(args['ip'], args['port']) services = t.getServices() validate = True if services: @@ -47,14 +47,20 @@ def validateServices(): if s in services: print("Service in tracing: {} present".format(s)) else: + print("Service in tracing: {} not present".format(s)) validate = False else: validate = False return validate -def main(): - if validateDeploy() and validateServices(): +def main(args): + vdeploy = validateDeploy() + if args['s']: + vservice = validateServices(args) + else: + vservice = True + if vdeploy and vservice: print"Jaeger tracing validation has passed" return True else: @@ -63,4 +69,16 @@ def main(): if __name__ == '__main__': - main() + parser = argparse.ArgumentParser() + parser.add_argument( + '-s', action='store_true', + help='Validate istio services, \ + which requires at least one http request to istio-ingress') + parser.add_argument( + '-ip', default='localhost', + help='IP address to access Jaeger') + parser.add_argument( + '-port', default='16686', + help='Port to acccess Jaeger') + args = parser.parse_args() + main(vars(args)) |