cloudstack: new integration tests test_cs_configuration

pull/14275/head
Rene Moser 9 years ago
parent 7587c20d27
commit d9f7589460

@ -23,3 +23,5 @@
- { role: test_cs_firewall, tags: test_cs_firewall }
- { role: test_cs_loadbalancer_rule, tags: test_cs_loadbalancer_rule }
- { role: test_cs_volume, tags: test_cs_volume }
- { role: test_cs_configuration, tags: test_cs_configuration }

@ -0,0 +1,5 @@
---
test_cs_configuration_storage: PS0
test_cs_configuration_cluster: C0
test_cs_configuration_account: admin
test_cs_configuration_zone: Sandbox-simulator

@ -0,0 +1,3 @@
---
dependencies:
- test_cs_common

@ -0,0 +1,59 @@
---
- name: test configuration account
cs_configuration:
name: allow.public.user.templates
account: "{{ test_cs_configuration_account }}"
value: true
register: config
- name: verify test configuration storage
assert:
that:
- config|success
- name: test update configuration account
cs_configuration:
name: allow.public.user.templates
account: "{{ test_cs_configuration_account }}"
value: false
register: config
- name: verify update configuration account
assert:
that:
- config|success
- config|changed
- config.value == "false"
- config.name == "allow.public.user.templates"
- config.scope == "account"
- config.account == "{{ test_cs_configuration_account }}"
- name: test update configuration account idempotence
cs_configuration:
name: allow.public.user.templates
account: "{{ test_cs_configuration_account }}"
value: false
register: config
- name: verify update configuration account idempotence
assert:
that:
- config|success
- not config|changed
- config.value == "false"
- config.name == "allow.public.user.templates"
- config.scope == "account"
- config.account == "{{ test_cs_configuration_account }}"
- name: test reset configuration account
cs_configuration:
name: allow.public.user.templates
account: "{{ test_cs_configuration_account }}"
value: true
register: config
- name: verify update configuration account
assert:
that:
- config|success
- config|changed
- config.value == "true"
- config.name == "allow.public.user.templates"
- config.scope == "account"
- config.account == "{{ test_cs_configuration_account }}"

@ -0,0 +1,59 @@
---
- name: test configuration cluster
cs_configuration:
name: cpu.overprovisioning.factor
cluster: "{{ test_cs_configuration_cluster }}"
value: 1.0
register: config
- name: verify test configuration cluster
assert:
that:
- config|success
- name: test update configuration cluster
cs_configuration:
name: cpu.overprovisioning.factor
cluster: "{{ test_cs_configuration_cluster }}"
value: 2.0
register: config
- name: verify update configuration cluster
assert:
that:
- config|success
- config|changed
- config.value == "2.0"
- config.name == "cpu.overprovisioning.factor"
- config.scope == "cluster"
- config.cluster == "{{ test_cs_configuration_cluster }}"
- name: test update configuration cluster idempotence
cs_configuration:
name: cpu.overprovisioning.factor
cluster: "{{ test_cs_configuration_cluster }}"
value: 2.0
register: config
- name: verify update configuration cluster idempotence
assert:
that:
- config|success
- not config|changed
- config.value == "2.0"
- config.name == "cpu.overprovisioning.factor"
- config.scope == "cluster"
- config.cluster == "{{ test_cs_configuration_cluster }}"
- name: test reset configuration cluster
cs_configuration:
name: cpu.overprovisioning.factor
cluster: "{{ test_cs_configuration_cluster }}"
value: 1.0
register: config
- name: verify reset configuration cluster
assert:
that:
- config|success
- config|changed
- config.value == "1.0"
- config.name == "cpu.overprovisioning.factor"
- config.scope == "cluster"
- config.cluster == "{{ test_cs_configuration_cluster }}"

@ -0,0 +1,162 @@
---
- name: test fail if missing name
cs_configuration:
register: config
ignore_errors: true
- name: verify results of fail if missing arguments
assert:
that:
- config|failed
- "config.msg == 'missing required arguments: value,name'"
- name: test configuration
cs_configuration:
name: network.loadbalancer.haproxy.stats.visibility
value: global
register: config
- name: verify test configuration
assert:
that:
- config|success
- name: test update configuration string
cs_configuration:
name: network.loadbalancer.haproxy.stats.visibility
value: all
register: config
- name: verify test update configuration string
assert:
that:
- config|success
- config|changed
- config.value == "all"
- config.name == "network.loadbalancer.haproxy.stats.visibility"
- name: test update configuration string idempotence
cs_configuration:
name: network.loadbalancer.haproxy.stats.visibility
value: all
register: config
- name: verify test update configuration string idempotence
assert:
that:
- config|success
- not config|changed
- config.value == "all"
- config.name == "network.loadbalancer.haproxy.stats.visibility"
- name: test reset configuration string
cs_configuration:
name: network.loadbalancer.haproxy.stats.visibility
value: global
register: config
- name: verify test reset configuration string
assert:
that:
- config|success
- config|changed
- config.value == "global"
- config.name == "network.loadbalancer.haproxy.stats.visibility"
- name: test configuration
cs_configuration:
name: vmware.recycle.hung.wokervm
value: false
register: config
- name: verify test configuration
assert:
that:
- config|success
- name: test update configuration bool
cs_configuration:
name: vmware.recycle.hung.wokervm
value: true
register: config
- name: verify test update configuration bool
assert:
that:
- config|success
- config|changed
- config.value == "true"
- config.name == "vmware.recycle.hung.wokervm"
- name: test update configuration bool idempotence
cs_configuration:
name: vmware.recycle.hung.wokervm
value: true
register: config
- name: verify test update configuration bool idempotence
assert:
that:
- config|success
- not config|changed
- config.value == "true"
- config.name == "vmware.recycle.hung.wokervm"
- name: test reset configuration bool
cs_configuration:
name: vmware.recycle.hung.wokervm
value: false
register: config
- name: verify test reset configuration bool
assert:
that:
- config|success
- config|changed
- config.value == "false"
- config.name == "vmware.recycle.hung.wokervm"
- name: test configuration
cs_configuration:
name: agent.load.threshold
value: 0.7
register: config
- name: verify test configuration
assert:
that:
- config|success
- name: test update configuration float
cs_configuration:
name: agent.load.threshold
value: 0.81
register: config
- name: verify update configuration float
assert:
that:
- config|success
- config|changed
- config.value == "0.81"
- config.name == "agent.load.threshold"
- name: test update configuration float idempotence
cs_configuration:
name: agent.load.threshold
value: 0.81
register: config
- name: verify update configuration float idempotence
assert:
that:
- config|success
- not config|changed
- config.value == "0.81"
- config.name == "agent.load.threshold"
- name: reset configuration float
cs_configuration:
name: agent.load.threshold
value: 0.7
register: config
- name: verify reset configuration float
assert:
that:
- config|success
- config|changed
- config.value == "0.7"
- config.name == "agent.load.threshold"
- include: storage.yml
- include: account.yml
- include: zone.yml
- include: cluster.yml

@ -0,0 +1,59 @@
---
- name: test configuration storage
cs_configuration:
name: storage.overprovisioning.factor
storage: "{{ test_cs_configuration_storage }}"
value: 2.0
register: config
- name: verify test configuration storage
assert:
that:
- config|success
- name: test update configuration storage
cs_configuration:
name: storage.overprovisioning.factor
storage: "{{ test_cs_configuration_storage }}"
value: 3.0
register: config
- name: verify update configuration storage
assert:
that:
- config|success
- config|changed
- config.value == "3.0"
- config.name == "storage.overprovisioning.factor"
- config.scope == "storagepool"
- config.storage == "{{ test_cs_configuration_storage }}"
- name: test update configuration storage idempotence
cs_configuration:
name: storage.overprovisioning.factor
storage: "{{ test_cs_configuration_storage }}"
value: 3.0
register: config
- name: verify update configuration storage idempotence
assert:
that:
- config|success
- not config|changed
- config.value == "3.0"
- config.name == "storage.overprovisioning.factor"
- config.scope == "storagepool"
- config.storage == "{{ test_cs_configuration_storage }}"
- name: test reset configuration storage
cs_configuration:
name: storage.overprovisioning.factor
storage: "{{ test_cs_configuration_storage }}"
value: 2.0
register: config
- name: verify reset configuration storage
assert:
that:
- config|success
- config|changed
- config.value == "2.0"
- config.name == "storage.overprovisioning.factor"
- config.scope == "storagepool"
- config.storage == "{{ test_cs_configuration_storage }}"

@ -0,0 +1,59 @@
---
- name: test configuration zone
cs_configuration:
name: use.external.dns
zone: "{{ test_cs_configuration_zone }}"
value: false
register: config
- name: verify test configuration zone
assert:
that:
- config|success
- name: test update configuration zone
cs_configuration:
name: use.external.dns
zone: "{{ test_cs_configuration_zone }}"
value: true
register: config
- name: verify update configuration zone
assert:
that:
- config|success
- config|changed
- config.value == "true"
- config.name == "use.external.dns"
- config.scope == "zone"
- config.zone == "{{ test_cs_configuration_zone }}"
- name: test update configuration zone idempotence
cs_configuration:
name: use.external.dns
zone: "{{ test_cs_configuration_zone }}"
value: true
register: config
- name: verify update configuration zone idempotence
assert:
that:
- config|success
- not config|changed
- config.value == "true"
- config.name == "use.external.dns"
- config.scope == "zone"
- config.zone == "{{ test_cs_configuration_zone }}"
- name: test reset configuration zone
cs_configuration:
name: use.external.dns
zone: "{{ test_cs_configuration_zone }}"
value: false
register: config
- name: verify reset configuration zone
assert:
that:
- config|success
- config|changed
- config.value == "false"
- config.name == "use.external.dns"
- config.scope == "zone"
- config.zone == "{{ test_cs_configuration_zone }}"
Loading…
Cancel
Save