Skip to content

LinkNeg

Ondrej Lichtner edited this page Nov 4, 2016 · 2 revisions

1. Basic description

The LinkNeg test module allows one to test the link negotiation of two interfaces. By changing the administrative state of one interface (using the 'set_link_up' / 'set_link_down' interface methods) a change in the operational state of the corresponding interface should be observed. By performing this test multiple times hardware or firmware bugs may be detected.

2. Options

This test module accepts these options:

iface expects the name of the interface which should be tested. This option is mandatory.
state The test module tests if the detected operative state of the interface is identical to this option. It expects a boolean value specifying if the interface should be administratively UP or DOWN. This option is mandatory.
speed The test module compares if the negotiated link speed is identical to this option. It expects an integer value specifying link speed in Mb/s. This option is optional.
timeout expects an integer value specifying the number of seconds the module should wait before performing the test. This option is optional, the default value is 10 seconds.

3. Usage Example

Add the following to your Python Task.

m1_if = m1.get_interface("if1")
linkneg = ctl.get_module("LinkNeg",
                         options={
                             "iface" : m1_if.get_devname(),
                             "state" : True,
                             "speed" : "10000"})

m1.run(linkneg)

4. Results

An example output of this command, with debug logs enabled, will look like this:

2016-11-04 13:28:35               (1)        -    INFO: Started LinkNeg...
2016-11-04 13:28:45               (1)        -   DEBUG: Executing: "ethtool ens2f0"
2016-11-04 13:28:45               (1)        -   DEBUG:
    Stdout:
    ----------------------------
    Settings for ens2f0:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseT/Full
                                10000baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: No
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Speed: 10000Mb/s
        Duplex: Full
        Port: FIBRE
        PHYAD: 0
        Transceiver: external
        Auto-negotiation: off
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00002000 (8192)
                               hw
        Link detected: yes
    ----------------------------
2016-11-04 13:28:45       (localhost)        -    INFO: Result: PASS
2016-11-04 13:28:45       (localhost)        -    INFO: Result data:
2016-11-04 13:28:45       (localhost)        -    INFO:     oper_state:         UP
2016-11-04 13:28:45       (localhost)        -    INFO:     admin_speed:        10000 Mb/s
2016-11-04 13:28:45       (localhost)        -    INFO:     admin_state:        UP
2016-11-04 13:28:45       (localhost)        -    INFO:     oper_speed:         10000 Mb/s