Commit f4813bb4 authored by Antonin Coulibaly's avatar Antonin Coulibaly
Browse files

DOC(TESTING) - Add functional tests

parent ba26dafe
Loading
Loading
Loading
Loading
+52 −7
Original line number Diff line number Diff line
@@ -122,3 +122,48 @@ requestsArr.forEach(writeHex);
     - GET
     - DELETE

## Functional tests

Functional tests are located in the `tests/functional` directory.

### Architecture

* Kinetic Device simulator `tests/dependencies`
  - TCP connection
  - JAVA simulator
  - maven is needed for the build
    - Download : https://maven.apache.org/download.cgi
    - Installation guide : https://maven.apache.org/install.html
* mocha

### Method

Test are run by:
* lauching the Makefile located in the tests/functional directory :
  - make submodule_sync
    - sync and load the dependencies (simulator package)
  - make build_cache
    - build the simulator package with cache rule for avoiding many downloads
      and builds
  - make start_simulator
    - start the simulator
  - make stop_simulator
    - stop the simulator
  - make run_test
    - run the tests with mocha (`tests/functional/simulTest.js`)
  - can use make for an automatic load

### Functions tested

* Kinetic
  - Build (kinetic compatibility)
    - Protobuf message
    - Buffer sent format
  - Parse
    - Decode the received buffer
    - Check Version
    - HmacIntegrity
      (compute an HMAC from the PDU and compare it to the one sent)
  - Send()
    - Check the simulator returns (SUCCESS)
    - The simulator check the HMAC(integrity of PDU sent)