Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing autoscaling tests names from RHOSHO-XXXX pattern to match tests polarion automation IDs #143

Merged
merged 3 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions roles/telemetry_autoscaling/tasks/configure_heat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,25 @@

# TODO: Pass the parameters correctly. When I tried to pass the parameters
# into the template.yaml file, they weren't passed to the instance initially.
- name: RHOSO-12657 Configure heat template for automatically scaling instances
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I think we need to keep the test IDs, since the custom logger is used to determine pass/fail, and it doesn't create a test_run_result.out file unless there are tests with test id prefix (i.e. RHOSO, RHOSP, UI)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going ot update this to match what is done in the other tests i.e. add a second line with the test id to the task name

- name: |
TEST configure heat template automatically scaling instances
RHOSO-12657
ansible.builtin.template:
src: instance.yaml.j2
dest: ~/templates/autoscaling/vnf/instance.yaml

- name: RHOSO-12658 Create the resource to reference in the heat template
- name: |
TEST Create resource reference in the heat template
RHOSO-12658
ansible.builtin.copy:
dest: ~/templates/autoscaling/vnf/resources.yaml
content: |
resource_registry:
"OS::Nova::Server::VNF": ./instance.yaml

- name: RHOSO-12659 Create the deployment template for heat to control instance scaling
- name: |
TEST Create template heat control instances
RHOSO-12659
ansible.builtin.template:
dest: ~/templates/autoscaling/vnf/template.yaml
src: template.yaml.j2
33 changes: 25 additions & 8 deletions roles/telemetry_autoscaling/tasks/creating_stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
#stack_keyname:
stack_network: private
stack_external_network: public
- name: RHOSO-12648 Create the stack

- name: |
TEST create stack
RHOSO-12648
ansible.builtin.shell: |
#source ~/overcloudrc;
{{ openstack_cmd }} stack create \
Expand All @@ -37,7 +40,9 @@
var: result


- name: RHOSO-12704 Verify that the stack was created successfully
- name: |
TEST verify stack was successfully created
RHOSO-12704
ansible.builtin.shell: |
# source ~/overcloudrc;
{{ openstack_cmd }} stack show {{ stack_name }};
Expand All @@ -47,7 +52,9 @@
retries: 20


- name: RHOSO-12650 Verify that the stack resources are created
- name: |
TEST Verify stack resources created
RHOSO-12650
ansible.builtin.shell: |
# source ~/overcloudrc;
export STACK_ID=$({{ openstack_cmd }} stack show {{ stack_name }} -c id -f value);
Expand All @@ -58,7 +65,9 @@
until: '"CREATE_COMPLETE" in result.stdout'
#failed_when: '"CREATE_COMPLETE" not in result.stdout'

- name: RHOSO-12707 Verify that ceilometer_cpu metric exist
- name: |
TEST Verify ceilometer cpu metrics exist
RHOSO-12707
ansible.builtin.shell: |
# source ~/overcloudrc;
{{ openstack_cmd }} metric list
Expand All @@ -69,15 +78,19 @@
ansible.builtin.debug:
var: result

- name: RHOSO-12651 Verify that an instance was launched by the stack creation
- name: |
TEST Verify that an instance was launched
RHOSO-12651
ansible.builtin.shell: |
# source ~/overcloudrc;
export STACK_ID=$({{ openstack_cmd }} stack show {{ stack_name }} -c id -f value);
{{ openstack_cmd }} server list --long | grep $STACK_ID;
register: result
failed_when: result.rc >= 1

- name: RHOSO-12652 Verify that the alarms were created for the stack
- name: |
TEST Verify that alarms were created
RHOSO-12652
ansible.builtin.shell: |
# source ~/overcloudrc;
{{ openstack_cmd }} alarm list
Expand All @@ -98,15 +111,19 @@
{{ openstack_cmd }} stack resource list $STACK_ID |grep -i cpu_alarm_high | awk '{print $4}'
register: physical_resource_id_high

- name: RHOSO-12653 Verify physical_resource_id match the alarm id for cpu_alarm_low
- name: |
TEST Verify resource id match alarm id low
RHOSO-12653
ansible.builtin.shell: |
# source ~/overcloudrc;
{{ openstack_cmd }} alarm list |grep -i cpu_alarm_low | grep {{ stack_name }} | awk '{print $2}'
register: alarm_id_low
failed_when:
- physical_resource_id_low.stdout != alarm_id_low.stdout

- name: RHOSO-12654 Verify physical_resource_id match the alarm id for cpu_alarm_high
- name: |
TEST Verify physical resource id match the alarm high
RHOSO-12654
ansible.builtin.shell: |
# source ~/overcloudrc;
{{ openstack_cmd }} alarm list |grep -i cpu_alarm_high | grep {{ stack_name }} | awk '{print $2}'
Expand Down
4 changes: 3 additions & 1 deletion roles/telemetry_autoscaling/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# tasks file for telemetry_autoscaling
# TODO: Update the pre-checks to include the resources that the stack expects to exist
# i.e. networks, flavor, image, security group
- name: RHOSO-12666 Test services are enabled for autoscaling
- name: |
TEST Verify services running
RHOSO-12666
when: metrics_backend == "prometheus"
ansible.builtin.include_tasks:
file: test_services.yml
Expand Down
20 changes: 15 additions & 5 deletions roles/telemetry_autoscaling/tasks/test_autoscaling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
fail:
msg: "bad vnf_instance_ip"

- name: RHOSO-12665 Verfiy the number of instances before scaling
- name: |
TEST Verify number instances before scaling
RHOSO-12665
ansible.builtin.shell: |
# source ~/overcloudrc;
{{ openstack_cmd }} server list --long | grep -i 'metering.server_group' | wc -l
Expand Down Expand Up @@ -57,7 +59,9 @@
register: busy_process
with_items: "{{ vnf_instance_ip.stdout_lines }}"

- name: RHOSO-12660 Verify that the `cpu_alarm_high` alarm has been triggered
- name: |
TEST Verify cpu high alarm has been triggered
RHOSO-12660
ansible.builtin.shell: |
# source ~/overcloudrc;
{{ openstack_cmd }} alarm list -c state -c name -f value| \
Expand All @@ -69,7 +73,9 @@
register: result
until: result.stdout == "alarm"

- name: RHOSO-12661 Verify that the Orchestration service has scaled up the instances
- name: |
TEST Verify orchestration scaled up instances
RHOSO-12661
ansible.builtin.shell: |
# source ~/overcloudrc;
{{ openstack_cmd }} server list --long|grep -i metering.server_group | wc -l
Expand All @@ -88,7 +94,9 @@
ansible.builtin.pause:
minutes: 5

- name: RHOSO-12664 Verify that the `cpu_alarm_low` alarm has been triggered
- name: |
TEST Verify cpu low alaram has been triggered
RHOSO-12664
ansible.builtin.shell: |
# source ~/overcloudrc;
{{ openstack_cmd }} alarm list -c state -c name -f value| \
Expand All @@ -100,7 +108,9 @@
register: result
until: result.stdout == "alarm"

- name: RHOSO-12663 Verify that the Orchestration service has scaled down the instances
- name: |
TEST Verify Orchestration scaled down instances
RHOSO-12663
ansible.builtin.shell: |
# source ~/overcloudrc;
export STACK_ID=$({{ openstack_cmd }} stack show {{ stack_name }} -c id -f value)
Expand Down
Loading