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: >
. /root/openrc && ironic chassis-list
register: chassis_table
tags:
- skip_ansible_lint
- name: Check that the chassis-list command succeeded
assert:
that:
@ -32,6 +35,9 @@
shell: >
. /root/openrc && ironic node-list
register: node_table
tags:
- skip_ansible_lint
- name: Check that the node-list command succeeded
assert:
that:
@ -41,6 +47,9 @@
shell: >
. /root/openrc && ironic driver-list
register: driver_table
tags:
- skip_ansible_lint
- name: Check that the driver-list command succeeded
assert:
that:
@ -56,6 +65,9 @@
-i deploy_kernel="http://example.com/kernel.tgz"
-n happynode
register: node_created
tags:
- skip_ansible_lint
- name: Check that the node was created
assert:
that:
@ -70,6 +82,9 @@
shell: >
. /root/openrc && ironic node-validate happynode
register: node_validated
tags:
- skip_ansible_lint
- name: Check that node-validate returned something sensible
assert:
that:
@ -79,6 +94,9 @@
shell: >
. /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
tags:
- skip_ansible_lint
- name: Check that the port was created
assert:
that:
@ -88,6 +106,9 @@
shell: >
. /root/openrc && ironic node-update happynode replace name=cheerynode
register: name_changed
tags:
- skip_ansible_lint
- name: Check that the name was changed
assert:
that:
@ -97,6 +118,9 @@
shell: >
. /root/openrc && ironic node-delete cheerynode
register: node_deleted
tags:
- skip_ansible_lint
- name: Check that a node was deleted
assert:
that:

View File

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