Backend, Plug and Charge and payment test cases

Fourteen illustrative test cases between charger and backend: boot, authorization accepted and rejected, remote start, transactions, meter values and signed meter values, offline behaviour, firmware update, charging profiles, certificate installation for Plug and Charge, expired certificates and payment, citing OCPP use cases by name.

About these test cases

Most of these test cases run in the analyzer: name each capture after its test case and the Batch page or the command line says pass, fail or inconclusive per file. See Running test cases.

These test cases are this tool's own illustrative plan, written from the public descriptions of the standards. They are not copies of any standard's test suite, and passing them does not make a product conformant or certified. For certification, use the official test suite and an accredited or authorised lab.

OCPP names its behaviour as use cases grouped in functional blocks (Provisioning, Authorization, Transactions, Remote Control, Meter Values, Smart Charging, Firmware Management, ISO 15118 Certificate Management and others). The cases below cite those use cases by name. For certification, the Open Charge Alliance tests with OCTT at authorised labs, against the certification profiles a product claims: Core is mandatory for OCPP 2.0.1, and Advanced Security, Smart Charging, ISO 15118 Support and Local Authorization List Management are options.

Common setup: the charging station under test, a CSMS or CSMS simulator whose log is kept, a car or EV simulator, and a way to cut the network. For the Plug and Charge cases, a test PKI with valid, expired and revoked certificates.

Start up and authorization

Id and purposePreconditionsTest bodyExpected result and pass criteriaOCPP use caseObserved by
BE-01 BootStation powered off; CSMS answers Accepted, then Pending, then Rejected in three runs.Power on.Accepted: the station reports connector status and starts its heartbeat. Pending and Rejected: no charging is offered, and the station sends BootNotification again after the interval the CSMS gave.Cold Boot Charging Station; the Pending and Rejected variantsOC-06, OC-01; OCPP tab: messages and statuses
BE-02 Authorization acceptedCard known to the CSMS. ISO 15118 car with EIM.Plug in; present the card while the car polls Authorization.Authorize answered Accepted; the charger turns Authorization from Ongoing to Finished; the loop stays below the ongoing timeout.EV Driver Authorization using RFID; Authorization at EVSE using ISO 15118 External Identification MeansTIM-02, SQ-05; OCPP tab
BE-03 Authorization rejectedCard unknown or blocked.As BE-02.Authorize answered Invalid or Blocked; the charger ends the V2G session instead of holding the car at Ongoing; no energy.EV Driver Authorization using RFIDTIM-02, XL-04; OCPP tab. Demo ocpp-rejected
BE-04 Remote startApp or CSMS operator starts; once with the cable plugged first, once with the remote start first.Send the remote start; plug in where needed.Transaction starts on the right EVSE; status Charging and the transaction start follow the start of energy transfer.Remote Start Transaction, Cable Plugin First; Remote Start Transaction, Remote Start FirstOCPP tab: alignment with PowerDeliveryRes

Transactions and metering

Id and purposePreconditionsTest bodyExpected result and pass criteriaOCPP use caseObserved by
BE-05 Transaction eventsBE-02 passed.Charge 10 minutes, stop from the car, unplug.Started, Updated and Ended events (StartTransaction and StopTransaction in 1.6) with the right trigger and stop reason; energy in the transaction equals the meter difference; the stop follows the end of the V2G session.Start Transaction, Cable Plugin First; Stop Transaction options; End of charging processOC-07 (2.0.1) or OC-08 (1.6), OC-02, PW-06, XL-01, XL-02, XL-05; CDR-01 to CDR-03 with the OCPI CDR; OCPP tab: transactions and alignment; PW-04
BE-06 Meter values and signed meter valuesPeriodic meter values configured; station with a signing meter where claimed.Charge 30 minutes.Meter values at the configured interval; readings never go backwards; signed values verify against the meter public key and match the unsigned values. With ISO 15118-2, the car signs a metering receipt when the charger asks for one.Sending transaction related Meter ValuesPW-04, PW-06, SQ-10, OC-01, XL-03, SM-01 to SM-03; OCPP tab: signed meter values
BE-07 Offline while idleLocal authorization list or cache filled; network cut.Present a known card, then an unknown card.Known card: charging starts as configured. Unknown card: handled as the offline setting says. After reconnecting, the station reports what happened.Offline Behavior Idle Charging Station; Offline Authorization through Local Authorization List; Offline Authorization of unknown IdOCPP tab after reconnect
BE-08 Loss of internet during a transactionBE-05 running.Cut the network for 10 minutes, then restore it.Charging continues on the cable side; queued transaction messages arrive after reconnect in order with their original timestamps.Connection Loss During Transaction; Transaction stopped while Charging Station is offlineOCPP tab; the V2G session keeps running in the capture

How signed meter values are formatted and verified depends on the meter and the legal metrology scheme (for example the Eichrecht in Germany or NIST Handbook 44 in the US). Take the verification rule from the meter maker and Billing and measurement testing.

Management and smart charging

Id and purposePreconditionsTest bodyExpected result and pass criteriaOCPP use caseObserved by
BE-09 Firmware updateA signed firmware image, and one with a broken signature.CSMS requests the update with each.Valid image: status notifications through download, verification and installation, then a boot. Broken signature: the station refuses to install and reports why.Secure Firmware UpdateOCPP tab
BE-10 Charging profileCharging session running (AC or DC).CSMS sets a charging profile that lowers the limit, then clears it.The composite schedule reflects the profile; the cable side follows it (PWM, EVSEMaxCurrent or an ISO 15118 schedule); PowerDelivery uses a schedule tuple the charger sent.SetChargingProfile; Get Composite Schedule; Clear Charging Profile; Charging with load leveling based on High Level CommunicationPW-01, SQ-08

Plug and Charge and payment

Id and purposePreconditionsTest bodyExpected result and pass criteriaOCPP use caseObserved by
BE-11 Contract certificate installationCar without a contract certificate; test PKI reachable from the CSMS.Car sends CertificateInstallationReq.The charger forwards the request, returns the answer within the longer message timeout, and the car can use the contract in the next session.Certificate installation EVTIM-01, SQ-05
BE-12 Plug and Charge authorizationValid contract certificate in the car.Plug in.Contract chain validated; authorization finishes; transaction references the contract.Authorization using Contract CertificatesSQ-05, TIM-02; OCPP tab
BE-13 Expired certificatesRun 1: expired contract certificate. Run 2: expired charger (SECC) certificate.Plug in.Run 1: the charger refuses the contract (ISO 15118-2 FAILED_CertificateExpired) and no energy flows. Run 2: the car aborts TLS with certificate_expired and no session starts.Authorization using Contract Certificates; Get V2G Charging Station Certificate statusSQ-05; PK-01, TL-01. Demo pnc-expired
BE-14 Payment at the chargerPayment terminal or card reader on the station.Pay by card, charge, stop; then cancel before start.Transaction authorised by the card; final cost shown; a cancelled start leaves no charge on the card.Authorization using credit/debit card; in OCPP 2.1 also the local payment terminal and settlement use casesOCPP tab

Payment terminals need approvals from the payment industry as well: charger makers such as Kempower and ChargePoint describe their terminals as EMV certified and PCI compliant. The test procedures of these schemes were not researched for this article. See Payment, roaming and Plug and Charge.

In this tool

Load the OCPP-J log of the charger with the capture. The OCPP tab shows the connector status, the transactions with their metered energy, the backend errors and slowest answer, and the backend view against the cable: status Charging and the transaction start after PowerDeliveryRes, the stop after SessionStopReq. The OC checks hold every message against the OCA JSON schema of its version (OCPP 1.6, 2.0.1 or 2.1, told from the messages) and the framing against OCPP-J: every call answered in time, one call at a time, defined error codes, unique message ids, the boot accepted first, and the transaction events in order. The XL checks hold the view of the backend against the cable: charging reported when the energy transfer starts and stops, the energy billed against the meter readings sent to the car, no energy after a rejected ID, and a stop reason that matches how the session ended. OCPP never changes the verdict, so the cable side is judged the same with or without the log. The TLS tab draws the certificate chain for BE-13. The demos ac-ok and ocpp-rejected carry an OCPP log.

Sources