From 2d49cf0ce307ded2be850600f75066a6bbd2c228 Mon Sep 17 00:00:00 2001 From: Amichai Date: Tue, 19 Nov 2019 17:55:20 +0200 Subject: [PATCH] [RICPLT-2734] Update automation to set RSM configuration after db flush Signed-off-by: Amichai Change-Id: Ic03ab7fa2359efdcc14ea41fb6ba8f57eb33ced9 --- Automation/Tests/Scripts/cleanup_db.py | 2 ++ Automation/Tests/Scripts/getnodes.py | 3 ++- Automation/Tests/Scripts/loadscripts.py | 23 ++++++++++------------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Automation/Tests/Scripts/cleanup_db.py b/Automation/Tests/Scripts/cleanup_db.py index 49ebca5..e2507c5 100644 --- a/Automation/Tests/Scripts/cleanup_db.py +++ b/Automation/Tests/Scripts/cleanup_db.py @@ -29,5 +29,7 @@ def flush(): r.flushall() + r.set("{rsm},CFG:GENERAL:v1.0.0" , "{\"enableResourceStatus\":true,\"partialSuccessAllowed\":true,\"prbPeriodic\":true,\"tnlLoadIndPeriodic\":true,\"wwLoadIndPeriodic\":true,\"absStatusPeriodic\":true,\"rsrpMeasurementPeriodic\":true,\"csiPeriodic\":true,\"periodicityMs\":1,\"periodicityRsrpMeasurementMs\":3,\"periodicityCsiMs\":3}") + return True diff --git a/Automation/Tests/Scripts/getnodes.py b/Automation/Tests/Scripts/getnodes.py index e358fed..9b977fb 100644 --- a/Automation/Tests/Scripts/getnodes.py +++ b/Automation/Tests/Scripts/getnodes.py @@ -18,6 +18,7 @@ import config import redis +import cleanup_db def add(): @@ -28,7 +29,7 @@ def add(): r = redis.Redis(host=c, port=p, db=0) - r.flushall() + cleanup_db.flush() r.set("{e2Manager},ENB:02f829:007a80", "\n\x05test1\x12\t10.0.2.15\x18\xc9+ \x01*\x10\n\x0602f829\x12\x06007a800\x01:3\b\x01\x12/\bc\x12\x0f02f829:0007ab50\x1a\x040102\"\x0602f829*\n\n\b\b\x01\x10\x01\x18\x04 \x040\x01") 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 + -- 2.16.6