X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=Automation%2FTests%2FScripts%2Fcleanup_db.py;h=5c8db8409227305cbfe7c9880c79282ac539bcd5;hb=refs%2Fchanges%2F32%2F2832%2F1;hp=49ebca55c69a78a63aa08b0bcc995e71aa1ca950;hpb=de19068aaa1f3d2b415cd960106121ceb167aaa9;p=ric-plt%2Fe2mgr.git diff --git a/Automation/Tests/Scripts/cleanup_db.py b/Automation/Tests/Scripts/cleanup_db.py index 49ebca5..5c8db84 100644 --- a/Automation/Tests/Scripts/cleanup_db.py +++ b/Automation/Tests/Scripts/cleanup_db.py @@ -15,8 +15,13 @@ # limitations under the License. # ############################################################################## +# +# This source code is part of the near-RT RIC (RAN Intelligent Controller) +# platform project (RICP). +# import config import redis +import time def flush(): @@ -29,5 +34,25 @@ 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}") + + r.set("{e2Manager},E2TAddresses", "[\"e2t.att.com:38000\"]") + + r.set("{e2Manager},E2TInstance:e2t.att.com:38000", "{\"address\":\"e2t.att.com:38000\",\"associatedRanList\":[],\"keepAliveTimestamp\":" + str(int((time.time()+2) * 1000000000)) + ",\"state\":\"ACTIVE\"}") + + return True + +def flush_and_restore_without_e2t_keys(): + + c = config.redis_ip_address + + p = config.redis_ip_port + + r = redis.Redis(host=c, port=p, db=0) + + 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