Video Transcript
Introduction
Hello, this is Amir Shehata with another quick tip for the LUTF.
Now that we have a general understanding of what the LUTF is, how to build it, deploy it and configure it, let's get our hands dirty and run it.
Environment Variables
There are three environment variables we need to set in order to run the LUTF:
...
- LUSTRE: is the base directory where the Lustre tests are
- LD_LIBRARY_PATH: is should include the path for the LUTF shared libraries
- LUTFPATH: which is the path to the LUTF binary
...
Once you have the environment variables set, you'll need to create a YAML configuration parameter file to give to the LUTF on start up. We went over the YAML configuration file in a previous tutorial. For today you can download a sample YAML configuration file for the agent and the master from the Wiki paged linked below.
Running the LUTF
Alright here we go, now we're ready to start the LUTF:
Code Block |
---|
source ~/bin/lutf.sh $LUTFPATH/lutf --config $LUTFPATH/python/config/lustre01.yaml |
And Voila! Welcome to the LUTF.
You can see since we're running in interactive
mode we now have an LUTF python shell we can work with.
Right off the bat let's see what we can learn from about our test setup.
Suites
First of all the LUTF gives us a simple way to look at all the existing suites:suites. By using suites.dump()
you get a list of suites.
Code Block |
---|
Welcome to the Lustre Unit Test Framework (LUTF) lutf>>> suites.dump() suites: - dlc - dynamic-discovery - lnet-health - multi-rail - samples |
If you remember our naming convention we talked about last tutorial, here is where it comes into effect. The LUTF gathers all the suites in the python/tests directory.
Say we add a new suite while the LUTF is up, we can reload the suites by:
Code Block |
---|
suites.reload() |
This comes in handy while actively developing test cases.
Scripts
Second, we can see all the scripts under a specific suite. I'm going to use my samples suite for this demonstration:
Code Block |
---|
lutf>>> suites['samples'].dump() scripts: - sample_01.py - sample_02.py - sample_03.py - sample_04.py - sample_05.py - sample_04_1.py |
Again while we're actively developing test scripts it becomes immensely useful to reload the test scripts as we add more and more test cases. We don't want to keep exiting and restarting the LUTF whenever we make a change to a script or add a new one. Like with the suites we can call the reload() function to reload all the scripts:
Code Block |
---|
suites['samples'].reload() |
The me
Variable
We can also display a bunch of information about this node. There is a me
variable available which gives us some information about the node we're running on.
...
Code Block |
---|
lutf>>> me.my_hostname() 'lustre01' |
We can find out the type of the LUTF instance:
Code Block |
---|
me.my_type() |
We can find out the listen listening port for this LUTF instance
...
Code Block |
---|
lutf>>> me.dump_intfs() interfaces: eth0: ip: 192.168.122.100 netmast: 255.255.255.0 broadcast: 192.168.122.255 eth1: ip: 192.168.122.101 netmast: 255.255.255.0 broadcast: 192.168.122.255 eth2: ip: 192.168.122.102 netmast: 255.255.255.0 broadcast: 192.168.122.255 |
Why is all this interesting? Well because a script can just access the "me" variable and get all the basic information it needs about a node in a very simple way. Makes . Not only can a script access the local me variable, but it can also access the remote me variable and get all the info it needs about the remote. The script will look exactly the same in both cases. This makes writing test scripts very straight forward as we will see later on.
The agents
variable
Beside information about the local node, we can find out who's connected. You can do that by:
Code Block |
---|
lutf>>> agents.dump()
RCLIENTS1:
id: 0
ip: 192.168.122.103
node-type: AGENT
telnet-port: 8181 |
You can see that it tells you the name of the lutf instance connected and its type. In this case we're the master and one agent is connected to us
...
- suites
- agents
- me
- dump yaml config
...
.
If I run the same command on the agent, I see this:
Code Block |
---|
lutf>>> agents.dump()
RCLIENTS:
id: 0
ip: 192.168.122.100
node-type: MASTER
telnet-port: 8181 |
Conclusion
That concludes our initial active tour of the LUTF. In the next tutorial we'll start looking at how to write and run scripts.
...