Skip to content

DMTF/lib-test-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

223 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Content

This is DMTF's Sample Implementation of a PTTI Test Service library, for integration into various vendors' Control Plane software.

Features

  1. Specifications

    The Test Service libraries follow :

    DSP0280 PMCI Test Tools Interface and Design Specification (version 1.1.0)

  2. Includes libraries that can be used to construct a PTTI Test Service. Also included are examples of Control Plane mockups and a built-in Test Client mockup.

  3. Programming Context

    The core libraries in lib require only the C99 freestanding headers and so are suitable for embedded and systems programming. Dynamic memory allocation and freeing are provided by the Control Plane, via API functions between the library code and the Control Plane.

  4. Implemented Requests and Responses

    All mandatory and optional commands in version 1.1.0 are implemented.

  5. Cryptography Support

    There is no code included that implements cryptographic algorithms. Any such code is presumed to be supplied by the integrator.

  6. Execution Context

    The library code is intended to be useful in a variety of execution contexts.

  7. Supported architecture and cross-compiler based on X64 platform.

The following platforms are presumed to be supported.

Windows System ia32 x64 arm aarch64 riscv32 riscv64
VS2015 cl cl - - - -
VS2019 cl cl - - - -
VS2022 cl cl - - - -
ARM_DS2022 - - armclang armclang - -
GCC gcc gcc - - - -
CLANG clang-cl clang-cl - - - -
Linux System ia32 x64 arm aarch64 riscv32 riscv64 loongarch64
GCC gcc gcc - - - - -
CLANG clang clang - - - - -
ARM_DS2022 - - armclang armclang - - -
ARM_GNU - - arm-none-linux-gnueabihf-gcc aarch64-none-linux-gnu-gcc - - -
ARM_GNU_BARE_METAL - - arm-none-eabi aarch64-none-elf - - -
ARM_GCC - - arm-linux-gnueabi-gcc - - - -
AARCH64_GCC - - - aarch64-linux-gnu-gcc - - -
RISCV_GNU - - - - riscv32-unknown-linux-gnu-gcc riscv64-unknown-linux-gnu-gcc -
RISCV64_GCC - - - - - riscv64-linux-gnu-gcc -
RISCV_XPACK - - - - riscv-none-elf-gcc riscv-none-elf-gcc -
RISCV_NONE - - - - riscv64-elf-gcc riscv64-elf-gcc -
LOONGARCH64_GNU - - - - - - loongarch64-unknown-linux-gnu-gcc
  1. Static Analysis

No particular support is claimed for static analysis tools.

Documents

No particular documentation beyond DSP0280 is provided at this time, although additional documentation may be provided in the future.

Prerequisites

Build Tools for Windows

The following build tools are presumed to work.

  1. Compiler for IA32/X64 (Choose one)

    a) Visual Studio 2022, Visual Studio 2019, Visual Studio 2015

    b) LLVM (LLVM13)

    • Install LLVM-13.0.0-win64.exe. Change the LLVM install path to C:\LLVM, and add LLVM path C:\LLVM\bin in PATH environment for CLANG build on Windows.
    • LLVM13 works good for clang and libfuzzer build. Other versions are not validated for clang build.
    • The Visual Studio is needed for nmake.
    • Because the libfuzzer lib path is hard coded in CMakeLists, other versions may fail for libfuzzer build.

Build

The default Makefile supplied in the top directory can be used on Linux machines to build the libraries, a mockup Control Plane, a mockup Device Under Test, and a mockup Test Client.

Note that a directory named "build" should be created directly under the top-level directory. Then simply execute "make" in the top-level directory.

Configuration Parameters

Various C macros are used to configure the behavior of lib-test-service code. These can be defined within a build-specific set of definitions (e.g. Makefile) to allow custom configuration without having to modify source code. Such C macros are listed below.

  • ALLOW_DUT_SHARING - If defined as true, the library supports multiple Test Clients simultaneously maintaining a session with the same Device Under Test. If defined as false, the library enforces a maximum of one Test Client maintaining a session with a given Device Under Test. The current default is false.

  • MAX_TRANSFER_SIZE - If defined, this configures the maximum size of inventory data transferred during a Query Partial System Inventory command. It may also be referenced by other configuration definitions below. The current default is 1024.

  • MAX_PATH_TABLE_ENTRIES - If defined, this configures the maximum number of parallel paths under consideration from a Test Client to a target Device Under Test, during processing of a Configure Device Under Test command. The current default is 4.

  • MAX_PATH_IDENTIFER_COUNT - If defined, this configures the maximum number of hops (over different interfaces) from a Test Client to a target Device Under Test, during processing of a Configure Device Under Test command. The current default is 16.

  • MAX_CLIENT_SESSIONS - If defined, this configures the maximum number of Test Clients simultaneously supported by the library. The current default is 3.

  • MAX_DUT_CONNECTIONS - If defined, this configures the maximum number of Devices Under Test simultaneously supported by the library. The current default is 5.

  • MAX_AEN_SINKS_PER_CLIENT - If defined, this configures the maximum number of protocols over which a Test Client may receive asynchonous event messages from any Device Under Test to which the Test Client is maintaining a session. The current default is 10.

  • MAX_STATUS_RESPONSE_SIZE MAX_TRANSFER_SIZE - If defined, this configures the maximum size of status data transferred during a Query Status command. The current default is MAX_TRANSFER_SIZE.

  • MAX_INVENTORY_BUFFER_SIZE - If defined, this configures the maximum size of inventory data transferred during a Query System Inventory command. The current default is 4096.

  • MAX_VDM_ADMIN_RESPONSE_SIZE - If defined, this configures the maximum size of the response message transferred during a Vendor Defined Admin command. The current default is MAX_TRANSFER_SIZE.

  • ENABLE_DEBUG_ASSERTS - If defined, this configures the library to halt when certain abnormal conditions are detected by the library, which may be useful during development or debug. By default, this C macro is NOT defined within the library source code.

  • ENABLE_DEBUG_PRINTS - If defined, this configures the library to send various instrumentation messages to the console, which may be useful during development or debug. By default, this C macro is NOT defined within the library source code.

  • SIMULATE_TEST_CLIENT - If defined, this configures the library to simulate a Test Client sending a canned set of PTTI request messages, which may be useful during development or debug. By default, this C macro is NOT defined within the library source code.

Run Test

From the top-level directory, the default mockup code can be executed via ./build/mockup

You should see something like:

      TC->TS:  wrapper = 11 ff 00 00 00 00 00 00 06 00 00 00 00 00 00 00   payload = 00 01 00 00 00 42
          @ PTTI_CC_CONNECT
      TS->TC:  wrapper = 11 ff 01 00 02 03 05 07 07 00 00 00 00 00 00 00   payload = 00 00 11 02 03 05 07

      TC->TS:  wrapper = 11 ff 00 00 02 03 05 07 02 00 00 00 00 00 00 00   payload = 11 00
         @ PTTI_CC_QUERY_STATUS
      TS->TC:  wrapper = 11 ff 01 00 02 03 05 07 07 00 00 00 00 00 00 00   payload = 11 00 00 00 00 00 00

      ...

      That's all folks!

Associated Repositories

DMTF expects to make public a companion repository that provides a sample implementation of a PTTI Test Client.

Features not implemented yet

  1. Refer to issues for more details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages