An LUTF Short Introduction
Slide Deck
Download from here
Video Transcript
Slide 1
Hello, This is Amir Shehata with a series of quick tips on the LNet Unit Test Frame work... LUTF for short
With the latest volley of LNet features developed, including Multi-Rail and health, it became clear we need a tool to unit test LNet.
the LUTF was born out of that need.
Slide 2
It has three main goals. The obvious one is to Unit test LNet. This includes an ability to configure LNet from both the lnetctl utility and the liblnetconfig API, that is a C API which is used by lnetctl to send configuration IOCTLs to the LNet kernel module.
Beside configuration tests we need to ensure traffic abides with the specified configuration
The second goal is to create an environment which enables developers to rapidly and easily develop test scripts, using a powerful scripting language. Python is an ideal language for this purpose. It's well supported on a multitude of systems and has extensive features.
The third goal of the LUTF is to create an expandable test framework which can be adopted for other purposes as the need arises.
Slide 3
At its core the LUTF is a tool which allows python scripts to execute on multiple Nodes Under Test seamlessly. From the master script point of view whether the python function or class method is executed locally or remotely the script will be written in the exact same way.
I will cover some examples which detail this feature in later tutorials.
The LUTF will include infrastructure to run in batch mode; execute multiple test suites and collect results.
Slide 4
The LUTF is designed using a master/slave architecture. The master node is the one triggering the test scripts. On each node under test an LUTF Agent runs. On agent start up it connects to the master. Scripts running on the master can then find out how many agents are connected. It can also collect any details about the node under test which would be needed for the purposes of the test case
Slide 5
The LUTF core is written in C. It embeds a Python 3 interpret. This allows python test scripts to exercise the full potential of the python language to implement any test cases required. As an example a script can execute lnetctl commands or any other shell command. It can also call C APIs directly from python. A C/Python wrapper will be provided for liblnetconfig, but any other userspace C API can be wrapped as easily.
Slide 6
The LUTF C core is responsible for the Inter process Communication between the master and the agents.
SWIG is used to wrap the C APIs in python callable classes. As mentioned the liblnetconfig API will be available out of the box, but any other C API can be wrapped as the need arises
Slide 7
For more details you can read the High Level Design found in the displayed link
Over the following series of tutorials I'll show examples of how to setup, run and write scripts for the LUTF.