Skip to content

Commit

Permalink
Fix Nova server diagnostic tests
Browse files Browse the repository at this point in the history
Signed-off-by: Bohdan Dobrelia <[email protected]>
  • Loading branch information
bogdando committed Mar 11, 2024
1 parent 99e7b17 commit 68ba66d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
14 changes: 8 additions & 6 deletions docs_user/modules/openstack-edpm_adoption.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -609,15 +609,17 @@ oc exec -it nova-cell1-conductor-0 -- nova-manage db online_data_migrations
* Verify if Nova services can stop the existing test VM instance:
+
----
${BASH_ALIASES[openstack]} server list | grep -qF '| test | ACTIVE |' && openstack server stop test
${BASH_ALIASES[openstack]} server list | grep -qF '| test | SHUTOFF |'
${BASH_ALIASES[openstack]} server --os-compute-api-version 2.48 show --diagnostics test | grep "it is in power state shutdown" || echo PASS
${BASH_ALIASES[openstack]} server list | grep -qF '| test | ACTIVE |' || echo FAIL
${BASH_ALIASES[openstack]} server stop test || echo FAIL
${BASH_ALIASES[openstack]} server list | grep -qF '| test | SHUTOFF |' || echo FAIL
${BASH_ALIASES[openstack]} server --os-compute-api-version 2.48 show --diagnostics test 2>&1 | grep -q "it is in power state shutdown" || echo FAIL
----

* Verify if Nova services can start the existing test VM instance:
+
----
${BASH_ALIASES[openstack]} server list | grep -qF '| test | SHUTOFF |' && openstack server start test
${BASH_ALIASES[openstack]} server list | grep -F '| test | ACTIVE |'
${BASH_ALIASES[openstack]} server --os-compute-api-version 2.48 show --diagnostics test --fit-width -f json | jq -r '.state' | grep running
${BASH_ALIASES[openstack]} server list | grep -qF '| test | SHUTOFF |' || echo FAIL
${BASH_ALIASES[openstack]} server start test || echo FAIL
${BASH_ALIASES[openstack]} server list | grep -F '| test | ACTIVE |' || echo FAIL
${BASH_ALIASES[openstack]} server --os-compute-api-version 2.48 show --diagnostics test --fit-width -f json | jq -r '.state' | grep running || echo FAIL
----
18 changes: 10 additions & 8 deletions tests/roles/dataplane_adoption/tasks/nova_verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@
ansible.builtin.shell: |
{{ shell_header }}
{{ nova_header }}
${BASH_ALIASES[openstack]} server list | grep -qF '| test | ACTIVE |' && ${BASH_ALIASES[openstack]} server stop test
${BASH_ALIASES[openstack]} server list | grep -qF '| test | SHUTOFF |'
${BASH_ALIASES[openstack]} server --os-compute-api-version 2.48 show --diagnostics test | grep "it is in power state shutdown" || echo PASS
${BASH_ALIASES[openstack]} server list | grep -qF '| test | ACTIVE |' || echo FAIL
${BASH_ALIASES[openstack]} server stop test || echo FAIL
${BASH_ALIASES[openstack]} server list | grep -qF '| test | SHUTOFF |' || echo FAIL
${BASH_ALIASES[openstack]} server --os-compute-api-version 2.48 show --diagnostics test 2>&1 | grep -q "it is in power state shutdown" || echo FAIL
register: nova_verify_stop_result
until: nova_verify_stop_result is success
until: ("FAIL" not in nova_verify_stop_result.stdout_lines)
retries: 10
delay: 6

- name: verify if Nova services can start the existing test VM instance
ansible.builtin.shell: |
{{ shell_header }}
{{ nova_header }}
${BASH_ALIASES[openstack]} server list | grep -qF '| test | SHUTOFF |' && ${BASH_ALIASES[openstack]} server start test
${BASH_ALIASES[openstack]} server list | grep -F '| test | ACTIVE |'
${BASH_ALIASES[openstack]} server --os-compute-api-version 2.48 show --diagnostics test --fit-width -f json | jq -r '.state' | grep running
${BASH_ALIASES[openstack]} server list | grep -qF '| test | SHUTOFF |' || echo FAIL
${BASH_ALIASES[openstack]} server start test || echo FAIL
${BASH_ALIASES[openstack]} server list | grep -F '| test | ACTIVE |' || echo FAIL
${BASH_ALIASES[openstack]} server --os-compute-api-version 2.48 show --diagnostics test --fit-width -f json | jq -r '.state' | grep running || echo FAIL
register: nova_verify_start_result
until: nova_verify_start_result is success
until: ("FAIL" not in nova_verify_stop_result.stdout_lines)
retries: 60
delay: 6

0 comments on commit 68ba66d

Please sign in to comment.