Commit ba21f7a4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 78dc81c7
......@@ -49,8 +49,8 @@ class TestCheckLopcommLOFSuccess(TestPromisePluginMixin):
def test_promise_success(self):
with open(self.netconf_log, 'w+') as f:
f.write("""{"time": "%s", "log_level": "INFO", "message": "", "data": {'notification': {'@xmlns': 'urn:ietf:params:xml:ns:netconf:notification:1.0', 'eventTime': '1970-01-05T00:38:50Z', 'alarm-notif': {'@xmlns': 'urn:o-ran:fm:1.0', 'fault-id': '102', 'fault-source': 'Radio Module', 'affected-objects': {'name': 'Radio Module'}, 'fault-severity': 'CRITICAL', 'is-cleared': 'false', 'fault-text': 'LOF Alarm', 'event-time': '1970-01-05T00:38:50Z'}}}}
{"time": "%s", "log_level": "INFO", "message": "", "data": {'notification': {'@xmlns': 'urn:ietf:params:xml:ns:netconf:notification:1.0', 'eventTime': '1970-01-05T00:38:50Z', 'alarm-notif': {'@xmlns': 'urn:o-ran:fm:1.0', 'fault-id': '102', 'fault-source': 'Radio Module', 'affected-objects': {'name': 'Radio Module'}, 'fault-severity': 'CRITICAL', 'is-cleared': 'true', 'fault-text': 'LOF Alarm', 'event-time': '1970-01-05T00:38:50Z'}}}}""" % (
f.write("""{"time": "%s", "log_level": "INFO", "message": "", "data": {"notification": {"@xmlns": "urn:ietf:params:xml:ns:netconf:notification:1.0", "eventTime": "1970-01-05T00:38:50Z", "alarm-notif": {"@xmlns": "urn:o-ran:fm:1.0", "fault-id": "102", "fault-source": "Radio Module", "affected-objects": {"name": "Radio Module"}, "fault-severity": "CRITICAL", "is-cleared": "false", "fault-text": "LOF Alarm", "event-time": "1970-01-05T00:38:50Z"}}}}
{"time": "%s", "log_level": "INFO", "message": "", "data": {"notification": {"@xmlns": "urn:ietf:params:xml:ns:netconf:notification:1.0", "eventTime": "1970-01-05T00:38:50Z", "alarm-notif": {"@xmlns": "urn:o-ran:fm:1.0", "fault-id": "102", "fault-source": "Radio Module", "affected-objects": {"name": "Radio Module"}, "fault-severity": "CRITICAL", "is-cleared": "true", "fault-text": "LOF Alarm", "event-time": "1970-01-05T00:38:50Z"}}}}""" % (
(datetime.now() - timedelta(seconds=25)).strftime("%Y-%m-%d %H:%M:%S,%f")[:-3],
(datetime.now() - timedelta(seconds=15)).strftime("%Y-%m-%d %H:%M:%S,%f")[:-3],
))
......@@ -62,8 +62,8 @@ class TestCheckLopcommLOFSuccess(TestPromisePluginMixin):
def test_promise_fail(self):
with open(self.netconf_log, 'w+') as f:
f.write("""{"time": "%s", "log_level": "INFO", "message": "", "data": {'notification': {'@xmlns': 'urn:ietf:params:xml:ns:netconf:notification:1.0', 'eventTime': '1970-01-05T00:38:50Z', 'alarm-notif': {'@xmlns': 'urn:o-ran:fm:1.0', 'fault-id': '102', 'fault-source': 'Radio Module', 'affected-objects': {'name': 'Radio Module'}, 'fault-severity': 'CRITICAL', 'is-cleared': 'true', 'fault-text': 'LOF Alarm', 'event-time': '1970-01-05T00:38:50Z'}}}}
{"time": "%s", "log_level": "INFO", "message": "", "data": {'notification': {'@xmlns': 'urn:ietf:params:xml:ns:netconf:notification:1.0', 'eventTime': '1970-01-05T00:38:50Z', 'alarm-notif': {'@xmlns': 'urn:o-ran:fm:1.0', 'fault-id': '102', 'fault-source': 'Radio Module', 'affected-objects': {'name': 'Radio Module'}, 'fault-severity': 'CRITICAL', 'is-cleared': 'false', 'fault-text': 'LOF Alarm', 'event-time': '1970-01-05T00:38:50Z'}}}}""" % (
f.write("""{"time": "%s", "log_level": "INFO", "message": "", "data": {"notification": {"@xmlns": "urn:ietf:params:xml:ns:netconf:notification:1.0", "eventTime": "1970-01-05T00:38:50Z", "alarm-notif": {"@xmlns": "urn:o-ran:fm:1.0", "fault-id": "102", "fault-source": "Radio Module", "affected-objects": {"name": "Radio Module"}, "fault-severity": "CRITICAL", "is-cleared": "true", "fault-text": "LOF Alarm", "event-time": "1970-01-05T00:38:50Z"}}}}
{"time": "%s", "log_level": "INFO", "message": "", "data": {"notification": {"@xmlns": "urn:ietf:params:xml:ns:netconf:notification:1.0", "eventTime": "1970-01-05T00:38:50Z", "alarm-notif": {"@xmlns": "urn:o-ran:fm:1.0", "fault-id": "102", "fault-source": "Radio Module", "affected-objects": {"name": "Radio Module"}, "fault-severity": "CRITICAL", "is-cleared": "false", "fault-text": "LOF Alarm", "event-time": "1970-01-05T00:38:50Z"}}}}""" % (
(datetime.now() - timedelta(seconds=25)).strftime("%Y-%m-%d %H:%M:%S,%f")[:-3],
(datetime.now() - timedelta(seconds=15)).strftime("%Y-%m-%d %H:%M:%S,%f")[:-3],
))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment