-
Notifications
You must be signed in to change notification settings - Fork 19
Test/brseed 1342 e2 e test baremetal #407
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
ezychlagre
wants to merge
6
commits into
alumet-dev:main
Choose a base branch
from
ezychlagre:test/BRSEED-1342-E2E-test-baremetal
base: main
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
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0953089
test: add E2E robot framework integration tests
ezychlagre 98b6fa8
test: add download alumet package and copy to remote host
ezychlagre 1614c9a
test: define Check Metric keyword and use it as template
ezychlagre 5492234
test: update tests related to plugin perf
ezychlagre 31515af
test: add __init__.robot file that include Suite Setup Teardown
ezychlagre 8701e64
test: update according the PR comments
ezychlagre 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| # Alumet integration tests <!-- omit in toc --> | ||
|
|
||
| This folder contains all script files and scenarios for testing alumet on bare metal. | ||
| The structure of files is: | ||
|
|
||
| ```text | ||
|
|
||
| ├── README.md | ||
| ├── run.sh | ||
| └── scenarios | ||
| ├── common | ||
| │ └── alumet_keywords.robot | ||
| ├── __init__.robot | ||
| ├── installation.robot | ||
| ├── plugin-perf.robot | ||
| ├── plugin-rapl.robot | ||
| ├── resources | ||
| │ ├── help-config-option.txt | ||
| │ ├── help-exec-option.txt | ||
| │ ├── help-option.txt | ||
| │ ├── help-plugins-option.txt | ||
| │ └── help-watch-option.txt | ||
| └── tools | ||
| └── cpu_load.sh | ||
| ``` | ||
|
|
||
| The scenarios (test suites) are located in scenarios folder. Robot framework is used to perform automatically the tests. Each suite test is a set of tests. | ||
| The test strategy is to write one robot framework file (a test suite) per alumet plugin and/or per features. | ||
|
|
||
| The current version contains the following robot framework files: | ||
| - installation.robot: for testing installation of alumet (uninstallation is tested using the Suite Teardown) | ||
| - plugin-perf.robot: for testing perf plugin | ||
| - plugin-rapl.robot: for testing rapl plugin. | ||
|
|
||
| The \_\_init\_\_.robot file contains the Suite Setup (Install Alumet) and Teardown (UnInstall Alumet). When this file is present, robot framework executes at the beginning of the tests the keyword `Install Alumet` and at the end of test execution the keyword `UnInstall alumet` | ||
|
|
||
| Each test can have one or several tags allowing the exclusion of tests from being run by robot framework. | ||
|
|
||
| Before executing the tests, you need to install [robot framework](https://docs.robotframework.org/docs/getting_started/testing#install-robot-framework-in-a-virtual-environment). | ||
| Then you need to initialize the robot framework virtual environment: | ||
|
|
||
| ```bash | ||
| source ~/venv-robot/bin/activate | ||
| (venv-robot) [zychlae@carbon0 integration_tests]$ | ||
| ``` | ||
|
|
||
| The script run.sh allows to execute the robot framework tests on a target node and with a target alumet's release and distribution. For that, you can modify the variables in run.sh script: | ||
|
|
||
| ```bash | ||
| # credentials used to logon on the target node | ||
| NODE=otpaas2 | ||
| USERNAME=emmanuel | ||
| KEY=${HOME}/.ssh/id_rsa | ||
| HOME_TEST=$(pwd) | ||
| # version of Alumet to installed | ||
| ALUMET_VERSION=0.9.4 | ||
| ALUMET_DISTRIBUTION=1_amd64_ubuntu_22.04 | ||
| ``` | ||
|
|
||
| Then you can execute your test: | ||
|
|
||
| ```bash | ||
| ./run.sh | ||
| Start running tests at: Thu Jun 4 17:06:14 CEST 2026 | ||
| ============================================================================== | ||
| Scenarios | ||
| ============================================================================== | ||
| Scenarios.Installation :: Alumet installation / uninstallation | ||
| ============================================================================== | ||
| Test connection on target node | PASS | | ||
| ------------------------------------------------------------------------------ | ||
| install alumet | PASS | | ||
| ------------------------------------------------------------------------------ | ||
| which alumet-agent | PASS | | ||
| ------------------------------------------------------------------------------ | ||
| [...] | ||
| ------------------------------------------------------------------------------ | ||
| Scenarios.Installation :: Alumet installation / uninstallation | FAIL | | ||
| 9 tests, 8 passed, 1 failed | ||
| ============================================================================== | ||
| Scenarios.Plugin-Perf :: Alumet test plugin perf | ||
| ============================================================================== | ||
| Test connection on target node | PASS | | ||
| ------------------------------------------------------------------------------ | ||
| run cpu_load | PASS | | ||
| ------------------------------------------------------------------------------ | ||
| run plugin csv perf | PASS | | ||
| ------------------------------------------------------------------------------ | ||
| check alumet running | PASS | | ||
| ------------------------------------------------------------------------------ | ||
| Check Perf Metric perf_hardware_REF_CPU_CYCLES metric value read: 17688 | ||
| Check Perf Metric perf_hardware_REF_CPU_CYCLES | PASS | | ||
| ------------------------------------------------------------------------------ | ||
| [...] | ||
| ------------------------------------------------------------------------------ | ||
| Scenarios.Plugin-Perf :: Alumet test plugin perf | FAIL | | ||
| 9 tests, 8 passed, 1 failed | ||
| ============================================================================== | ||
| Scenarios.Plugin-Rapl :: Alumet test plugin rapl | ||
| ============================================================================== | ||
| Test connection on target node | PASS | | ||
| ------------------------------------------------------------------------------ | ||
| run plugins socket-control csv rapl | PASS | | ||
| ------------------------------------------------------------------------------ | ||
| check alumet running | PASS | | ||
| ------------------------------------------------------------------------------ | ||
| Check Rapl Metric package metric value read: 22.81256103515625 | ||
| Check Rapl Metric package | PASS | | ||
| ------------------------------------------------------------------------------ | ||
| [...] | ||
| ------------------------------------------------------------------------------ | ||
| Scenarios.Plugin-Rapl :: Alumet test plugin rapl | PASS | | ||
| 9 tests, 9 passed, 0 failed | ||
| ============================================================================== | ||
| Scenarios | FAIL | | ||
| 27 tests, 25 passed, 2 failed | ||
| ``` | ||
|
|
||
| Robot framework generates a report and a log file in html format. | ||
|
|
||
| To write a new test suite for an input plugin, you must use the `Check Metric` keyword to validate the csv output file. | ||
| You use plugin-rapl.robot as an example. | ||
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 |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #!/bin/bash | ||
| ################################################################################################ | ||
| # this script launch robot framework tests on a target node | ||
| # Environment variables to set or modify: | ||
| # NODE: target node for executing robot framework test suites | ||
| # ALUMET_VERSION: alumet version to test | ||
| # ALUMET_DISTRIBUTION: alumet distribution to test | ||
| # | ||
| ################################################################################################ | ||
|
|
||
| #set -x | ||
|
|
||
| # target node to install alumet | ||
| NODE=otpaas2 | ||
| # gateway or jumphost to connect to the target node | ||
| # it could be an alias name or IP address | ||
| GATEWAY=172.16.118.53 | ||
| # credentials used to logon on the target node | ||
| USERNAME=emmanuel | ||
| KEY=${HOME}/.ssh/id_rsa | ||
| HOME_TEST=$(pwd) | ||
|
|
||
| # version of Alumet to installed | ||
| ALUMET_VERSION=0.9.4 | ||
| ALUMET_DISTRIBUTION=1_amd64_ubuntu_22.04 | ||
|
|
||
|
|
||
| # Before executed the tests, we need to activate robot framework with the following command | ||
| # we deactivate the CI check on file $HOME/venv-robot/bin/activate | ||
| # shellcheck disable=SC1091 | ||
| source "$HOME"/venv-robot/bin/activate | ||
|
|
||
| # you can exclude some tests using option --exclude following by TAG name | ||
| # Available TAGs are : RAPL_PLUGIN, PERF_PLUGIN, INPUT_PLUGIN, INSTALLATION | ||
|
|
||
| echo "Start running tests at: $(date)" | ||
|
|
||
| robot -v "NODE:$NODE" \ | ||
| -v "GATEWAY:$GATEWAY" \ | ||
| -v "USERNAME:$USERNAME" \ | ||
| -v "KEY:$KEY" \ | ||
| -v "HOME_TEST:$HOME_TEST" \ | ||
| -v "ALUMET_VERSION:$ALUMET_VERSION" \ | ||
| -v "ALUMET_DISTRIBUTION:$ALUMET_DISTRIBUTION" \ | ||
| --metadata "Test are executed on node $NODE with alumet $ALUMET_VERSION $ALUMET_DISTRIBUTION" \ | ||
| scenarios/ | ||
|
|
||
| echo "End running tests at: $(date)" | ||
|
|
||
| # other tags defined on tests that can be exclude | ||
| # --exclude INSTALLATION \ | ||
| # --exclude PERF_PLUGIN \ | ||
| # --exclude INPUT_PLUGIN \ | ||
| # --exclude RAPL_PLUGIN \ | ||
| # --exclude INSTALLATION \ |
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 |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| *** Settings *** | ||
| Resource ${HOME_TEST}/scenarios/common/alumet_keywords.robot | ||
|
|
||
| Suite Setup Install Alumet | ||
| Suite Teardown UnInstall Alumet | ||
|
|
||
|
|
||
| *** Variables *** |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.