Add tests for ODL log configuration
[integration/packaging/ansible-opendaylight.git] / tests / test-odl-logs.yaml
1 ---
2
3 - hosts: localhost
4   gather_facts: False
5   vars_files:
6     - vars.yaml
7   tasks:
8     - name: get log levels
9       command: /opt/opendaylight/bin/client log:get
10       register: log_levels
11
12     # These tests assume that the log level has already
13     # been set to DEBUG. This is done by over-riding the
14     # required variable while executing the installation
15     # through Jenkins Job
16     - name: assert ROOT log level set to DEBUG
17       assert:
18         that:
19           - "'ROOT                                │ DEBUG' in log_levels.stdout"
20
21     - name: save the logs
22       command: /opt/opendaylight/bin/client 'log:display -n 10'
23       register: odl_logs
24
25     - name: assert log level is DEBUG
26       assert:
27         that:
28           - "'DEBUG' in odl_logs.stdout"