Modify console log tests 32/76832/9
authorTaseer <taseer94@gmail.com>
Wed, 10 Oct 2018 21:12:12 +0000 (23:12 +0200)
committerDaniel Farrell <dfarrell@redhat.com>
Mon, 15 Oct 2018 23:09:17 +0000 (23:09 +0000)
Log mechanism consist of two types: console and file. This patch
groups together the console type testing and also removes
hardcoded assertion parameters.

JIRA: INTPAK-209
Change-Id: I254216d6f136eafb31407bd080035b596dcc5db5
Signed-off-by: Taseer <taseer94@gmail.com>
tests/test-odl-logs.yaml

index ec570c5e35aec392f26770ce5ec7d06cbe1d8a32..107a681e606a3893e4092b9ddc8feccd5d8b3f01 100644 (file)
     # been set to DEBUG. This is done by over-riding the
     # required variable while executing the installation
     # through Jenkins Job
-    - name: assert ROOT log level set to DEBUG
+    - name: assert ROOT log level set as per requirements
       assert:
         that:
-          - "'ROOT                                │ DEBUG' in log_levels.stdout"
+          - "'ROOT                                │ {{ test_log_level }}'  in log_levels.stdout"
 
-    - name: save the logs
-      command: /opt/opendaylight/bin/client 'log:display -n 10'
-      register: odl_logs
+    - name: assert console logging
+      block:
+      - name: save console logs
+        command: /opt/opendaylight/bin/client 'log:display -n 10'
+        register: odl_logs
 
-    - name: assert log level is DEBUG
-      assert:
-        that:
-          - "'DEBUG' in odl_logs.stdout"
\ No newline at end of file
+      - name: assert log level in log details
+        assert:
+          that:
+            - "'{{test_log_level }}' in odl_logs.stdout"
+      when: test_log_mechanism == 'console'