Skip to content

Certification pre-check

OCPPSim ships a pre-certification scenario set: it plays the Charging Station against your CSMS and walks through situations that the OCA conformance test cases for the CSMS side also cover. Use it to find gaps before you book a certification slot.

A pre-check, not a certification

Passing the pre-check means only that your CSMS behaved as OCPPSim's own scenarios expect. It is not an OCA test, says nothing about a certification result and does not replace the OCA Compliance Test Tool or a test lab.

The set references the OCA test case IDs (for example TC_003_CSMS) for traceability. Titles, steps and coverage notes are OCPPSim's own; no OCA test text is included. Read the official test case document from the OCA for what each case really checks.

What is in it

scenarios/cert/index.yaml lists every CSMS-side test case ID of a suite with its profile and a coverage status:

Status Meaning
covered A scenario exists and --suite runs it
partial A scenario exists but needs a special charger config or covers only part of the case; run it by file
not_covered No scenario (the reason says why)

Suite cert/1.6 (OCPP 1.6, 77 case IDs): 64 covered, 13 partial, 0 not covered. Profiles: core, cache, local_auth_list, firmware, reservation, remote_trigger, smart_charging, data_transfer, security. Security (7 covered, 8 partial): certificate install / list and the invalid certificate security events are covered (TC_077_CSMS needs a CSMS that signs the CSR); the AuthorizationKey update, certificate renewal, Basic auth and TLS cases are partial, since they need the charger's security_profile, password, ca_file or client certificate; TC_076_CSMS runs its SHA256 / SHA384 / SHA512 rounds (scenario op set_variable OCPPSim.CertificateHashAlgorithm); TC_088_CSMS is partial (charger offered_subprotocols: [ocpp0.1], the CSMS must refuse the connection). TC_079_CSMS (GetLog) and TC_080_CSMS (SignedUpdateFirmware) are covered; TC_081_CSMS is partial (charger maintenance.fail_signature: true: the simulator checks no signature). TC_083_CSMS (SecurityProfile upgrade) is partial: a profile 2 charger with a client certificate renewed through SignCertificate, a CSMS that sends ChangeConfiguration SecurityProfile 3 and a Hard Reset, then refuses the old profile (Mini CSMS tls.client_cert: optional, refuse_profile_downgrade: true); the 1 -> 2 upgrade needs the charger's security_profile_urls and is not run against the Mini CSMS. ConnectionTimeOut (TC_004_2 / TC_011_2), the power loss (TC_032_1, scenario op power_loss) and offline transactions (TC_037_1 / TC_037_3 / TC_039, AllowOfflineTxForUnknownId set by the scenario) are covered.

Suite cert/2.0.1 (OCPP 2.0.1, 251 case IDs): 213 covered, 27 partial, 11 not covered. Per functional block (covered / partial / not covered):

Block Profile Covered Partial Not covered
A security 1 10 2
B provisioning 20 2 0
C authorization 11 2 3
D local_auth_list 6 0 0
E transactions 27 0 0
F remote_control 14 1 0
G availability 10 0 0
H reservation 9 0 0
I tariff_cost 2 0 0
J meter_values 9 0 0
K smart_charging 27 0 5
L firmware 10 9 0
M certificates 14 3 1
N diagnostics 30 0 0
O display 21 0 0
P data_transfer 2 0 0

v0.4 leftovers: TC_E_29/31/33_CSMS are covered with the impairment hold_queue (the station keeps its queued TransactionEvents back after the reconnect, so GetTransactionStatus sees them); TC_N_29_CSMS (impairments.answer CustomerInformation Rejected), TC_K_15_CSMS (impairments.block SetChargingProfile NotSupported) and TC_L_13_CSMS (UpdateFirmware during a transaction: the install waits for its end) are covered; TC_B_58_CSMS is partial (charger offered_subprotocols: [ocpp0.12]). TC_M_21_CSMS checks that the deleted hash is the one reported (scenario save:).

v0.4 leftovers (2): TC_B_30_CSMS (the station sends CALLs itself while the boot is Pending / Rejected; the CSMS must answer SecurityError, the Mini CSMS does so while Rejected, B03.FR.07) and TC_B_31_CSMS (TriggerMessage BootNotification while Pending) are covered; TC_C_40/43_CSMS (two tokens of one group, C09: a token with the same groupIdToken stops the transaction), TC_C_47/49_CSMS (master pass: AuthCtrlr.MasterPassGroupId; the station has no UI and stops every transaction, C16.FR.02; a charger with 2 connectors) and TC_H_19_CSMS (ReserveNow with a groupIdToken) are covered, TC_C_48_CSMS is covered (v0.6): the scenario op master_pass stands in for the station UI, so the master pass stops only the selected transaction on a charger with 2 connectors (StopAuthorized / MasterPass). TC_E_38_CSMS is covered with set_ev (an almost full EV that stops drawing power: SuspendedEV).

v0.4 leftovers (3): TC_C_20_CSMS is covered (the scenario op cache_token puts the token into the Authorization Cache as Accepted; with LocalPreAuthorize the station starts on it without an Authorize and the CSMS must answer the TransactionEvent with Invalid; the station updates its cache, C10.FR.05). TC_N_48_CSMS is covered with OCPPSim.WriteOnlyProbe, a harmless WriteOnly variable nothing reads (its events carry an empty actualValue, N07.FR.10). TC_E_11/J_04/J_11_CSMS are covered (v0.6): they need the charger's meter.signed: true, which signs the energy register readings as OCMF with ECDSA-secp256r1-SHA256 (the scenarios check signingMethod and encodingMethod; TxStartPoint DataSigned then starts with SignedDataReceived). TC_A_19_CSMS is partial: the station now switches to the first NetworkConfigurationPriority slot at a Reset and goes back to the previous slot when it cannot connect (B10), but the upgrade needs an endpoint for the higher profile and a CSMS that refuses the old one. The only cases left not covered are ISO 15118 / V2G (10) and TLS below 1.2 (TC_A_06_CSMS).

v0.4 functional blocks: TC_B_44_CSMS is partial (the simulator answers Failed only for configurationSlot 1, the slot in use); TC_I_02_CSMS needs a CSMS that returns totalCost for the Ended event (the Mini CSMS with mini_csms.cost_per_kwh). v0.4 display messages and publish firmware: the 21 TC_O cases are covered (the station-side settings they need, e.g. DisplayMessageCtrlr.SupportedPriorities or Enabled, are set by the scenario op set_variable); TC_L_17/21/22_CSMS are covered and TC_L_19/20/23/24_CSMS partial (they need maintenance.fail_checksum, fail_publish, fail_download or a long download_s). TC_J_01/02_CSMS are covered (v0.5): each clock-aligned MeterValues is followed by a Periodic FiscalMetering NotifyEvent (variable EnergyImportRegister, an interpretation: the cases name only the component and the trigger).

Security (A), certificate management (M) and secure firmware (L) cases: the Basic auth / TLS cases are partial, since they need the charger's security_profile, password, ca_file and client certificate (each case's reason names what); certificate install / list / delete and the signed firmware answers are covered (TC_M_20_CSMS runs its SHA256 / SHA384 / SHA512 rounds), except the partial TC_M_24/26/28_CSMS (see below). TC_A_02_CSMS is partial: it needs the charger setting basic_auth_user (a username other than the charger id). TC_L_06_CSMS needs --param request_id (the CSMS's UpdateFirmware requestId); TC_L_02/03_CSMS (future installDateTime / retrieveDateTime) are covered; TC_L_08_CSMS needs maintenance.fail_install_verification: true and TC_L_11_CSMS maintenance.uncancellable: true with a download_s long enough for the second UpdateFirmware. Real firmware signature verification is implemented with maintenance.real_transfer: true (v0.6: the file is downloaded over HTTP(S) and its signature checked against the signing certificate); otherwise it is simulated: every signature is taken as valid and maintenance.fail_signature stands in for a failed check; TC_M_24/26/28_CSMS are partial too: they need real OCSP / EXI request data. To self-test them against the Mini CSMS use its optional mini_csms.tls and mini_csms.signing.

Not covered in 2.0.1 (11): the ISO 15118 cases (TC_C_50/51/52_CSMS, TC_K_53/55/57/58/59_CSMS), TLS below 1.2 (TC_A_06_CSMS) and the V2G certificate chain (TC_A_12_CSMS, TC_M_15_CSMS). Signed meter values are real OCMF signatures since v0.6 (meter.signed). v0.4 variable monitoring: 16 TC_N cases are covered (the station's hard-wired monitor on ChargingStation.Problem and pre-configured one on ChargingStation.Power serve the report and alert cases; TC_N_17_CSMS disables MonitoringCtrlr so SetMonitoringLevel is Rejected; TC_N_18_CSMS sets ItemsPerMessage[ClearVariableMonitoring] to 2; TC_N_49_CSMS uses a CSMS Reset as the reboot; TC_N_24/49/50_CSMS have no CSMS SetVariableMonitoring step, so their monitor is pre-configured at the station with the scenario op set_monitor). TC_N_48_CSMS stays not covered (the only WriteOnly variable, BasicAuthPassword, reconnects the station when it changes). TxStartPoint / TxStopPoint / StopTxOnEVSideDisconnect are station settings (v0.4): the start / stop point cases set them with the scenario op set_variable. TC_E_11_CSMS (DataSigned) is covered with meter.signed: true. Also station settings (v0.4): clock-aligned meter values (AlignedDataCtrlr.Interval, TC_J_01..03_CSMS), DeviceDataCtrlr.ItemsPerMessage (TC_B_08_CSMS); EVSE-level Reset is answered (TC_B_25..27_CSMS) and the scenario op external_limit plays the external (EMS) control signal (TC_K_48/50/51/52_CSMS). TC_J_04_CSMS (signed) is covered with meter.signed: true (v0.6).

Running it

Most cases wait for a request from the CSMS (RemoteStartTransaction, Reset, ReserveNow ...). The scenario then shows an operator prompt in the status and the event log, for example From the CSMS: send Reset to CP001 now (type Hard), and waits up to operator_within (default 10 minutes). Trigger it in your CSMS (UI or API).

  1. Write a config with one OCPP 1.6 charger pointed at your CSMS. Use auth_mode: csms_only so the charger sends Authorize, and ReserveConnectorZeroSupported: true in config_keys for TC_049_CSMS.
  2. Run the suite (--param cp= names the charger, default CP1):
sme-ocpp-sim scenario run --suite cert/1.6 -c precheck.yaml --param cp=CP001 --out verdict.json --junit junit.xml
sme-ocpp-sim scenario run --suite cert/1.6 --profile core,reservation -c precheck.yaml --param cp=CP001
sme-ocpp-sim scenario validate --suite cert/1.6 -c precheck.yaml --param cp=CP001

Each covered case runs on a freshly started engine (a fresh boot of the charger), one after another. The output:

  • --out: the suite verdict (format: ocppsim-suite-verdict/1): result (pass only when every run case passed), counts, and per case id, profile, status, result (pass / fail / incomplete / error / skipped), the first problem as message and the full scenario verdict.
  • --junit: one test case per test case ID; partial and not covered cases are skipped with the reason.
  • Exit code 0 pass, 1 fail, 2 error or aborted, 3 incomplete (no operator: see below).

Partial cases ship but the suite never runs them (they appear as skipped in the verdict and JUnit). Enable the setting their reason in the index names (for example maintenance.fail_download: true) and run the file on its own. A case that cannot run at all (engine start failure) is recorded as error and the suite goes on; exit 2 before anything runs means a setup problem (unknown suite or profile, unreadable index, or no covered case in the selection). --param values are text (tag=0123 stays "0123"), unless the parameter's default is a number or bool.

For cert/2.0.1 use one OCPP 2.0.1 charger with auth_mode: csms_only and run scenario run --suite cert/2.0.1 -c precheck201.yaml --param cp=CP001. Its prompts name the 2.0.1 messages (RequestStartTransaction, SetVariables, GetBaseReport ...). Partial 2.0.1 cases name the Device Model variable to set first (for example AuthCtrlr.AuthorizeRemoteStart=true via SetVariables from your CSMS).

One case alone, or a partial one: run its file, e.g. scenario run scenarios/cert/1.6/TC_013_CSMS.yaml --param cp=CP001.

No operator and the operator hook

A step that waits for a CSMS request and sees no CALL of that action at all in its window ends as no_operator (nobody triggered it), not fail; a CALL of that action with an unexpected payload is still fail. A case with a no_operator step and no failed step is incomplete: in the suite verdict it is counted on its own (counts.incomplete), JUnit reports it as <skipped message="no operator: ...">, the summary line shows the count, and the suite result is incomplete (exit code 3) when nothing failed or errored. Precedence: error > fail > incomplete > pass. Like a failure, no_operator stops the case (later steps are skipped).

To run the suite without a person, configure an operator hook: a local command and / or a URL that gets one JSON object per event and triggers the request in your CSMS (through its API).

operator_hook:
  exec: [python, tools/trigger.py]   # argv list; the event JSON on stdin; same working directory
  url: http://127.0.0.1:8099/hook    # HTTP POST, Content-Type application/json
  timeout_s: 30                      # per call (default 30)
sme-ocpp-sim scenario run --suite cert/1.6 -c precheck.yaml --param cp=CP001 \
  --operator-exec "python tools/trigger.py" --operator-url http://127.0.0.1:8099/hook --operator-timeout 20

The flags override the config field by field. --operator-exec splits like a shell (no shell runs); on Windows backslashes stay and an argument may be wrapped in double quotes as a whole, but a quote inside an argument is not supported: use the exec argv list of the config then. The web UI does not edit operator_hook: edit the YAML (saving the config from the web UI keeps the block). Events:

  • await_csms, when such a step starts: {"event": "await_csms", "suite": "cert/1.6", "case": "TC_013_CSMS", "step": "4", "track": "precheck", "cp": "CP001", "ocpp_version": "1.6", "action": "RemoteStartTransaction", "match": {"idTag": "TAG1"}, "prompt": "...", "params": {...}, "within_s": 600, "window": "wall"} (match = the expected payload as in the scenario, references resolved; suite is null outside a suite). The hook runs beside the wait: the step's window starts with the step, not when the hook returns.
  • before_case, before each suite case (awaited, bounded by timeout_s): {"event": "before_case", "suite": ..., "case": ..., "cp": ..., "ocpp_version": ..., "params": {...}}. Use it to reset the CSMS state between cases (for example end a transaction a timed-out case left open, which would make the next case get ConcurrentTx).

A hook that exits non-zero, times out, cannot start or gets an HTTP error is noted in the step message (hook: ...) and logged; it never fails the step by itself. A hook may answer (stdout, or the response body) with {"skip": "reason"} when the action cannot be triggered automatically: the step ends at once as no_operator with that reason instead of waiting out its window.

Security: exec runs a local command you configured, without a shell. Nothing received from the CSMS is put into its argv; the event goes to stdin only. The hook also runs for scenarios started from the web UI / REST API when the config has operator_hook.

Operator drivers

scripts/operator_drivers/ holds example operator drivers for SteVe (steve.py) and CitrineOS (citrineos.py). They are examples for one local test installation each, not part of the installed package. Wire one up with:

operator_hook:
  exec: [python, scripts/operator_drivers/steve.py]   # run from the repository root

On await_csms the driver makes the CSMS send the command; on before_case it resets the CSMS state the previous case left behind. On a real CSMS the state must be reset between cases, otherwise a leftover transaction or reservation fails the next case. The drivers read credentials from environment variables, and before_case changes data in the CSMS under test (it ends transactions, cancels reservations, ...): use a test installation, never a CSMS with real data. Usage, settings and limits of each driver: README.

TC_E_38_CSMS (2.0.1): the SuspendedEV message comes only after about 1100 sim seconds (SoC 97 to 100), so the scenario runs its sim clock at 120x (clock.time_scale); with --time-scale 1 it needs --param reply_within=20m.

Parameters

Parameter Default Used for
cp CP1 The charger id of your config
tag TAG1 The id tag; your CSMS must accept it
invalid_tag / expired_tag / blocked_tag INVALID-TAG ... TC_023_*: tags your CSMS answers Invalid / Expired / Blocked
operator_within 10m How long a step waits for a CSMS request
reply_within 30s How long a step waits for a charger message and its answer
heartbeat_within, firmware_within, expire_within 10m, 10m, 15m Heartbeat, firmware / diagnostics status, reservation expiry
log_within, meter_within (2.0.1) 10m Log upload status, periodic meter values
group_tag (2.0.1) TAG2 TC_C_39_CSMS: a second token of the same group as tag
vendor_id, message_id (2.0.1) org.ocppsim.precheck, Probe TC_P_02_CSMS / TC_P_03_CSMS: a vendor your CSMS does not know

Answers the simulation would not give

Some cases need the charger to answer with a particular status (UnlockFailed, Rejected, NotSupported ...). The scenarios set the impairment answer for that action (a fixed CALLRESULT payload, the handler does not run) and clear it once the answer has gone out. The payload is checked against the action's response schema. The handler is bypassed, so a fixed Accepted changes nothing in the simulated charger (no reset, no reservation ...). You can use it in your own scenarios too:

- {do: impair, impairments: {answer: {UnlockConnector: {status: UnlockFailed}}}}

Web UI

Simulation → Pre-check (cert suites) opens the pre-check page. It runs the suite inside the running app against the configured chargers and CSMS, with the same semantics as scenario run --suite (parameters, the operator hook's before_case event, the suite verdict with its counts incl. incomplete). The app's engine keeps running, so instead of a freshly started engine each case first ends what an earlier case left on its chargers (stops transactions, unplugs, clears faults) and waits until their frames settle. A transaction is ended whatever TxStopPoint says (Ended, StopAuthorized / Local), also one that was stopped after its cable was pulled and waits for a cable event. One pre-check or scenario runs at a time.

So that a case does not see what an earlier one changed on the station (e.g. TC_004_2's ConnectionTimeOut=5 expiring TC_011_1's wait for the cable), each case starts from the station's state when it was first used by a pre-check while online and idle. That baseline is saved at the first case that finds the charger online (boot accepted) with no transaction; until then nothing is restored. It is not kept for later runs: at the end of each run the stations are put back to their state at the start of the run (also after an abort), and every run takes a fresh baseline at its first case (online and idle), so changes you make between runs are kept. Before every later case, once no transaction is left, it is put back; if a transaction is still open, the restore is skipped for that case (logged).

  • Reset between cases: the 1.6 configuration keys; the 2.0.1 / 2.1 device-model variables (all attribute values of the writable ones, and of the ReadOnly ones set via set_variable / configure since the station was built, e.g. TxCtrlr.TxStopPoint, except the credentials below; the other ReadOnly ones are derived from the station's state) and variable monitors, restored without a NotifyEvent; charging profiles installed by the CSMS; the local authorization list and its version, the authorization cache; connector / EVSE and station availability (Inoperative back to Operative, with its StatusNotification); 2.0.1 / 2.1 display messages; installed CA certificates; a 1.6 SecurityProfile change waiting for a Reset; 2.1 DER controls, periodic event streams, default tariffs, allowed energy transfer and the AFRR signal. Reservations made after the baseline are dropped without a ReservationStatusUpdate. The baseline normally has no reservation, and one cancelled after it is not re-created. A changed setting's listener runs as after an accepted ChangeConfiguration / SetVariables (e.g. a new heartbeat interval takes effect). Also undone: a firmware update or log upload an earlier case left running (it is cancelled; the cancel waits while an update is installing, so the station does not reboot during the next case), a case's impair step (the charger's impairments go back to what they were when the run reached it, before the next case and at the end of the run, also after an abort; e.g. TC_E_31's hold_queue; an impairment edit made in the UI during a pre-check is overwritten too), an unused set_ev, external_limit (it is a charging profile), set_monitor, cache_token and the simulator-only certificate hash setting.
  • Not reset: the connection's credentials and network settings, because the CSMS now expects the new ones and reverting them would lock the charger out. In 1.6 these are AuthorizationKey and SecurityProfile. In 2.0.1 / 2.1 they are SecurityCtrlr.SecurityProfile, SecurityCtrlr.BasicAuthPassword, OCPPCommCtrlr.NetworkConfigurationPriority and the network profiles set by SetNetworkProfile. The client certificate installed by CertificateSigned is also kept. Not reset either: the security event log (history, not settings); the energy register and transaction ids, which keep counting as on a real charger; simulation switches set by the user (DataTransfer answers); a disconnect step (the next case's first step waits for the charger to be online; drop and power_loss reconnect by themselves); the CSMS's own state (reset it with the operator hook's before_case event).
Area What it does
Top bar Suite (cert/1.6, cert/2.0.1), mode (Auto runs straight through, Step pauses before every step; switchable while it runs), Run selected / Run all (every covered case), Abort, downloads of the suite verdict JSON and JUnit XML.
Parameters The suite parameters with their defaults (cp, tag, reply_within, operator_within; the rest under More parameters). Only the values you change are sent; cp starts with a configured charger of the suite's OCPP version.
Next banner Per track of the running case: who acts (Station (OCPPSim) / CSMS / Operator / EV), what (the diagram label or the operator prompt) and the time left of the step window. Step mode: Next step. An operator step: Done in CSMS (only acknowledges, the CSMS command is still awaited) and Skip step (ends the step as no_operator now: the case becomes incomplete).
Case list Every case with a checkbox (only covered cases run), filters by functional block / profile, coverage status and text, and live results: pass, fail, incomplete (no operator), error, not run, running. Clicking a case shows it; Follow the running case switches back.
Diagram The case's sequence diagram (the same SVG as the published pages). Steps are marked done / failed / no operator / running / next; click a step for its details.
Steps and details The step records of the case. A click opens expected (the step as planned, parameters filled in) beside actual (status, message and the evidence frames from the frame log).

Pre-check page: a running case with its sequence diagram and the Next banner waiting for the operator

Step mode: paused before the next step

Step details: expected beside actual with the evidence frame

Step mode is for walking through a case: a step's window (within) starts when you press Next step and frames that arrived during the pause still count, but absolute sim-time at: steps and the CSMS's own timers keep running while it is paused. A pre-check is refused (409) while the traffic generator runs, and the traffic generator cannot start while a pre-check runs.

The same is available over REST (/api/precheck/suites, /cases?suite=, /diagram?suite=&case=, POST /run, /current, POST /next, POST /mode, POST /operator, POST /abort, /step, /result?format=json|junit) and as MCP tools (list_precheck_suites, list_precheck_cases, run_precheck, get_precheck_status, precheck_next_step, precheck_operator, precheck_set_mode, get_precheck_step, abort_precheck, get_precheck_result).

Sequence diagrams

To see how a case runs before you run it, draw it as a sequence diagram. The diagram comes from the case's scenario YAML only: the lanes are the operator (highlighted), the CSMS, the station and, for plugging in or presenting a token, the EV / user. Solid arrows are CALLs, dashed arrows answers or the operator trigger of an await_csms step, boxes are state checks, waits and local actions; step ids are in the left margin and ≤ is the time a step waits.

The diagrams of every case are published with these docs: OCPP 1.6 suite and OCPP 2.0.1 suite. Each case has its own anchor, e.g. cert-2.0.1.html#TC_A_09_CSMS. To draw a case yourself (for example after editing its YAML):

sme-ocpp-sim scenario diagram --suite cert/2.0.1 --format html --out cert-2.0.1.html
sme-ocpp-sim scenario diagram scenarios/cert/2.0.1/TC_A_09_CSMS.yaml            # Mermaid to stdout
sme-ocpp-sim scenario diagram --suite cert/1.6 --format json --out diagrams-1.6/  # one file per case + index

The published pages are regenerated with --out docs/assets/precheck/ for each suite; a test fails when they are out of date.

Not drawn: until / clock, save, send timeouts and from. Parallel tracks are drawn one after another under section headers, and a repeat track's steps are drawn once. A step with on_fail: continue is marked so. When no later step checks the answer to a CALL, a dashed "answer (not checked)" is drawn.

--format html (one static page per suite: the case list with our titles and statuses, every diagram as inline SVG, no scripts), mermaid (default) or json (the neutral model). With --suite, mermaid / json write one file per case plus an index into the --out folder. A Mermaid example (shortened):

sequenceDiagram
    actor P0 as Operator
    participant P1 as CSMS
    participant P2 as Station CP1
    Note over P2: [1] check: online=true (≤1m)
    P0--)P1: [2] trigger: From the CSMS: send SetVariables to CP1 now (...)
    P1->>P2: [2] SetVariables {name: BasicAuthPassword} (≤10m)
    P2-->>P1: [3] SetVariables CALLRESULT {attributeStatus: Accepted} (≤30s)

Packaging

The suites ship with every build (wheel, Windows exe, Docker image) under the built-in scenario folder, in their own cert/ subfolder, so they can later be split into a separate pack.