[RICPLT-1898] - Replace http router to gorilla-mux + UT + Automation code
[ric-plt/e2mgr.git] / Automation / Tests / ConfigurationUpdate / verifylogs.py
diff --git a/Automation/Tests/ConfigurationUpdate/verifylogs.py b/Automation/Tests/ConfigurationUpdate/verifylogs.py
new file mode 100755 (executable)
index 0000000..fdfd64a
--- /dev/null
@@ -0,0 +1,47 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+##############################################################################
+
+
+def verify(directory):
+
+    file = 'e2mgr.log'
+
+    path = '/'
+
+    file_path = directory + path + file
+
+    f = open(file_path,'r')
+
+    found_message_10370 = False
+    found_message_10371 = False
+
+    for l in f:
+        if l.find('MType: 10370') > 0 and l.find('Meid: \\"test1\\"') > 0:
+            found_message_10370 = True
+        elif l.find('MType: 10371') > 0 and l.find('Meid: \\"test1\\"') > 0:
+            found_message_10371 = True
+        if found_message_10370 and found_message_10371:
+            break
+
+    if found_message_10370 and found_message_10371:
+        return True
+    else:
+        return False
+
+
+