Skip to content

Commit

Permalink
Merge pull request #338 from bogdando/fix_diag_nova_tests
Browse files Browse the repository at this point in the history
Fix Nova server diagnostic tests
  • Loading branch information
jistr authored Mar 19, 2024
2 parents f3f1ec1 + cdeb449 commit 247eaaf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions docs_user/modules/openstack-edpm_adoption.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -622,15 +622,15 @@ 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 |' && ${BASH_ALIASES[openstack]} server stop test || echo PASS
${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 || echo PASS
----

* 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 |' && ${BASH_ALIASES[openstack]} server start test || echo PASS
${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 || echo FAIL
----
22 changes: 11 additions & 11 deletions tests/roles/dataplane_adoption/tasks/nova_verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
ansible.builtin.set_fact:
nova_header: |
alias openstack="oc exec -t openstackclient -- openstack"
FIP={{ lookup('env', 'FIP') | default('192.168.122.20', True) }}
# NOTE(bogdando): do not use 'set -o pipefail' for these verifications
- name: verify if Nova services can stop the existing test VM instance
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 |' && ${BASH_ALIASES[openstack]} server stop test || echo PASS
${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 || echo PASS
register: nova_verify_stop_result
until: nova_verify_stop_result is success
until:
- ("FAIL" not in nova_verify_stop_result.stdout_lines)
- ("it is in power state shutdown" in nova_verify_stop_result.stdout)
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 |' && ${BASH_ALIASES[openstack]} server start test || echo PASS
${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 || echo FAIL
register: nova_verify_start_result
until: nova_verify_start_result is success
until: ("FAIL" not in nova_verify_start_result.stdout_lines)
retries: 60
delay: 6

0 comments on commit 247eaaf

Please sign in to comment.