-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding OCPP E2E tests into seperate testing directory ocpp_tests . The tests include tests for OCPP1.6 and OCPP2.0.1 for different feature profiles and functional blocks. --------- Signed-off-by: Piet Gömpel <pietgoempel@gmail.com> Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de> Co-authored-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
- Loading branch information
1 parent
5166c8b
commit 81b366d
Showing
130 changed files
with
24,823 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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,25 @@ | ||
#!/bin/sh | ||
|
||
rsync -a "$EXT_MOUNT/source/tests" ./ | ||
retVal=$? | ||
|
||
if [ $retVal -ne 0 ]; then | ||
echo "Failed to copy tests" | ||
exit $retVal | ||
fi | ||
|
||
pip install --break-system-packages \ | ||
"$EXT_MOUNT"/wheels/everestpy-*.whl \ | ||
"$EXT_MOUNT"/wheels/everest_testing-*.whl \ | ||
"$EXT_MOUNT"/wheels/iso15118-*.whl \ | ||
pytest-html | ||
retVal=$? | ||
|
||
if [ $retVal -ne 0 ]; then | ||
echo "Failed to pip-install" | ||
exit $retVal | ||
fi | ||
|
||
pip install --break-system-packages -r tests/ocpp_tests/requirements.txt | ||
|
||
$(cd ./tests/ocpp_tests/test_sets/everest-aux/ && ./install_certs.sh "$EXT_MOUNT/dist" && ./install_configs.sh "$EXT_MOUNT/dist") |
This file contains 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,25 @@ | ||
#!/bin/sh | ||
|
||
cd tests | ||
|
||
PARALLEL_TESTS=$(nproc) | ||
|
||
echo "Running $PARALLEL_TESTS ocpp tests in parallel" | ||
|
||
pytest \ | ||
-rA \ | ||
-d --tx "$PARALLEL_TESTS"*popen//python=python3 \ | ||
--max-worker-restart=0 \ | ||
--timeout=300 \ | ||
--junitxml="$EXT_MOUNT/ocpp-tests-result.xml" \ | ||
--html="$EXT_MOUNT/ocpp-tests-report.html" \ | ||
--self-contained-html \ | ||
ocpp_tests/test_sets/ocpp16/*.py \ | ||
ocpp_tests/test_sets/ocpp201/*.py \ | ||
--everest-prefix "$EXT_MOUNT/dist" | ||
retVal=$? | ||
|
||
if [ $retVal -ne 0 ]; then | ||
echo "OCPP tests failed with return code $retVal" | ||
exit $retVal | ||
fi |
This file contains 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 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 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 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 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,10 @@ | ||
build | ||
__pycache__ | ||
*.egg-info | ||
.pytest_cache | ||
.venv | ||
results.xml | ||
result.xml | ||
report.html | ||
**/.DS_Store | ||
**/.idea |
This file contains 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,69 @@ | ||
# OCPP Integration Tests | ||
|
||
This directory contains some test tooling and integration tests | ||
for OCPP1.6 and OCPP2.0.1. | ||
|
||
## Requirements | ||
|
||
In order to run the integration tests, you need to have everest-core compiled | ||
and installed on your system. Please also make sure to install the python | ||
requirements. | ||
|
||
```bash | ||
cd everest-core/ | ||
cmake -S . -B build -DBUILD_TESTING=ON | ||
cmake --build build --target install --parallel -j$(nproc) | ||
. build/venv/bin/activate | ||
cmake --build build --target everestpy_pip_install_dist | ||
cmake --build build --target everest-testing_pip_install_dist | ||
cmake --build build --target iso15118_pip_install_dist | ||
python3 -m pip install aiofile>=3.7.4 | ||
python3 -m pip install netifaces>=0.11.0 | ||
cd tests/ocpp_tests | ||
python3 -m pip install -r requirements.txt | ||
``` | ||
|
||
## Run the tests | ||
|
||
You can run the integration tests using the convenience scripts | ||
provided in this directory e.g. | ||
|
||
```bash | ||
./run-testing.sh | ||
``` | ||
|
||
This command runs all test cases in parallel. | ||
The time for running the test cases depends on your system. | ||
It usually takes a couple of minutes. | ||
You can check out the test results by opening the generated `results.html`. | ||
|
||
You can choose to run the tests sequentially and/or only run subsets | ||
for OCPP1.6 or OCPP2.0.1 using any of the other run scripts. | ||
|
||
Alternatively, you can run individual test sets or test cases using | ||
|
||
```bash | ||
python3 -m pytest test_sets/ocpp201/remote_control.py \ | ||
--everest-prefix <path-to-everest-core-installation-directory> \ | ||
-k 'test_F01_F02_F03' | ||
``` | ||
|
||
e.g. | ||
|
||
```bash | ||
python3 -m pytest test_sets/ocpp201/remote_control.py \ | ||
--everest-prefix ~/checkout/everest-core/build/dist \ | ||
-k 'test_F01_F02_F03' | ||
``` | ||
|
||
This runs test case `test_F01_F02_F03` | ||
specified in `test_sets/ocpp201/remote_control.py`. | ||
|
||
If you run the test cases individually, | ||
make sure to have all required certificates and configs | ||
for the test cases installed using the | ||
convenience scripts inside [test_sets/everest-aux](test_sets/everest-aux/) | ||
|
||
```bash | ||
./install_certs <path-to-everest-core-installation-directory> | ||
./install_configs <path-to-everest-core-installation-directory> |
Oops, something went wrong.