Resolve ansible-lint test failures

With the merge of https://review.openstack.org/520177 in the
tests repo some ansible-lint failures which previously were
not being picked up are now detected.

This adds the appropriate skip tags to the tasks so that they
are not evaluated by ansible-lint.

Depends-On: I76157ccedfbcb8b0c2cba852bfa6b78ba6981c6c
Change-Id: I9f5c71aa896f25cfece39e080c74f99fb7be57b2
This commit is contained in:
Jesse Pretorius 2017-11-24 11:06:14 +00:00
parent a530bc1225
commit 3e7377b4df
2 changed files with 34 additions and 0 deletions

View File

@ -23,6 +23,9 @@
shell: > shell: >
. /root/openrc && ironic chassis-list . /root/openrc && ironic chassis-list
register: chassis_table register: chassis_table
tags:
- skip_ansible_lint
- name: Check that the chassis-list command succeeded - name: Check that the chassis-list command succeeded
assert: assert:
that: that:
@ -32,6 +35,9 @@
shell: > shell: >
. /root/openrc && ironic node-list . /root/openrc && ironic node-list
register: node_table register: node_table
tags:
- skip_ansible_lint
- name: Check that the node-list command succeeded - name: Check that the node-list command succeeded
assert: assert:
that: that:
@ -41,6 +47,9 @@
shell: > shell: >
. /root/openrc && ironic driver-list . /root/openrc && ironic driver-list
register: driver_table register: driver_table
tags:
- skip_ansible_lint
- name: Check that the driver-list command succeeded - name: Check that the driver-list command succeeded
assert: assert:
that: that:
@ -56,6 +65,9 @@
-i deploy_kernel="http://example.com/kernel.tgz" -i deploy_kernel="http://example.com/kernel.tgz"
-n happynode -n happynode
register: node_created register: node_created
tags:
- skip_ansible_lint
- name: Check that the node was created - name: Check that the node was created
assert: assert:
that: that:
@ -70,6 +82,9 @@
shell: > shell: >
. /root/openrc && ironic node-validate happynode . /root/openrc && ironic node-validate happynode
register: node_validated register: node_validated
tags:
- skip_ansible_lint
- name: Check that node-validate returned something sensible - name: Check that node-validate returned something sensible
assert: assert:
that: that:
@ -79,6 +94,9 @@
shell: > shell: >
. /root/openrc && ironic port-create -n $(ironic node-list | grep 'happynode' | cut -f 2 -d "|") -a de:ad:be:ef:de:ad . /root/openrc && ironic port-create -n $(ironic node-list | grep 'happynode' | cut -f 2 -d "|") -a de:ad:be:ef:de:ad
register: port_created register: port_created
tags:
- skip_ansible_lint
- name: Check that the port was created - name: Check that the port was created
assert: assert:
that: that:
@ -88,6 +106,9 @@
shell: > shell: >
. /root/openrc && ironic node-update happynode replace name=cheerynode . /root/openrc && ironic node-update happynode replace name=cheerynode
register: name_changed register: name_changed
tags:
- skip_ansible_lint
- name: Check that the name was changed - name: Check that the name was changed
assert: assert:
that: that:
@ -97,6 +118,9 @@
shell: > shell: >
. /root/openrc && ironic node-delete cheerynode . /root/openrc && ironic node-delete cheerynode
register: node_deleted register: node_deleted
tags:
- skip_ansible_lint
- name: Check that a node was deleted - name: Check that a node was deleted
assert: assert:
that: that:

View File

@ -14,18 +14,24 @@
with_items: with_items:
- httplib2 - httplib2
- python-openstackclient - python-openstackclient
- name: Get auth token - name: Get auth token
shell: > shell: >
. /root/openrc && openstack token issue --format yaml | awk '/^id\:/ {print $2}' . /root/openrc && openstack token issue --format yaml | awk '/^id\:/ {print $2}'
register: get_keystone_token register: get_keystone_token
tags:
- skip_ansible_lint
- name: set token - name: set token
set_fact: set_fact:
keystone_token: "{{ get_keystone_token.stdout }}" keystone_token: "{{ get_keystone_token.stdout }}"
- name: Check the ironic-api - name: Check the ironic-api
uri: uri:
url: "{{ ironic_service_publicuri }}" url: "{{ ironic_service_publicuri }}"
HEADER_X-Auth-Token: "{{ keystone_token }}" HEADER_X-Auth-Token: "{{ keystone_token }}"
status_code: 200 status_code: 200
- name: list chassis - name: list chassis
uri: uri:
url: "{{ ironic_service_publicuri }}/v1/chassis" url: "{{ ironic_service_publicuri }}/v1/chassis"
@ -33,8 +39,10 @@
status_code: 200 status_code: 200
return_content: yes return_content: yes
register: chassis_list register: chassis_list
- name: test chassis list - name: test chassis list
assert: that="chassis_list.json.chassis == []" assert: that="chassis_list.json.chassis == []"
- name: list drivers - name: list drivers
uri: uri:
HEADER_X-Auth-Token: "{{ keystone_token }}" HEADER_X-Auth-Token: "{{ keystone_token }}"
@ -45,6 +53,7 @@
# Returning an empty driver list currently as of 20/09/2016 # Returning an empty driver list currently as of 20/09/2016
# - name: test drivers # - name: test drivers
# assert: that="driver_list.json.drivers[0].name == 'agent_ipmitool'" # assert: that="driver_list.json.drivers[0].name == 'agent_ipmitool'"
- name: list nodes - name: list nodes
uri: uri:
url: "{{ ironic_service_publicuri }}/v1/nodes" url: "{{ ironic_service_publicuri }}/v1/nodes"
@ -52,6 +61,7 @@
status_code: 200 status_code: 200
return_content: yes return_content: yes
register: node_list register: node_list
- name: test nodes list is empty - name: test nodes list is empty
assert: that="node_list.json.nodes == []" assert: that="node_list.json.nodes == []"
# Failing with an HTTP 400 as of 20/09/2016 # Failing with an HTTP 400 as of 20/09/2016