Skip to content

Netperf

jiriprochazka edited this page Oct 14, 2014 · 5 revisions

1. Basic description

This test module provides you with an easy way to use the netperf utility with LNST. It is required that machines where this module will be run have this utility installed. The netperf utility is used to measure the network performance between two separate machines. This test therefore requires the use of at least two machines, and to use it properly you will need to run two commands.

The purpose of this test module is quite obvious - measuring the network performance.

2. Options

This test module accepts these options:

role accepted values are: client or server. This option is mandatory and determines the role of the slave machine this test is being run on.
duration in seconds, specifies how long will the test be running. By default it is set to 10 seconds for the client, and unlimited for the server.
threshold in [kMGT]bits/sec or [kMGT]bytes/sec ( e.g. 1.2 Mbits/sec or 1.2 Mbytes/sec) determines the lowest network performance throughput needed for the test to succeed. The default value is 0 bits/sec.
netperf_opts gives you the ability to provide any additional arguments that should be passed to the netperf or netserver command.
netperf_server expects an IP address or the hostname of the machine where a netserver command is running. This option is mandatory when role=client.
bind represents the argument -L, of the netserver utility, that determines on which address will the server be listening for incoming connections. This option can only be used when role=server.
port represents the argument -p, of the netserver or netperf utility, that determines on which port will the server be listening or client connecting to.

3. Usage Example

As was mentioned earlier, you will need two machines and run two Netperf tests at the same time in order to use this module correctly. To clarify see the following command sequence:

    <task>
        <run module="Netperf" host="testmachine2" bg_id="server">
            <options>
                <option name="role" value="server"/>
                <option name="bind" value="{ip(testmachine2, testifc2)}"/>
          </options>
        </run>
        <run module="Netperf" host="testmachine1">
            <options>
                <option name="role" value="client"/>
                <option name="netperf_server" value="{ip(testmachine2, testifc2)}"/>
            </options>
        </run>

        <kill host="testmachine2" bg_id="server"/>

    </task>

The first command will run the netperf utility in the role of the server, we also need to specify that it should bind to our testing interface. Since we want to run two commands at a time this command must be run as a background command (attribute bg_id).

Next we run the second command this time on a different machine, in the role of the client, and we direct him to where our server is listening.

To simplify the example we are not using any optional arguments but adding them should be fairly easy.

And finally, since we created a background command we add a corresponding kill command to clean-up.

4. Results

The command sequence, from the previous section, can be used in a full recipe considering you modify the ids to match your environment specification.

A successful run of these commands will give you results similar to these:

2014-08-20 13:53:13        (localhost)     INFO: Executing command: [type(test), module(Netperf), host(testmachine2), bg_id(server)]
2014-08-20 13:53:13        (localhost)     INFO: Result: PASS
2014-08-20 13:53:13        (localhost)     INFO: Status message from slave: "Running in background."
2014-08-20 13:53:13        (localhost)     INFO: Executing command: [type(test), module(Netperf), host(testmachine1)]
2014-08-20 13:53:23        (localhost)     INFO: Result: PASS
2014-08-20 13:53:23        (localhost)     INFO: Result data:
2014-08-20 13:53:23        (localhost)     INFO:     msg:	Measured rate: 189.97 Mbits
2014-08-20 13:53:23        (localhost)     INFO: Executing command: [type(kill), host(testmachine2), bg_id(server)]
2014-08-20 13:53:23        (localhost)     INFO: Result: PASS
2014-08-20 13:53:23        (localhost)     INFO: Status message from slave: "Command killed."
2014-08-20 13:53:47     (testmachine1)     INFO: Restoring system configuration
2014-08-20 13:52:42     (testmachine2)     INFO: Restoring system configuration
2014-08-20 13:53:47     (testmachine1)     INFO: Killing all forked processes.
2014-08-20 13:53:47     (testmachine1)     INFO: Deactivating connection on device ens20
2014-08-20 13:53:47     (testmachine1)     INFO: Restoring system configuration
2014-08-20 13:52:42     (testmachine2)     INFO: Killing all forked processes.
2014-08-20 13:52:42     (testmachine2)     INFO: Deactivating connection on device ens9
2014-08-20 13:52:42     (testmachine2)     INFO: Restoring system configuration
2014-08-20 13:53:25        (localhost)     INFO: ============================ SUMMARY ============================
2014-08-20 13:53:25        (localhost)     INFO:  recipes/examples/quick_guides/netperf_wiki.xml             PASS 
2014-08-20 13:53:25        (localhost)     INFO:      task: 1  
2014-08-20 13:53:25        (localhost)     INFO:          host testmachine2: test     Netperf bg_id: server  PASS 
2014-08-20 13:53:25        (localhost)     INFO:              message: Running in background.  
2014-08-20 13:53:25        (localhost)     INFO:          host testmachine1: test     Netperf                PASS 
2014-08-20 13:53:25        (localhost)     INFO:              msg:	Measured rate: 189.97 Mbits  
2014-08-20 13:53:25        (localhost)     INFO:          host testmachine2: kill     id: server             PASS 
2014-08-20 13:53:25        (localhost)     INFO:              message: Command killed.  
2014-08-20 13:53:25        (localhost)     INFO: =================================================================

Clone this wiki locally