Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Update O-RU Fronthaul Recovery usecase
[nonrtric.git]
/
test
/
usecases
/
oruclosedlooprecovery
/
scriptversion
/
simulators
/
sdnr_simulator.py
diff --git
a/test/usecases/oruclosedlooprecovery/scriptversion/simulators/sdnr_simulator.py
b/test/usecases/oruclosedlooprecovery/scriptversion/simulators/sdnr_simulator.py
index
535c3ee
..
a44c073
100644
(file)
--- a/
test/usecases/oruclosedlooprecovery/scriptversion/simulators/sdnr_simulator.py
+++ b/
test/usecases/oruclosedlooprecovery/scriptversion/simulators/sdnr_simulator.py
@@
-39,7
+39,7
@@
MR_PATH = "/events/unauthenticated.SEC_FAULT_OUTPUT"
# Server info
HOST_IP = "::"
HOST_PORT = 9990
# Server info
HOST_IP = "::"
HOST_PORT = 9990
-APP_URL = "/rests/data/network-topology:network-topology/topology=topology-netconf/node=<string:o_du_id>/yang-ext:mount/o-ran-sc-du-hello-world:network-function/d
u-to-ru-connection=<string:o_ru_id>
"
+APP_URL = "/rests/data/network-topology:network-topology/topology=topology-netconf/node=<string:o_du_id>/yang-ext:mount/o-ran-sc-du-hello-world:network-function/d
istributed-unit-functions=<string:o_du_id2>/radio-resource-management-policy-ratio=rrm-pol-1
"
USERNAME = "admin"
PASSWORD = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"
USERNAME = "admin"
PASSWORD = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"
@@
-88,17
+88,17
@@
linkFailureMessage = {
class AlarmClearThread (threading.Thread):
class AlarmClearThread (threading.Thread):
- def __init__(self, sleep_time, o_
r
u_id):
+ def __init__(self, sleep_time, o_
d
u_id):
threading.Thread.__init__(self)
self.sleep_time = sleep_time
threading.Thread.__init__(self)
self.sleep_time = sleep_time
- self.o_
ru_id = o_r
u_id
+ self.o_
du_id = o_d
u_id
def run(self):
def run(self):
- print(f'Sleeping: {self.sleep_time} before clearing O-DU: {self.o_
r
u_id}')
+ print(f'Sleeping: {self.sleep_time} before clearing O-DU: {self.o_
d
u_id}')
time.sleep(self.sleep_time)
msg_as_json = json.loads(json.dumps(linkFailureMessage))
time.sleep(self.sleep_time)
msg_as_json = json.loads(json.dumps(linkFailureMessage))
- msg_as_json["event"]["commonEventHeader"]["sourceName"] = self.o_
r
u_id
- print("Sedning alarm clear for O-
RU: " + self.o_r
u_id)
+ msg_as_json["event"]["commonEventHeader"]["sourceName"] = self.o_
d
u_id
+ print("Sedning alarm clear for O-
DU: " + self.o_d
u_id)
requests.post(mr_host + ":" + mr_port + MR_PATH, json=msg_as_json);
requests.post(mr_host + ":" + mr_port + MR_PATH, json=msg_as_json);
@@
-118,10
+118,10
@@
def verify_password(username, password):
@app.route(APP_URL,
methods=['PUT'])
@auth.login_required
@app.route(APP_URL,
methods=['PUT'])
@auth.login_required
-def sendrequest(o_du_id, o_
ru_id
):
- print("Got request with O-DU ID: " + o_du_id
+ " and O-RU ID: " + o_ru_id
)
+def sendrequest(o_du_id, o_
du_id2
):
+ print("Got request with O-DU ID: " + o_du_id)
random_time = int(10 * random.random())
random_time = int(10 * random.random())
- alarm_clear_thread = AlarmClearThread(random_time, o_
r
u_id)
+ alarm_clear_thread = AlarmClearThread(random_time, o_
d
u_id)
alarm_clear_thread.start()
return Response(status=200)
alarm_clear_thread.start()
return Response(status=200)