1. Home
  2. Docs
  3. User’s Guide
  4. Templates

Templates

GUARDARA uses templates to model structured data, including protocols and file formats and define test execution flow. The Engines use these templates to generate test cases using a complex network of algorithms during the test runs.

Templates

There are two basic templates types: Message and Test Flow templates. An additional asset type called Callbacks is documented on the Callbacks page of the Developer’s Guide. Templates are accessible on the Templates page from the main menu.

This, and the linked pages in the rest of the page focus only on the Message and Flow templates and how to work with them using the Template Designers of the user interface.

Message Templates

A Message template describes structured data. Fields are the smallest building blocks of this structure and are used to represent the different parts of the data structure. There are several built-in fields. These Fields have their own set of algorithms to generate and mutate data as appropriate for the data type they represent. The SDK can be used to create custom Fields, see the Extensions and the SDK page.

Messages can be created either on the Templates page by clicking the Create button. Alternatively, the Python API within the SDK can be used to create message templates programmatically. Refer to the GUARDARA API page of the API documentation for more information.

Test Flow Templates

While files can be represented using a single Message template, message exchanges (e.g., network protocols) are usually more complicated than that. For example, a network protocol is most often implemented as an exchange of multiple messages between two applications, usually a client and a server. When modelling a protocol using GUARDARA, Test Flow templates are the ones to control the flow of these messages. Test Flows can be created using the Test Flow Designer, accessible from the Templates page.

Importing Feature

The Import features discussed below can be accessed from the Templates page by clicking the green Import button.

Network Captures

GUARDARA is capable of importing certain files and automatically converting them into meaningful templates.

If the imported file is a network capture (.pcap, or .pcapng), GUARDARA will display a list of packets that can be imported. Otherwise, if the imported file is one of the supported file formats (for example ELFGIFJPEGPNG), it will be listed as a single entry.

The selection page of the import feature allows using display filters to filter messages to be displayed and imported. It is possible to select specific packets to be imported. However, if no selection is made, then all the packets shown will be imported. It is also possible to select which protocol layers to import.

Please note, this import feature has certain limitations, primarily because neither the Wireshark captures nor the dissectors provide this information in a reliable, standardized way. The most notable limitations are:

  • The endianness of the fields is unknown/unpredictable, all imported fields are set to Big-endian by default
  • It is not possible to reliably detect fields that represent the size of other fields or groups of fields in the data structure, therefore these size fields cannot be parsed into Sizer fields, they are represented using the Number field.

Arbitrary Files

It is possible to import arbitrary files without GUARDARA parsing them. When importing a raw file, the entire content of the file becomes a single Binary field within the newly created Message template. This allows us to do two things:

  • Start testing with the imported data using mutation-based test case generation. The properties of the Binary field has to be updated accordingly.
  • Fully or partially parse the imported data. Information on how to use the Message Template Designer to parse an imported file into fields can be found under the Importing Files section.
Was this article helpful to you? Yes No