-
Notifications
You must be signed in to change notification settings - Fork 14
Add kepler_vm metrics test when CPU load is high #310
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
Open
rsafrono
wants to merge
1
commit into
infrawatch:master
Choose a base branch
from
rsafrono:kepler_vm_test_with_cpu_load
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |||||
| TEST Check that kepler shows idle power consumption metric for VM and it is not zero | ||||||
| ansible.builtin.shell: | | ||||||
| set -euxo pipefail | ||||||
| {{ metrics_cmd_prefix }} "kepler_vm_package_joules_total{'vm_id'='{{ kepler_test_vm }}', 'mode'='idle'}" | ||||||
| {{ metrics_cmd_prefix }} "kepler_vm_cpu_joules_total{'vm_id'='{{ test_vm_id }}', 'zone'='package'}" | ||||||
| register: result | ||||||
| changed_when: false | ||||||
| failed_when: result.rc != 0 or result.stdout|float == 0 | ||||||
|
|
@@ -12,7 +12,7 @@ | |||||
| Step 1 Get an initial value of VM dynamic metrics and check that it's not zero | ||||||
| ansible.builtin.shell: | | ||||||
| set -euxo pipefail | ||||||
| {{ metrics_cmd_prefix }} "kepler_vm_package_joules_total{'vm_id'='{{ kepler_test_vm }}', 'mode'='dynamic'}" | ||||||
| {{ metrics_cmd_prefix }} "kepler_vm_cpu_joules_total{'vm_id'='{{ test_vm_id }}', 'zone'='package'}" | ||||||
| register: value1 | ||||||
| changed_when: false | ||||||
| failed_when: value1.rc != 0 or value1.stdout|float == 0 | ||||||
|
|
@@ -22,9 +22,45 @@ | |||||
| Step 2 Get a new value of VM dynamic metrics and compare with the initial value | ||||||
| ansible.builtin.shell: | | ||||||
| set -euxo pipefail | ||||||
| {{ metrics_cmd_prefix }} "kepler_vm_package_joules_total{'vm_id'='{{ kepler_test_vm }}', 'mode'='dynamic'}" | ||||||
| {{ metrics_cmd_prefix }} "kepler_vm_cpu_joules_total{'vm_id'='{{ test_vm_id }}', 'zone'='package'}" | ||||||
| register: value2 | ||||||
| delay: 10 | ||||||
| retries: 3 | ||||||
| changed_when: false | ||||||
| until: value2.rc == 0 and (value2.stdout|float > value1.stdout|float) | ||||||
|
|
||||||
| - name: | | ||||||
| TEST Check kepler metrics dynamics when test VM is under load for some time | ||||||
| Step 1 Get initial value of VM power consumption in watts | ||||||
| ansible.builtin.shell: | | ||||||
| set -euxo pipefail | ||||||
| {{ metrics_cmd_prefix }} "kepler_vm_cpu_watts{'vm_id'='{{ test_vm_id }}','zone'='package'}" | ||||||
| register: value1 | ||||||
| changed_when: false | ||||||
| failed_when: value1.rc != 0 | ||||||
|
|
||||||
| - name: | | ||||||
| TEST Check kepler metrics dynamics when test VM is under load for some time | ||||||
| Step 2 Run process that creates high CPU load on the test VM and get new power consumption metrics | ||||||
| ansible.builtin.shell: | | ||||||
| set -euxo pipefail | ||||||
| port_id=$({{ openstack_cmd }} port list --device-id='{{ test_vm_id }}' --network '{{ kepler_test_vm_network }}' -c id -f value) | ||||||
| floating_ip=$({{ openstack_cmd }} floating ip list --port $port_id -c 'Floating IP Address' -f value) | ||||||
| ssh_options='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' | ||||||
| ssh -i '{{ kepler_test_vm_key }}' $ssh_options '{{kepler_test_vm_user}}'@$floating_ip 'nohup timeout 30 openssl speed -multi $(grep -ci processor /proc/cpuinfo) > /dev/null 2>&1 &' | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| sleep 20 | ||||||
| {{ metrics_cmd_prefix }} "kepler_vm_cpu_watts{'vm_id'='{{ test_vm_id }}','zone'='package'}" | ||||||
| register: value2 | ||||||
| changed_when: false | ||||||
| failed_when: value2.rc != 0 or (value2.stdout|float <= value1.stdout|float + 5.0) | ||||||
|
|
||||||
| - name: | | ||||||
| TEST Check kepler metrics dynamics when test VM is under load for some time | ||||||
| Step 3 Check that VM power consumption decreased back after removing load | ||||||
| ansible.builtin.shell: | | ||||||
| set -euxo pipefail | ||||||
| sleep 20 | ||||||
| {{ metrics_cmd_prefix }} "kepler_vm_cpu_watts{'vm_id'='{{ test_vm_id }}','zone'='package'}" | ||||||
| register: value3 | ||||||
| changed_when: false | ||||||
| failed_when: value3.rc != 0 or (value3.stdout|float - value1.stdout|float)|abs > 0.1 | ||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're using the custom xml logger, I recommend checking the output, since I am not sure how these three tasks will be reported, since they have the same name.
I think they'll each get a testcase entry in the XML, but I don't know if polarion will like that or not