Giter Site home page Giter Site logo

injector-binding-rs's Introduction

injector-binding-rs inject RPC request into afb-v4 framework

This injector initial objective addresses ISO15118/OCPP simulation for charger and/or electric vehicle. Nevertheless nothing is specific to EV/EVSE and it may test/simulates any API based on Afb-V4 framework.

The injector/simulator implements one api/verb per configure scenario. At the end of the test it return a normalized TAP response, that hopefully should integrated easily within any CI/CD model.

Dependencies

  • serde
  • serde_json

optional Dependencies

  • afbv4

'afb-librust' should be install on your system.

/usr/lib/rustlib/%{_arch}-unknown-linux-gnu/lib/libafbv4.rlib

For development purpose, you can use an external libafbv4. To activate it, as a feature, you can execute:

cargo add --git https://github.com/redpesk-common/afb-librust afbv4 --optional

And build with the features "afbv4"

cargo build --features afbv4

You can also directly edit the file Cargo.toml, and manually change it.

Configuration

Configuration relies on standard binding/binder json/yaml config file. The injector create a new verb per scenario. When executing a scenario, client receives an event per action. At the end of the test client may request scenario global status that is then return as Json/TAP.

Scenario metadata should define:

  • uid: which define the api/verb to start/stop/check the execution
  • info: a simple free comment
  • target: the API to be tested. Depending on config, this might be local or remote API.
    scenarios:
      - uid: scenario-1
        info: simple iso2 connection scenario
        target: iso2
        transactions:

Scenarion transactions should defined:

  • uid: test name
  • verb: injector call $target/$test (when not defined: derives from UID as: uid-sample->uid_sample_req)
  • delay: wait in ms before starting the test
  • query: param value to be added to test/api/verb
  • response: optional expected response (test only defined values). When not defined injector relies on RPC status to set OK/FX test result.
        transactions:
        - uid: sdp-evse
          query:
            action: discover
        - uid: iso2-handshake
          verb: app_proto_req

Note: scenario/start verb does not wait the end of the scenario to return. This because a scenario may last longueur than browser typical timeout.

starting the injector

Technically the injector is only "yet an other binding". The simplest way to start it is to add it configuration as the end of the binding to be tested.

Note: by default the API to be tested remain visible from "devtools", to remove it simply pass the binding to be tested in 'private' mode.

afb-binder -v \
   --config=$ROOTDIR/iso15118-2/etc/binding-iso-2.yaml \
   --config=$CONFDIR/binding-simulator.yaml \
   $*

images

For further information on config: https://docs.redpesk.bzh/docs/en/master/developer-guides/resource-bindings.html#using-a-resource-binding-with-a-config

injector-binding-rs's People

Contributors

fulup-bzh avatar ronan22 avatar

Watchers

 avatar Stephane Desneux avatar benierc avatar  avatar  avatar Sylvain [IoT.bzh] avatar Sebastien Douheret avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.