pytest_mh.utils.tc

Classes

LinuxTrafficControl(*args, **kwargs)

Perform traffic control operations on remote host.

class pytest_mh.utils.tc.LinuxTrafficControl(*args, **kwargs)

Bases: MultihostUtility[MultihostHost]

Perform traffic control operations on remote host.

All changes are automatically reverted when a test is finished.

Parameters:

host (MultihostHost) – Remote host instance.

add_delay(host: str | MultihostHost | MultihostRole, time: str | int)

Add delay to the network connection. A maximum of 15 connections can be delayed at a time. It is recommended to specify the delay from minimum to maximum to avoid starvation.

Parameters:
  • host (str | MultihostHost | MultihostRole) – Target hostname or multihost host or role.

  • time (str | int) – Delay. Units can be specified; if not specified, the default is milliseconds.

remove_delay(host: str | MultihostHost | MultihostRole)

Remove delay in the network connection.

Parameters:

host (str | MultihostHost | MultihostRole) – Target hostname or multihost host or role.