X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=Automation%2FTests%2FScripts%2Floadscripts.py;h=659806a3b4cda320642129f3f7b6d06b3a37e1ff;hb=2d49cf0ce307ded2be850600f75066a6bbd2c228;hp=8615384667cb262f46d740de153411f669595096;hpb=8cdfd6dd0117bd2cec6d596715250dab49ba51dc;p=ric-plt%2Fe2mgr.git diff --git a/Automation/Tests/Scripts/loadscripts.py b/Automation/Tests/Scripts/loadscripts.py index 8615384..659806a 100644 --- a/Automation/Tests/Scripts/loadscripts.py +++ b/Automation/Tests/Scripts/loadscripts.py @@ -20,14 +20,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" @@ -39,11 +43,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") @@ -55,13 +55,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 +