-
Notifications
You must be signed in to change notification settings - Fork 122
OCPP1.6: Powermeter public key support #1599
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| import pytest | ||
|
|
||
| from everest.testing.core_utils.controller.test_controller_interface import ( | ||
|
Check warning on line 3 in tests/ocpp_tests/test_sets/ocpp16/eichrecht.py
|
||
| TestController, | ||
| ) | ||
| from everest.testing.ocpp_utils.charge_point_utils import ( | ||
| wait_for_and_validate, | ||
| TestUtility, | ||
| ) | ||
| from everest.testing.ocpp_utils.central_system import ChargePoint16 | ||
| from everest.testing.ocpp_utils.fixtures import test_utility, charge_point_v16 | ||
|
Check warning on line 11 in tests/ocpp_tests/test_sets/ocpp16/eichrecht.py
|
||
| from everest_test_utils import get_everest_config_path_str | ||
|
|
||
| from ocpp.v16 import call_result | ||
|
|
||
|
|
||
| @pytest.mark.asyncio | ||
| @pytest.mark.everest_core_config( | ||
| get_everest_config_path_str("everest-config-two-connectors.yaml") | ||
| ) | ||
| async def test_meter_public_key( | ||
| charge_point_v16: ChargePoint16, test_utility: TestUtility | ||
| ): | ||
| await charge_point_v16.get_configuration_req(key=["MeterPublicKey[1]"]) | ||
| assert await wait_for_and_validate( | ||
| test_utility, | ||
| charge_point_v16, | ||
| "GetConfiguration", | ||
| call_result.GetConfiguration( | ||
| [{"key": "MeterPublicKey[1]", "readonly": True, "value": "TESTPUBLICKEY1"}] | ||
| ), | ||
| ) | ||
|
|
||
| await charge_point_v16.get_configuration_req(key=["MeterPublicKey[2]"]) | ||
| assert await wait_for_and_validate( | ||
| test_utility, | ||
| charge_point_v16, | ||
| "GetConfiguration", | ||
| call_result.GetConfiguration( | ||
| [{"key": "MeterPublicKey[2]", "readonly": True, "value": "TESTPUBLICKEY2"}] | ||
| ), | ||
| ) | ||
|
|
||
| await charge_point_v16.get_configuration_req(key=["MeterPublicKey[3]"]) | ||
|
|
||
| assert await wait_for_and_validate( | ||
| test_utility, | ||
| charge_point_v16, | ||
| "GetConfiguration", | ||
| {"unknownKey": ["MeterPublicKey[3]"]} | ||
| ) | ||
|
|
||
| test_utility.messages.clear() | ||
|
|
||
| response : call_result.GetConfiguration = await charge_point_v16.get_configuration_req() | ||
|
|
||
| assert any( | ||
| entry['key'] == "MeterPublicKey[1]" and entry['value'] == "TESTPUBLICKEY1" | ||
| for entry in response.configuration_key) | ||
|
|
||
| assert any( | ||
| entry['key'] == "MeterPublicKey[2]" and entry['value'] == "TESTPUBLICKEY2" | ||
| for entry in response.configuration_key) | ||
|
|
||
| await charge_point_v16.get_configuration_req(key=["MeterPublicKey[]"]) | ||
|
|
||
| assert await wait_for_and_validate( | ||
| test_utility, | ||
| charge_point_v16, | ||
| "GetConfiguration", | ||
| {"unknownKey": ["MeterPublicKey[]"]} | ||
| ) | ||
|
|
||
| await charge_point_v16.get_configuration_req(key=["MeterPublicKey[MeterPublicKey[1]]"]) | ||
|
|
||
| assert await wait_for_and_validate( | ||
| test_utility, | ||
| charge_point_v16, | ||
| "GetConfiguration", | ||
| {"unknownKey": ["MeterPublicKey[MeterPublicKey[1]]"]} | ||
| ) | ||
|
|
||
| await charge_point_v16.get_configuration_req(key=["MeterPublicKey[1X"]) | ||
|
|
||
| assert await wait_for_and_validate( | ||
| test_utility, | ||
| charge_point_v16, | ||
| "GetConfiguration", | ||
| {"unknownKey": ["MeterPublicKey[1X"]} | ||
| ) | ||
|
|
||
| await charge_point_v16.get_configuration_req(key=["MeterPublicKey[1X]"]) | ||
|
|
||
| assert await wait_for_and_validate( | ||
| test_utility, | ||
| charge_point_v16, | ||
| "GetConfiguration", | ||
| {"unknownKey": ["MeterPublicKey[1X]"]} | ||
| ) | ||
|
|
||
| await charge_point_v16.get_configuration_req(key=["MeterPublicKey[banana]"]) | ||
|
|
||
| assert await wait_for_and_validate( | ||
| test_utility, | ||
| charge_point_v16, | ||
| "GetConfiguration", | ||
| {"unknownKey": ["MeterPublicKey[banana]"]} | ||
| ) | ||
|
|
||
| await charge_point_v16.get_configuration_req(key=["MeterPublicKey[0]"]) | ||
|
|
||
| assert await wait_for_and_validate( | ||
| test_utility, | ||
| charge_point_v16, | ||
| "GetConfiguration", | ||
| {"unknownKey": ["MeterPublicKey[0]"]} | ||
| ) | ||
|
|
||
| await charge_point_v16.change_configuration_req( | ||
| key="MeterPublicKey[1]", value="TEST" | ||
| ) | ||
| assert await wait_for_and_validate( | ||
| test_utility, | ||
| charge_point_v16, | ||
| "ChangeConfiguration", | ||
| {"status": "Rejected"} | ||
| ) | ||
Uh oh!
There was an error while loading. Please reload this page.