import config
import redis
import cleanup_db
+import json
def getRedisClientDecodeResponse():
return redis.Redis(host=c, port=p, db=0, decode_responses=True)
+def set_general_config_resource_status_false():
-def verify_rsm_ran_info():
+ r = getRedisClientDecodeResponse()
+ r.set("{rsm},CFG:GENERAL:v1.0.0" , "{\"enableResourceStatus\":false,\"partialSuccessAllowed\":true,\"prbPeriodic\":true,\"tnlLoadIndPeriodic\":true,\"wwLoadIndPeriodic\":true,\"absStatusPeriodic\":true,\"rsrpMeasurementPeriodic\":true,\"csiPeriodic\":true,\"periodicityMs\":1,\"periodicityRsrpMeasurementMs\":3,\"periodicityCsiMs\":3}")
+
+def verify_rsm_ran_info_start_false():
r = getRedisClientDecodeResponse()
if r.get("{rsm},RAN:test1") == value:
return True
+ else:
+ return False
+
+
+def verify_rsm_ran_info_start_true():
+
+ r = getRedisClientDecodeResponse()
+
+ rsmInfoStr = r.get("{rsm},RAN:test1")
+ rsmInfoJson = json.loads(rsmInfoStr)
+
+ response = rsmInfoJson["ranName"] == "test1" and rsmInfoJson["enb1MeasurementId"] == 1 and rsmInfoJson["enb2MeasurementId"] != 1 and rsmInfoJson["action"] == "start" and rsmInfoJson["actionStatus"] == True
+
+ return response
+
+
+def verify_rsm_ran_info_stop_false():
+
+ r = getRedisClientDecodeResponse()
+
+ rsmInfoStr = r.get("{rsm},RAN:test1")
+ rsmInfoJson = json.loads(rsmInfoStr)
+
+ response = rsmInfoJson["ranName"] == "test1" and rsmInfoJson["enb1MeasurementId"] == 1 and rsmInfoJson["action"] == "stop" and rsmInfoJson["actionStatus"] == False
+
+ return response
+
+
+def verify_rsm_ran_info_stop_true():
+
+ r = getRedisClientDecodeResponse()
+
+ rsmInfoStr = r.get("{rsm},RAN:test1")
+ rsmInfoJson = json.loads(rsmInfoStr)
+
+ response = rsmInfoJson["ranName"] == "test1" and rsmInfoJson["action"] == "stop" and rsmInfoJson["actionStatus"] == True
+
+ return response
+
+def verify_general_config_enable_resource_status_true():
+
+ r = getRedisClientDecodeResponse()
+
+ configStr = r.get("{rsm},CFG:GENERAL:v1.0.0")
+ configJson = json.loads(configStr)
+
+ if configJson["enableResourceStatus"] == True:
+ return True
+ else:
+ return False
+
+def verify_general_config_enable_resource_status_false():
+
+ r = getRedisClientDecodeResponse()
+
+ configStr = r.get("{rsm},CFG:GENERAL:v1.0.0")
+ configJson = json.loads(configStr)
+
+ if configJson["enableResourceStatus"] == False:
+ return True
else:
return False
\ No newline at end of file