[RICPLT-2787] Complete automation tests for US
[ric-plt/e2mgr.git] / Automation / Tests / Scripts / cleanup_db.py
index 49ebca5..02c5f8f 100644 (file)
 #   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())) + ",\"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