Skip to content

Commit

Permalink
Merge branch 'main' into feature/327-use-case-h01-reservation
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikez committed Nov 14, 2024
2 parents 4a93e69 + ac68603 commit 17fd4b4
Show file tree
Hide file tree
Showing 35 changed files with 484 additions and 204 deletions.
3 changes: 3 additions & 0 deletions .ci/build-kit/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# syntax=docker/dockerfile:1
ARG BASE_IMAGE_TAG=latest
FROM ghcr.io/everest/everest-ci/build-kit-base:${BASE_IMAGE_TAG}
21 changes: 0 additions & 21 deletions .ci/build-kit/install_and_test.sh

This file was deleted.

24 changes: 24 additions & 0 deletions .ci/build-kit/scripts/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

cmake \
-B "$EXT_MOUNT/build" \
-S "$EXT_MOUNT/source" \
-G Ninja \
-DBUILD_TESTING=ON \
-DLIBOCPP16_BUILD_EXAMPLES=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX="$EXT_MOUNT/dist" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON

retVal=$?
if [ $retVal -ne 0 ]; then
echo "Configuring failed with return code $retVal"
exit $retVal
fi

ninja -C "$EXT_MOUNT/build"
retVal=$?
if [ $retVal -ne 0 ]; then
echo "Compiling failed with return code $retVal"
exit $retVal
fi
9 changes: 9 additions & 0 deletions .ci/build-kit/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

ninja -C "$EXT_MOUNT/build" install
retVal=$?

if [ $retVal -ne 0 ]; then
echo "Installation failed with return code $retVal"
exit $retVal
fi
25 changes: 25 additions & 0 deletions .ci/build-kit/scripts/run_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

ninja \
-C "$EXT_MOUNT/build" \
ocpp_gcovr_coverage
retValHTML=$?

ninja \
-C "$EXT_MOUNT/build" \
ocpp_gcovr_coverage_xml
retValXML=$?

# Copy the generated coverage report and xml to the mounted directory in any case
cp -R "$EXT_MOUNT/build/ocpp_gcovr_coverage" "$EXT_MOUNT/gcovr-coverage"
cp "$EXT_MOUNT/build/ocpp_gcovr_coverage_xml.xml" "$EXT_MOUNT/gcovr-coverage-xml.xml"

if [ $retValHTML -ne 0 ]; then
echo "Coverage HTML report failed with return code $retValHTML"
exit $retValHTML
fi

if [ $retValXML -ne 0 ]; then
echo "Coverage XML report failed with return code $retValXML"
exit $retValXML
fi
12 changes: 12 additions & 0 deletions .ci/build-kit/scripts/run_unit_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

ninja -C "$EXT_MOUNT/build" test
retVal=$?

# Copy the LastTest.log file to the mounted directory in any case
cp "$EXT_MOUNT/build/Testing/Temporary/LastTest.log" "$EXT_MOUNT/ctest-report"

if [ $retVal -ne 0 ]; then
echo "Unit tests failed with return code $retVal"
exit $retVal
fi
67 changes: 22 additions & 45 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build and test libocpp
on:
name: Build, Lint and Test
on:
pull_request: {}
workflow_dispatch:
inputs:
Expand All @@ -11,47 +11,24 @@ on:
options:
- 'ubuntu-22.04'
- 'large-ubuntu-22.04-xxl'
jobs:
lint:
name: Lint
runs-on: ${{ inputs.runner || 'ubuntu-22.04' }}
steps:
- name: Checkout libocpp
uses: actions/checkout@v3
with:
path: source
- name: Run clang-format
uses: everest/everest-ci/github-actions/[email protected]
with:
source-dir: source
extensions: hpp,cpp
exclude: cache
install_and_test:
name: Install and test
runs-on: ${{ inputs.runner || 'ubuntu-22.04' }}
steps:
- name: Checkout libocpp
uses: actions/checkout@v3
with:
path: source
- name: Setup run scripts
run: |
mkdir scripts
rsync -a source/.ci/build-kit/ scripts
- name: Pull docker container
run: |
docker pull --platform=linux/x86_64 --quiet ghcr.io/everest/everest-ci/build-kit-base:latest
docker image tag ghcr.io/everest/everest-ci/build-kit-base:latest build-kit
- name: Run install with tests
run: |
docker run \
--volume "$(pwd):/ext" \
--name test-container \
build-kit run-script install_and_test
- name: Archive test results
if: always()
uses: actions/upload-artifact@v3
with:
name: ctest-report
path: ${{ github.workspace }}/ctest-report
schedule:
- cron: '37 13,1 * * *'

jobs:
ci:
name: Build, Lint and Test
uses: everest/everest-ci/.github/workflows/[email protected]
permissions:
contents: read
secrets:
coverage_deploy_token: ${{ secrets.SA_GITHUB_PAT }}
with:
runner: ${{ inputs.runner || 'ubuntu-22.04' }}
artifact_deploy_target_repo: EVerest/everest.github.io
run_coverage: true
do_not_run_coverage_badge_creation: false
run_install_wheels: false
run_integration_tests: false
ctest_report_path: ctest-report
coverage_report_path: gcovr-coverage
coverage_xml_path: gcovr-coverage-xml.xml
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ endif()

if((${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME} OR ${PROJECT_NAME}_BUILD_TESTING) AND BUILD_TESTING)
set(LIBOCPP_BUILD_TESTING ON)
evc_include(CodeCoverage)

append_coverage_compiler_flags()
endif()

# dependencies
Expand Down
180 changes: 180 additions & 0 deletions config/v16/config-full.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{
"Internal": {
"ChargePointId": "cp001",
"CentralSystemURI": "127.0.0.1:8180/steve/websocket/CentralSystemService/",
"ChargeBoxSerialNumber": "cp001",
"ChargePointModel": "Yeti",
"ChargePointSerialNumber": "cp001",
"ChargePointVendor": "Pionix",
"FirmwareVersion": "0.1",
"ICCID": "891004234814455936F",
"IMSI": "262 01 9876543210",
"MeterSerialNumber": "123-456-789",
"MeterType": "AC",
"SupportedCiphers12": [
"ECDHE-ECDSA-AES128-GCM-SHA256",
"ECDHE-ECDSA-AES256-GCM-SHA384",
"AES128-GCM-SHA256",
"AES256-GCM-SHA384"
],
"SupportedCiphers13": [
"TLS_AES_256_GCM_SHA384",
"TLS_AES_128_GCM_SHA256"
],
"UseTPM": false,
"RetryBackoffRandomRange": 10,
"RetryBackoffRepeatTimes": 3,
"RetryBackoffWaitMinimum": 3,
"AuthorizeConnectorZeroOnConnectorOne": true,
"LogMessages": true,
"LogMessagesFormat": [
"log",
"html",
"session_logging",
"security"
],
"LogRotation": false,
"LogRotationDateSuffix": false,
"LogRotationMaximumFileSize": 0,
"LogRotationMaximumFileCount": 0,
"SupportedChargingProfilePurposeTypes": [
"ChargePointMaxProfile",
"TxDefaultProfile",
"TxProfile"
],
"MaxCompositeScheduleDuration": 31536000,
"WebsocketPingPayload": "Hello from EVerest!",
"WebsocketPongTimeout": 5,
"UseSslDefaultVerifyPaths": true,
"VerifyCsmsCommonName": true,
"VerifyCsmsAllowWildcards": true,
"OcspRequestInterval": 604800,
"SeccLeafSubjectCommonName": "cp001",
"SeccLeafSubjectCountry": "DE",
"SeccLeafSubjectOrganization": "Pionix",
"ConnectorEvseIds": "DE*PNX*100001,DE*PNX*100002",
"AllowChargingProfileWithoutStartSchedule": false,
"WaitForStopTransactionsOnResetTimeout": 60,
"QueueAllMessages": true,
"MessageTypesDiscardForQueueing": "Heartbeat",
"MessageQueueSizeThreshold": 5000,
"SupportedMeasurands": "Energy.Active.Import.Register,Energy.Active.Export.Register,Power.Active.Import,Voltage,Current.Import,Frequency,Current.Offered,Power.Offered,SoC",
"MaxMessageSize": 65000,
"TLSKeylogFile": "/tmp/ocpp_tls_keylog.txt",
"EnableTLSKeylog": false
},
"Core": {
"AllowOfflineTxForUnknownId": true,
"AuthorizationCacheEnabled": true,
"AuthorizeRemoteTxRequests": true,
"BlinkRepeat": 0,
"ClockAlignedDataInterval": 900,
"ConnectionTimeOut": 120,
"ConnectorPhaseRotation": "RST0.RST,1.RST,2.RTS",
"ConnectorPhaseRotationMaxLength": 100,
"GetConfigurationMaxKeys": 1024,
"HeartbeatInterval": 900,
"LightIntensity": 0,
"LocalAuthorizeOffline": true,
"LocalPreAuthorize": true,
"MaxEnergyOnInvalidId": 500,
"MeterValuesAlignedData": "Energy.Active.Import.Register",
"MeterValuesAlignedDataMaxLength": 1024,
"MeterValuesSampledData": "Energy.Active.Import.Register",
"MeterValuesSampledDataMaxLength": 1024,
"MeterValueSampleInterval": 300,
"MinimumStatusDuration": 2,
"NumberOfConnectors": 2,
"ResetRetries": 1,
"StopTransactionOnEVSideDisconnect": true,
"StopTransactionOnInvalidId": true,
"StopTxnAlignedData": "Energy.Active.Import.Register",
"StopTxnAlignedDataMaxLength": 1024,
"StopTxnSampledData": "Energy.Active.Import.Register",
"StopTxnSampledDataMaxLength": 1024,
"SupportedFeatureProfiles": "Core,FirmwareManagement,RemoteTrigger,Reservation,LocalAuthListManagement,SmartCharging",
"SupportedFeatureProfilesMaxLength": 1024,
"TransactionMessageAttempts": 1,
"TransactionMessageRetryInterval": 10,
"UnlockConnectorOnEVSideDisconnect": true,
"WebsocketPingInterval": 10
},
"LocalAuthListManagement": {
"LocalAuthListEnabled": true,
"LocalAuthListMaxLength": 1024,
"SendLocalListMaxLength": 1024
},
"SmartCharging": {
"ChargeProfileMaxStackLevel": 1000,
"ChargingScheduleAllowedChargingRateUnit": "W,A",
"ChargingScheduleMaxPeriods": 1000,
"ConnectorSwitch3to1PhaseSupported": true,
"MaxChargingProfilesInstalled": 1000
},
"FirmwareManagement": {
"SupportedFileTransferProtocols": "FTP"
},
"Reservation": {
"ReserveConnectorZeroSupported": false
},
"Security": {
"AdditionalRootCertificateCheck": false,
"AuthorizationKey": "DEADBEEFDEADBEEF",
"CertificateSignedMaxChainSize": 10000,
"CertificateStoreMaxLength": 1000,
"CpoName": "Pionix",
"SecurityProfile": 1,
"DisableSecurityEventNotifications": true
},
"PnC": {
"ISO15118PnCEnabled": true,
"CentralContractValidationAllowed": true,
"CertificateSignedMaxChainSize": 10000,
"CertSigningWaitMinimum": 30,
"CertSigningRepeatTimes": 2,
"CertificateStoreMaxLength": 1000,
"ContractValidationOffline": true
},
"CostAndPrice": {
"CustomDisplayCostAndPrice": true,
"NumberOfDecimalsForCostValues": 4,
"DefaultPrice":
{
"priceText": "This is the price",
"priceTextOffline": "Show this price text when offline!",
"chargingPrice":
{
"kWhPrice": 3.14,
"hourPrice": 0.42
}
},
"DefaultPriceText":
{
"priceTexts":
[
{
"priceText": "This is the price",
"priceTextOffline": "Show this price text when offline!",
"language": "en"
},
{
"priceText": "Dit is de prijs",
"priceTextOffline": "Laat dit zien wanneer de charging station offline is!",
"language": "nl"
},
{
"priceText": "Dette er prisen",
"priceTextOffline": "Vis denne pristeksten når du er frakoblet",
"language": "nb_NO"
}
]
},
"TimeOffset": "02:00",
"NextTimeOffsetTransitionDateTime": "2024-01-01T00:00:00",
"TimeOffsetNextTransition": "01:00",
"CustomIdleFeeAfterStop": false,
"MultiLanguageSupportedLanguages": "en, nl, de, nb_NO",
"CustomMultiLanguageMessages": true,
"Language": "en"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE VARIABLE
DROP COLUMN SOURCE;
2 changes: 2 additions & 0 deletions config/v201/device_model_migrations/2_up-variable_source.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE VARIABLE
ADD COLUMN SOURCE TEXT;
Loading

0 comments on commit 17fd4b4

Please sign in to comment.