X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=Automation%2FTests%2FScripts%2Floadscripts.py;h=aec4b593f5689737e5cd8d8364cfc5c79d219d8a;hb=ef8e7b290c648ce0655c0fc0e8d0882fe31f2abc;hp=5cc862b5a7916ed4d7a1f4f1281bd3752490cd33;hpb=15d3982b5eda43a5b5b9054d7ecb026448c6ca16;p=ric-plt%2Fe2mgr.git diff --git a/Automation/Tests/Scripts/loadscripts.py b/Automation/Tests/Scripts/loadscripts.py index 5cc862b..aec4b59 100644 --- a/Automation/Tests/Scripts/loadscripts.py +++ b/Automation/Tests/Scripts/loadscripts.py @@ -24,14 +24,18 @@ import redis import config - -def verify_value(): +def getRedisClient(): c = config.redis_ip_address p = config.redis_ip_port - r = redis.Redis(host=c, port=p, db=0) + return redis.Redis(host=c, port=p, db=0) + + +def verify_value(): + + r = getRedisClient() value = "\b\x98\xf7\xdd\xa3\xc7\xb4\x83\xde\x15\x12\x11\n\x0f02f829:0007ab00" @@ -43,11 +47,7 @@ def verify_value(): def add(): - c = config.redis_ip_address - - p = config.redis_ip_port - - r = redis.Redis(host=c, port=p, db=0) + r = getRedisClient() r.set("{e2Manager},LOAD:test1", "\b\x98\xf7\xdd\xa3\xc7\xb4\x83\xde\x15\x12\x11\n\x0f02f829:0007ab00") @@ -59,13 +59,10 @@ def add(): def verify(): - c = config.redis_ip_address - - p = config.redis_ip_port - - r = redis.Redis(host=c, port=p, db=0) + r = getRedisClient() if r.exists("{e2Manager},LOAD:test1"): return True else: return False +