use_cases
Use cases to interact with devices.
Modules:
| Name | Description |
|---|---|
cpe |
Use Cases to check the performance of CPE. |
device_getters |
Device getters use cases. |
device_utilities |
Miscellaneous Use Cases to interact with devices. |
dhcp |
Boardfarm LGI DHCP IPv4 Use Cases. |
image_comparison |
Compare images. |
iperf |
Common Iperf use cases. |
multicast |
Multicast Use Cases. |
networking |
Common Networking use cases. |
ripv2 |
RIPv2 Use Cases library. |
voice |
Voice use cases library. |
wifi |
Wi-Fi Use Cases library. |
cpe
Use Cases to check the performance of CPE.
Functions:
| Name | Description |
|---|---|
board_reset_via_console |
Reset board via console. |
create_upnp_rule |
Create UPnP rule on the device. |
delete_upnp_rule |
Delete UPnP rule on the device. |
disable_logs |
Disable logs for the specified component on the CPE. |
enable_logs |
Enable logs for the specified component on the CPE. |
factory_reset |
Perform factory reset CPE via given method. |
get_cpe_provisioning_mode |
Get the provisioning mode of the board. |
get_cpu_usage |
Return the current CPU usage of CPE. |
get_memory_usage |
Return the memory usage of CPE. |
get_seconds_uptime |
Return board uptime in seconds. |
is_ntp_synchronized |
Get the NTP synchronization status. |
is_tr069_agent_running |
Check if TR069 agent is running or not. |
read_tcpdump |
Read the tcpdump packets and delete the capture file afterwards. |
tcpdump |
Contextmanager to perform tcpdump on the board. |
transfer_file_via_scp |
Copy files and directories between the board and the remote host. |
upload_file_to_tftp |
Transfer file onto tftp server. |
board_reset_via_console
Reset board via console.
.. hint:: This Use Case implements statements from the test suite such as:
- Reboot from console.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE
|
The board instance |
required |
Source code in boardfarm3/use_cases/cpe.py
230 231 232 233 234 235 236 237 238 239 240 241 | |
create_upnp_rule
create_upnp_rule(
device: LAN, int_port: str, ext_port: str, protocol: str, url: str | None = None
) -> str
Create UPnP rule on the device.
.. hint:: This Use Case implements statements from the test suite such as:
- Create UPnP rule through cli.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN
|
LAN device instance |
required |
|
str
|
internal port for UPnP |
required |
|
str
|
external port for UPnP |
required |
|
str
|
protocol to be used |
required |
|
str | None
|
url to be used |
None
|
Returns:
| Type | Description |
|---|---|
str
|
output of UPnP add port command |
Source code in boardfarm3/use_cases/cpe.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
delete_upnp_rule
Delete UPnP rule on the device.
.. hint:: This Use Case implements statements from the test suite such as:
- Delete UPnP rule through cli.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN
|
LAN device instance |
required |
|
str
|
external port for UPnP |
required |
|
str
|
protocol to be used |
required |
|
str | None
|
url to be used |
required |
Returns:
| Type | Description |
|---|---|
str
|
output of UPnP delete port command |
Source code in boardfarm3/use_cases/cpe.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
disable_logs
Disable logs for the specified component on the CPE.
.. note:: - The component can be one of "voice" and "pacm" for mv2p - The component can be one of "voice", "docsis", "common_components", "gw", "vfe", "vendor_cbn", "pacm" for mv1
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE
|
The board instance |
required |
|
str
|
The component for which logs have to disabled. |
required |
Source code in boardfarm3/use_cases/cpe.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
enable_logs
Enable logs for the specified component on the CPE.
.. note:: - The component can be one of "voice" and "pacm" for mv2p - The component can be one of "voice", "docsis", "common_components", "gw", "vfe", "vendor_cbn", "pacm" for mv1
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE
|
The board instance |
required |
|
str
|
The component for which logs have to be enabled. |
required |
Source code in boardfarm3/use_cases/cpe.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
factory_reset
Perform factory reset CPE via given method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE
|
The board instance. |
required |
|
None | str
|
Factory reset method |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True on successful factory reset |
Source code in boardfarm3/use_cases/cpe.py
184 185 186 187 188 189 190 191 192 193 194 | |
get_cpe_provisioning_mode
Get the provisioning mode of the board.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE
|
The board object, from which the provisioning mode is fetched. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The provisioning mode of the board. |
Source code in boardfarm3/use_cases/cpe.py
219 220 221 222 223 224 225 226 227 | |
get_cpu_usage
Return the current CPU usage of CPE.
.. hint:: This Use Case implements statements from the test suite such as:
- Return the current CPU usage of CPE.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE
|
CPE device instance |
required |
Returns:
| Type | Description |
|---|---|
float
|
current CPU usage of the CPE |
Source code in boardfarm3/use_cases/cpe.py
25 26 27 28 29 30 31 32 33 34 35 36 37 | |
get_memory_usage
Return the memory usage of CPE.
.. hint:: This Use Case implements statements from the test suite such as:
- Return the memory usage of CPE.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE
|
CPE device instance |
required |
Returns:
| Type | Description |
|---|---|
dict[str, int]
|
current memory utilization of the CPE |
Source code in boardfarm3/use_cases/cpe.py
40 41 42 43 44 45 46 47 48 49 50 51 52 | |
get_seconds_uptime
Return board uptime in seconds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE
|
The board instance |
required |
Returns:
| Type | Description |
|---|---|
float
|
board uptime in seconds |
Source code in boardfarm3/use_cases/cpe.py
197 198 199 200 201 202 203 204 205 | |
is_ntp_synchronized
Get the NTP synchronization status.
Sample block of the output
.. code-block:: python
[
{
"remote": "2001:dead:beef:",
"refid": ".XFAC.",
"st": 16,
"t": "u",
"when": 65,
"poll": 18,
"reach": 0,
"delay": 0.0,
"offset": 0.0,
"jitter": 0.0,
"state": "*",
}
]
This Use Case validates the 'state' from the parsed output and returns bool based on the value present in it. The meaning of the indicators are given below,
'*' - synchronized candidate '#' - selected but not synchronized '+' - candidate to be selected [x/-/ /./None] - discarded candidate
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE
|
CPE device instance |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if NTP is synchronized, false otherwise |
Raises:
| Type | Description |
|---|---|
ValueError
|
when the output has more than one list item |
Source code in boardfarm3/use_cases/cpe.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
is_tr069_agent_running
Check if TR069 agent is running or not.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE
|
The board instance |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if agent is running, false otherwise |
Source code in boardfarm3/use_cases/cpe.py
208 209 210 211 212 213 214 215 216 | |
read_tcpdump
read_tcpdump(
fname: str, board: CPE, protocol: str = "", opts: str = "", rm_pcap: bool = True
) -> str
Read the tcpdump packets and delete the capture file afterwards.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
filename or the complete path of the pcap file |
required |
|
CPE
|
CPE device instance |
required |
|
str
|
protocol to filter, defaults to "" |
''
|
|
str
|
defaults to "" |
''
|
|
bool
|
defaults to True |
True
|
Returns:
| Type | Description |
|---|---|
str
|
output of tcpdump read command |
Source code in boardfarm3/use_cases/cpe.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
tcpdump
Contextmanager to perform tcpdump on the board.
Start tcpdump on the board console and kill it outside its scope
:yield: yields the process id of the tcp capture started
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
the filename or the complete path of the resource |
required |
|
str
|
interface name on which the tcp traffic will listen to |
required |
|
CPE
|
CPE device instance |
required |
|
dict | None
|
filters as key value pair(eg: {"-v": "", "-c": "4"}) |
None
|
Source code in boardfarm3/use_cases/cpe.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
transfer_file_via_scp
transfer_file_via_scp(
source_dev: CPE,
source_file: str,
dest_file: str,
dest_host: LAN | WAN,
action: Literal["download", "upload"],
port: int | str = 22,
ipv6: bool = False,
) -> None
Copy files and directories between the board and the remote host.
Copy is made over SSH.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE
|
CPE device instance |
required |
|
str
|
path on the board |
required |
|
str
|
path on the remote host |
required |
|
LAN | WAN
|
the remote host instance |
required |
|
int | str
|
host port |
22
|
|
Literal['download', 'upload']
|
scp action to perform i.e upload, download |
required |
|
bool
|
whether scp should be done to IPv4 or IPv6, defaults to IPv4 |
False
|
Source code in boardfarm3/use_cases/cpe.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
upload_file_to_tftp
upload_file_to_tftp(
source_dev: CPE,
source_file: str,
tftp_server: LAN | WAN,
path_on_tftpserver: str,
ipv6: bool = False,
timeout: int = 60,
) -> None
Transfer file onto tftp server.
.. hint:: This Use Case helps to copy files from board to tftp servre
- can be used after a tcpdump on board
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE
|
CPE device instance |
required |
|
str
|
Path on the board |
required |
|
LAN | WAN
|
the remote tftp server instance |
required |
|
str
|
Path on the tftp server |
required |
|
bool
|
if scp should be done to ipv4 or ipv6, defaults to ipv4 |
False
|
|
int
|
timeout value for the usecase |
60
|
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
when file not found |
Source code in boardfarm3/use_cases/cpe.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | |
device_getters
Device getters use cases.
Functions:
| Name | Description |
|---|---|
device_getter |
Provide device of type 'device_type'. |
get_lan_clients |
Return a list of LAN clients based on given count. |
get_wan_clients |
Return a list of WAN clients based on given count. |
device_getter
device_getter(device_type: type[T]) -> T
Provide device of type 'device_type'.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
type[T]
|
Type of device to get |
required |
Returns:
| Type | Description |
|---|---|
T
|
Instance of device |
Raises:
| Type | Description |
|---|---|
ValueError
|
if no device of given type is available or if more than 1 device of given type is available |
Source code in boardfarm3/use_cases/device_getters.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
get_lan_clients
Return a list of LAN clients based on given count.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
number of LAN clients |
required |
Returns:
| Type | Description |
|---|---|
List[LAN]
|
list of LAN clients |
Raises:
| Type | Description |
|---|---|
DeviceNotFound
|
if count of LAN devices is invalid |
Source code in boardfarm3/use_cases/device_getters.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
get_wan_clients
Return a list of WAN clients based on given count.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
number of WAN clients |
required |
Returns:
| Type | Description |
|---|---|
List[WAN]
|
list of WAN clients |
Raises:
| Type | Description |
|---|---|
DeviceNotFound
|
if count of WAN devices is invalid |
Source code in boardfarm3/use_cases/device_getters.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
device_utilities
Miscellaneous Use Cases to interact with devices.
General tasks such as reading and setting device's date and time.
Functions:
| Name | Description |
|---|---|
get_device_date |
Get the device's date and time. |
set_device_date |
Set the dut date and time from device console. |
get_device_date
Get the device's date and time.
.. code-block:: python
# example output
"Friday, May 24, 2024 10:43:11"
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | WLAN | CPE
|
device from which the date and time needs to be fetched |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
date from device console |
Source code in boardfarm3/use_cases/device_utilities.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
set_device_date
Set the dut date and time from device console.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | WLAN | CPE
|
device on which the date and time needs to be set |
required |
|
str
|
value to be changed eg: Tue Dec 20 2022, 12:40:23 UTC, etc |
required |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
fails the usecase if the date is not set properly |
Source code in boardfarm3/use_cases/device_utilities.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
dhcp
Boardfarm LGI DHCP IPv4 Use Cases.
Classes:
| Name | Description |
|---|---|
DHCPTraceData |
Provides a DHCPTraceData data class. |
Functions:
| Name | Description |
|---|---|
configure_dhcp_inform |
Configure dhclient.conf to send DHCPINFORM messages. |
configure_dhcp_option125 |
Configure device's vendor-specific suboptions in DHCP option 125. |
dhcp_renew_ipv4 |
Release and renew IPv4 in the device and return IPv4. |
dhcp_renew_stateful_ipv6 |
Release and renew stateful IPv6 in the device and return IPv6. |
dhcp_renew_stateless_ipv6 |
Release and renew stateless IPv6 in the device and return IPv6. |
get_all_dhcp_options |
Get all the DHCP options in a DHCP packet. |
get_all_dhcpv6_options |
Get all the DHCPv6 options in a DHCPv6 packet. |
get_dhcp_option_details |
Get all required option details when option is provided. |
get_dhcp_packet_by_message |
Get the DHCP packets for the particular message from the pcap file. |
get_dhcp_suboption_details |
Get all required sub option details when option & sub option are provided. |
get_dhcpv6_packet_by_message |
Get the DHCPv6 packets for the particular message from the pcap file. |
parse_dhcp_trace |
Read and filter the DHCP packets from the pcap file and returns the DHCP packets. |
parse_dhcpv6_trace |
Read and filter the DHCPv6 packets from the pcap file. |
remove_dhcp_inform_config |
Remove the DHCPINFORM related configuration on dhclient.conf. |
remove_dhcp_option125 |
Remove the information in DHCP option 125. |
DHCPTraceData
dataclass
DHCPTraceData(
source: IPAddresses,
destination: IPAddresses,
dhcp_packet: RecursiveDict,
dhcp_message_type: int,
)
Provides a DHCPTraceData data class.
Holds source, destination, dhcp_packet and dhcp_message_type.
configure_dhcp_inform
Configure dhclient.conf to send DHCPINFORM messages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN
|
Device where dhclient.conf needs to be configured for DHCPINFORM,=, |
required |
Source code in boardfarm3/use_cases/dhcp.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
configure_dhcp_option125
Configure device's vendor-specific suboptions in DHCP option 125.
This function modifies the device's dhclient.conf.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN
|
Linux device to be configured. |
required |
Source code in boardfarm3/use_cases/dhcp.py
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
dhcp_renew_ipv4
Release and renew IPv4 in the device and return IPv4.
.. hint:: This Use Case implements statements from the test suite such as:
- Trigger DHCP DISCOVER for the LAN Client IPv4 acquisition
- Verify the IP acquisition on LAN devices
- Check if the LAN Client connected to CPE obtains both IPv4 and IPv6 address
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WLAN
|
host where the IP has to be renewed |
required |
Returns:
| Type | Description |
|---|---|
IPv4Address
|
IPv4 address of the device |
Source code in boardfarm3/use_cases/dhcp.py
572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | |
dhcp_renew_stateful_ipv6
Release and renew stateful IPv6 in the device and return IPv6.
.. hint:: This Use Case implements statements from the test suite such as:
- Initiate the IPv6 acquisition from LAN Ethernet client
- Initiate the IPv6 process from LAN Ethernet client
- Release and renew IPv6 address on LAN client
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WLAN
|
host where the IP has to be renewed |
required |
Returns:
| Type | Description |
|---|---|
IPv6Address
|
IPv6 address of the device |
Source code in boardfarm3/use_cases/dhcp.py
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 | |
dhcp_renew_stateless_ipv6
Release and renew stateless IPv6 in the device and return IPv6.
.. hint:: This Use Case implements statements from the test suite such as:
- Initiate the IPv6 stateless acquisition from LAN Ethernet client
- Initiate the IPv6 stateless process from LAN Ethernet client
- Release and renew stateless IPv6 address on LAN client
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WLAN
|
host where the IP has to be renewed |
required |
Returns:
| Type | Description |
|---|---|
IPv6Address
|
IPv6 address of the device |
Source code in boardfarm3/use_cases/dhcp.py
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 | |
get_all_dhcp_options
get_all_dhcp_options(packet: DHCPTraceData) -> RecursiveDict
Get all the DHCP options in a DHCP packet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DHCPTraceData
|
desired packet from DHCP trace (only one packet) |
required |
Returns:
| Type | Description |
|---|---|
RecursiveDict
|
all the DHCP options |
Source code in boardfarm3/use_cases/dhcp.py
165 166 167 168 169 170 171 172 173 174 175 176 177 | |
get_all_dhcpv6_options
get_all_dhcpv6_options(packet: DHCPV6TraceData) -> DHCPV6Options
Get all the DHCPv6 options in a DHCPv6 packet.
.. hint:: This Use Case implements statements from the test suite such as:
- DHCPv6 includes the [] option
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DHCPV6TraceData
|
desired packet from DHCPv6 trace (only one packet) |
required |
Returns:
| Type | Description |
|---|---|
DHCPV6Options
|
all the DHCPv6 options |
Source code in boardfarm3/use_cases/dhcp.py
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 | |
get_dhcp_option_details
get_dhcp_option_details(packet: DHCPTraceData, option: int) -> RecursiveDict
Get all required option details when option is provided.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify packet capture has option
- Verify [] is present in DHCP [] message
- Verify all the Mandatory_Fields are available in DHCP message
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DHCPTraceData
|
the packet data structure |
required |
|
int
|
DHCP option |
required |
Returns:
| Type | Description |
|---|---|
RecursiveDict
|
option Dict along with suboptions |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
on failing to find the option |
Source code in boardfarm3/use_cases/dhcp.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
get_dhcp_packet_by_message
get_dhcp_packet_by_message(
trace: list[DHCPTraceData], message_type: str
) -> list[DHCPTraceData]
Get the DHCP packets for the particular message from the pcap file.
.. hint:: This Use Case implements statements from the test suite such as:
- Following messages are exchanged
- Discover, Offer, Request and Ack messages
- DHCP messages are exchanged
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[DHCPTraceData]
|
sequence of DHCP packets filtered from captured pcap file and stored in DHCPTraceData |
required |
|
str
|
DHCP message according to RFC2132 and could be any of: * DHCPDISCOVER, * DHCPOFFER, * DHCPREQUEST, * DHCPDECLINE, * DHCPACK, * DHCPACK, * DHCPRELEASE, * DHCPINFORM |
required |
Returns:
| Type | Description |
|---|---|
List[DHCPTraceData]
|
Sequence of DHCP packets filtered with the message type |
Source code in boardfarm3/use_cases/dhcp.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
get_dhcp_suboption_details
get_dhcp_suboption_details(
packet: DHCPTraceData, option: int, suboption: int
) -> RecursiveDict
Get all required sub option details when option & sub option are provided.
.. hint:: This Use Case implements statements from the test suite such as:
- DHCP option [] suboptions
- Verify [] suboptions are present in DHCP
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DHCPTraceData
|
the packet data structure |
required |
|
int
|
DHCP option |
required |
|
int
|
DHCP sub option |
required |
Returns:
| Type | Description |
|---|---|
RecursiveDict
|
suboption dictionary |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
on failing to find the suboption |
Source code in boardfarm3/use_cases/dhcp.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | |
get_dhcpv6_packet_by_message
get_dhcpv6_packet_by_message(
trace: list[DHCPV6TraceData], message_type: str
) -> list[DHCPV6TraceData]
Get the DHCPv6 packets for the particular message from the pcap file.
.. hint:: This Use Case implements statements from the test suite such as:
- Following messages are exchanged DHCPv6
- Discover, Offer, Request and Ack DHCPv6 messages
- DHCPv6 messages are exchanged
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[DHCPV6TraceData]
|
sequence of DHCPv6 packets filtered from captured pcap file and stored in DHCPV6TraceData |
required |
|
str
|
DHCP message according to RFC3315 and could be any of: * SOLICIT, * ADVERTISE, * REQUEST, * CONFIRM, * RENEW, * REBIND, * REPLY, * RELEASE, * DECLINE, * RECONFIGURE, * INFORMATION-REQUEST, * RELAY-FORW, * RELAY-REPL |
required |
Returns:
| Type | Description |
|---|---|
List[DHCPV6TraceData]
|
Sequence of DHCPv6 packets filtered with the message type |
Source code in boardfarm3/use_cases/dhcp.py
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 | |
parse_dhcp_trace
parse_dhcp_trace(
on_which_device: LAN | WAN | Provisioner | LTS, fname: str, timeout: int = 30
) -> list[DHCPTraceData]
Read and filter the DHCP packets from the pcap file and returns the DHCP packets.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify from the packet capture
- Verify that the following messages are exchanged
- Check that [] messages are exchanged
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | Provisioner | LTS
|
Object of the device class where tcpdump is captured |
required |
|
str
|
Name of the captured pcap file |
required |
|
int
|
time out for |
30
|
Returns:
| Type | Description |
|---|---|
List[DHCPTraceData]
|
Sequence of DHCP packets filtered from captured pcap file |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
on DHCP parse issue |
Source code in boardfarm3/use_cases/dhcp.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
parse_dhcpv6_trace
parse_dhcpv6_trace(
on_which_device: LAN | WAN | Provisioner | LTS,
fname: str,
timeout: int = 30,
additional_args: str = "dhcpv6",
) -> list[DHCPV6TraceData]
Read and filter the DHCPv6 packets from the pcap file.
.. hint:: This Use Case implements statements from the test suite such as:
- Check that the following messages are exchanged [] DHCPv6
- Verify from the packet capture that DHCPv6
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | Provisioner | LTS
|
Object of the device class where tcpdump is captured |
required |
|
str
|
Name of the captured pcap file |
required |
|
int
|
time out for |
30
|
|
str
|
additional arguments for tshark command to display filtered output, defaults to dhcpv6 |
'dhcpv6'
|
Returns:
| Type | Description |
|---|---|
List[DHCPV6TraceData]
|
sequence of DHCPv6 packets filtered from captured pcap file |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
on failure to parse DHCPv6 data |
Source code in boardfarm3/use_cases/dhcp.py
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 | |
remove_dhcp_inform_config
Remove the DHCPINFORM related configuration on dhclient.conf.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN
|
Device from where the configuration needs to be removed. |
required |
Source code in boardfarm3/use_cases/dhcp.py
288 289 290 291 292 293 294 295 296 | |
remove_dhcp_option125
Remove the information in DHCP option 125.
This function modifies the Linux device's dhclient.conf.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN
|
Linux device to be configured. |
required |
Source code in boardfarm3/use_cases/dhcp.py
339 340 341 342 343 344 345 346 347 348 349 350 351 | |
image_comparison
Compare images.
Functions:
| Name | Description |
|---|---|
compare_images |
Compare 2 images and return the similarity score. |
compare_images
compare_images(
first_image: Path,
second_image: Path,
ignore_areas: list[tuple[int, int, int, int]] | None,
show_images: bool = False,
) -> dict[str, float64]
Compare 2 images and return the similarity score.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Path
|
Usually the original image (usually a png) |
required |
|
Path
|
The new image (with same size as the first image) |
required |
|
list[tuple[int, int, int, int]] | None
|
A list of coordinates for the zones (rectangles) to be ignored during the comparison (xtop, ytop, xbottom, ybottom) 1 tuple is one rectangle. (xtop, ytop) |-----------------| | | | | |-----------------|(xbottom,ybottom) |
required |
|
bool
|
shows the images, NOT TO BE USED in CI, defaults to False |
False
|
Returns:
| Type | Description |
|---|---|
np.float64
|
the similarity Score of the original images if there is no ignore_areas otherwise returns the masked images similarity score |
Source code in boardfarm3/use_cases/image_comparison.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
iperf
Common Iperf use cases.
Functions:
| Name | Description |
|---|---|
get_iperf_logs |
Check logs and returns traffic flow. |
parse_iperf_logs |
Parse iperf logs and return bitrate, transfer etc. |
set_device_interface_state |
Toggle the interface based on the action passed. |
start_iperf_ipv4 |
Initiate IPv4 downstream traffic from source device to destination device. |
start_iperf_ipv4_bidirectional |
Initiate IPv4 bidirectional traffic from source device to destination device. |
start_iperf_ipv4_downstream |
Initiate IPv4 downstream traffic from source device to destination device. |
start_iperf_ipv6 |
Initiate IPv6 downstream traffic from source device to destination device. |
start_iperf_ipv6_bidirectional |
Initiate IPv6 bidirectional traffic from source device to destination device. |
start_iperf_ipv6_downstream |
Initiate IPv6 downstream traffic from source device to destination device. |
stop_iperf_traffic |
Stop the iPerf3 processes on sender as well as receiver. |
get_iperf_logs
get_iperf_logs(iperf_data: IPerf3TrafficGenerator) -> dict
Check logs and returns traffic flow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
IPerf3TrafficGenerator
|
IPerf3TrafficGenerator, holds sender and reciever info. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
traffic logs of both server and client. |
Source code in boardfarm3/use_cases/iperf.py
493 494 495 496 497 498 499 500 501 502 503 | |
parse_iperf_logs
parse_iperf_logs(
iperf_logs: str, is_client_log: bool = False, udp_only: bool | None = None
) -> dict[str, str]
Parse iperf logs and return bitrate, transfer etc.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
client or server logs |
required |
|
bool
|
True if client logs to be prased, defaults to False |
False
|
|
bool | None
|
to be used if protocol is UDP only, backward compatibility with iperf version 2 |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
dict with throughput, transfer, interval values. |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
If unable to parse output |
Source code in boardfarm3/use_cases/iperf.py
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 | |
set_device_interface_state
set_device_interface_state(
device: LAN | WAN | WLAN, interface: str, action: Literal["up", "down"]
) -> None
Toggle the interface based on the action passed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | WLAN
|
device instance |
required |
|
str
|
name of the interface |
required |
|
Literal['up', 'down']
|
up or down |
required |
Source code in boardfarm3/use_cases/iperf.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | |
start_iperf_ipv4
start_iperf_ipv4(
source_device: LAN | WAN | WLAN,
destination_device: LAN | WAN | WLAN,
source_port: int,
time: int,
udp_protocol: bool,
direction: str | None = None,
destination_port: int | None = None,
bind_sender_ip: str | None = None,
bind_receiver_ip: str | None = None,
destination_ip: str | None = None,
client_port: int | None = None,
udp_only: bool | None = None,
) -> IPerf3TrafficGenerator
Initiate IPv4 downstream traffic from source device to destination device.
Starts the iPerf3 server on a traffic receiver and triggers the IPv4 only traffic from source device.
if unable to start traffic sender, stops the process for receiver
.. hint:: This Use Case implements statements from the test suite such as:
- Start an iPerf server on LAN/WAN host
- Start an iPerf client on LAN/WAN host
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | WLAN
|
device instance |
required |
|
LAN | WAN | WLAN
|
device instance |
required |
|
int
|
source port to listen on/connect to |
required |
|
int
|
time in seconds to transmit |
required |
|
bool
|
use UDP rather than TCP |
required |
|
str | None
|
|
None
|
|
int | None
|
destination port to listen on/connect to |
None
|
|
str | None
|
bind to the interface associated with the client address, defaults to None |
None
|
|
str | None
|
bind to the interface associated with the host address, defaults to None |
None
|
|
str | None
|
IPv4 address used for iPerf traffic, defaults to None |
None
|
|
int | None
|
client port from where the traffic is getting started |
None
|
|
bool | None
|
to be used if protocol is UDP only, backward compatibility with iperf version 2 |
None
|
Returns:
| Type | Description |
|---|---|
IPerf3TrafficGenerator
|
IPerf3TrafficGenerator data class that holds sender/receiver devices, their process ids and log file details |
Source code in boardfarm3/use_cases/iperf.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
start_iperf_ipv4_bidirectional
start_iperf_ipv4_bidirectional(
source_device: LAN | WAN | WLAN,
destination_device: LAN | WAN | WLAN,
source_port: int,
time: int,
udp_protocol: bool,
destination_port: int | None = None,
bind_sender_ip: str | None = None,
bind_receiver_ip: str | None = None,
destination_ip: str | None = None,
udp_only: bool | None = None,
) -> IPerf3TrafficGenerator
Initiate IPv4 bidirectional traffic from source device to destination device.
Executes the initiate_v4_traffic Use Case in bidirectional mode.
.. hint:: This Use Case implements statements from the test suite such as:
- Start an iPerf server on LAN/WAN host
- Start an iPerf client on LAN/WAN host
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | WLAN
|
device instance |
required |
|
LAN | WAN | WLAN
|
device instance |
required |
|
int
|
source port to listen on/connect to |
required |
|
int
|
time in seconds to transmit |
required |
|
bool
|
use UDP rather than TCP |
required |
|
int | None
|
destination port to listen on/connect to |
None
|
|
str | None
|
bind to the interface associated with the client address, defaults to None |
None
|
|
str | None
|
bind to the interface associated with the host address, defaults to None |
None
|
|
str | None
|
IPv4 address used for iPerf traffic, defaults to None |
None
|
|
bool | None
|
to be used if protocol is UDP only, backward compatibility with iperf version 2 |
None
|
Returns:
| Type | Description |
|---|---|
IPerf3TrafficGenerator
|
IPerf3TrafficGenerator data class that holds sender/receiver devices, their process ids and log file details |
Source code in boardfarm3/use_cases/iperf.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
start_iperf_ipv4_downstream
start_iperf_ipv4_downstream(
source_device: LAN | WAN | WLAN,
destination_device: LAN | WAN | WLAN,
source_port: int,
time: int,
udp_protocol: bool,
destination_port: int | None = None,
bind_sender_ip: str | None = None,
bind_receiver_ip: str | None = None,
destination_ip: str | None = None,
udp_only: bool | None = None,
) -> IPerf3TrafficGenerator
Initiate IPv4 downstream traffic from source device to destination device.
Executes the initiate_v4_traffic Use Case in downstream mode.
.. hint:: This Use Case implements statements from the test suite such as:
- Start an iPerf server on LAN/WAN host
- Start an iPerf client on LAN/WAN host
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | WLAN
|
device instance |
required |
|
LAN | WAN | WLAN
|
device instance |
required |
|
int
|
source port to listen on/connect to |
required |
|
int
|
time in seconds to transmit |
required |
|
bool
|
use UDP rather than TCP |
required |
|
int | None
|
destination port to listen on/connect to |
None
|
|
str | None
|
bind to the interface associated with the client address, defaults to None |
None
|
|
str | None
|
bind to the interface associated with the host address, defaults to None |
None
|
|
str | None
|
IPv4 address used for iPerf traffic, defaults to None |
None
|
|
bool | None
|
to be used if protocol is UDP only, backward compatibility with iperf version 2 |
None
|
Returns:
| Type | Description |
|---|---|
IPerf3TrafficGenerator
|
IPerf3TrafficGenerator data class that holds sender/receiver devices, their process ids and log file details |
Source code in boardfarm3/use_cases/iperf.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | |
start_iperf_ipv6
start_iperf_ipv6(
source_device: LAN | WAN | WLAN,
destination_device: LAN | WAN | WLAN,
source_port: int,
time: int,
udp_protocol: bool,
direction: str | None = None,
destination_port: int | None = None,
bind_sender_ip: str | None = None,
bind_receiver_ip: str | None = None,
destination_ip: str | None = None,
client_port: int | None = None,
udp_only: bool | None = None,
) -> IPerf3TrafficGenerator
Initiate IPv6 downstream traffic from source device to destination device.
Starts the iPerf3 server on a traffic receiver and triggers the IPv6 only traffic from source device.
if unable to start traffic sender, stops the process for receiver
.. hint:: This Use Case implements statements from the test suite such as:
- Start an iPerf server on LAN/WAN host
- Start an iPerf client on LAN/WAN host
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | WLAN
|
device instance |
required |
|
LAN | WAN | WLAN
|
device instance |
required |
|
int
|
source port to listen on/connect to |
required |
|
int
|
time in seconds to transmit |
required |
|
bool
|
use UDP rather than TCP |
required |
|
Literal['--reverse', '--bidir']
|
|
None
|
|
int | None
|
destination port to listen on/connect to |
None
|
|
str | None
|
bind to the interface associated with the client address, defaults to None |
None
|
|
str | None
|
bind to the interface associated with the host address, defaults to None |
None
|
|
str | None
|
IPv6 address used for iPerf traffic, defaults to None |
None
|
|
int | None
|
client port from where the traffic is getting started |
None
|
|
bool | None
|
to be used if protocol is UDP only, backward compatibility with iperf version 2 |
None
|
Returns:
| Type | Description |
|---|---|
IPerf3TrafficGenerator
|
IPerf3TrafficGenerator data class that holds sender/receiver devices, their process ids and log file details |
Source code in boardfarm3/use_cases/iperf.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |
start_iperf_ipv6_bidirectional
start_iperf_ipv6_bidirectional(
source_device: LAN | WAN | WLAN,
destination_device: LAN | WAN | WLAN,
source_port: int,
time: int,
udp_protocol: bool,
destination_port: int | None = None,
bind_sender_ip: str | None = None,
bind_receiver_ip: str | None = None,
destination_ip: str | None = None,
udp_only: bool | None = None,
) -> IPerf3TrafficGenerator
Initiate IPv6 bidirectional traffic from source device to destination device.
Executes the initiate_v6_traffic Use Case in bidirectional mode.
.. hint:: This Use Case implements statements from the test suite such as:
- Start an iPerf server on LAN/WAN host
- Start an iPerf client on LAN/WAN host
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | WLAN
|
device instance for iperf client |
required |
|
LAN | WAN | WLAN
|
device instance for iPerf server |
required |
|
int
|
server port to listen on/connect to |
required |
|
int
|
time in seconds to transmit |
required |
|
bool
|
use UDP rather than TCP |
required |
|
int | None
|
destination port to listen on/connect to, defaults to None |
None
|
|
str | None
|
bind to the interface associated with the client address,, defaults to None |
None
|
|
str | None
|
bind to the interface associated with the host address, defaults to None |
None
|
|
str | None
|
IPv6 address used for iPerf traffic, defaults to None |
None
|
|
bool | None
|
to be used if protocol is UDP only, backward compatibility with iperf version 2 |
None
|
Returns:
| Type | Description |
|---|---|
IPerf3TrafficGenerator
|
IPerf3TrafficGenerator data class that holds sender/receiver devices, their process ids and log file details |
Source code in boardfarm3/use_cases/iperf.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |
start_iperf_ipv6_downstream
start_iperf_ipv6_downstream(
source_device: LAN | WAN | WLAN,
destination_device: LAN | WAN | WLAN,
source_port: int,
time: int,
udp_protocol: bool,
destination_port: int | None = None,
bind_sender_ip: str | None = None,
bind_receiver_ip: str | None = None,
destination_ip: str | None = None,
udp_only: bool | None = None,
) -> IPerf3TrafficGenerator
Initiate IPv6 downstream traffic from source device to destination device.
Executes the initiate_v6_traffic Use Case with downstream mode.
.. hint:: This Use Case implements statements from the test suite such as:
- Start an iPerf server on LAN/WAN host
- Start an iPerf client on LAN/WAN host
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | WLAN
|
device instance for iperf client |
required |
|
LAN | WAN | WLAN
|
device instance for iPerf server |
required |
|
int
|
server port to listen on/connect to |
required |
|
int
|
time in seconds to transmit |
required |
|
bool
|
use UDP rather than TCP |
required |
|
int | None
|
destination port to listen on/connect to, defaults to None |
None
|
|
str | None
|
bind to the interface associated with the client address,, defaults to None |
None
|
|
str | None
|
bind to the interface associated with the host address, defaults to None |
None
|
|
str | None
|
IPv6 address used for iPerf traffic, defaults to None |
None
|
|
bool | None
|
to be used if protocol is UDP only, backward compatibility with iperf version 2 |
None
|
Returns:
| Type | Description |
|---|---|
IPerf3TrafficGenerator
|
IPerf3TrafficGenerator data class that holds sender/receiver devices, their process ids and log file details |
Source code in boardfarm3/use_cases/iperf.py
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | |
stop_iperf_traffic
stop_iperf_traffic(iperf_generator: IPerf3TrafficGenerator) -> None
Stop the iPerf3 processes on sender as well as receiver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
IPerf3TrafficGenerator
|
data class that holds sender/receiver devices and their process IDs |
required |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
when either iPerf3 server or client PID can't be killed |
Source code in boardfarm3/use_cases/iperf.py
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 | |
multicast
Multicast Use Cases.
This will include connecting to a multicast stream via iPerf, ip-mroute or smcroute.
Functions:
| Name | Description |
|---|---|
join_iperf_multicast_asm_group |
Start an iPerf server binding to a multicast address in background. |
join_iperf_multicast_ssm_group |
Start an iPerf server binding to a multicast address in background. |
kill_all_iperf |
Kill all iPerf sessions on target devices. |
leave_iperf_multicast_group |
Send IGMP leave to stop receiving multicast traffic. |
parse_mcast_trace |
Compare captured PCAP file against an expected sequence of packets. |
start_iperf_multicast_stream |
Start an iPerf client sending data on multicast address in background. |
tcpdump |
Start packet capture using tcpdump and kill the process at the end. |
wait_for_multicast_stream_to_end |
Wait for all multicast streams to end. |
join_iperf_multicast_asm_group
join_iperf_multicast_asm_group(
on_which_device: IperfDevice, multicast_group_addr: str, port: int
) -> IPerfSession
Start an iPerf server binding to a multicast address in background.
This Use Case is applicable for ASM (any-source multicast) channels (*,G)
Session will have the following parameters by default: - 1s interval between periodic bandwidth, jitter, and loss reports.
The Use Case will return an iPerf Session object holding following info: - Target device class object on which iperf command is executed - PID of the iPerf session - Multicast group address - Multicast port - CSV output file of the iperf session
.. note::
- CSV output file can only be accessed once you leave the multicast group.
.. hint:: This Use Case implements statements from the test suite such as:
- Start an Ethernet LAN client to request CPE for
IPv4 ASM traffic from WAN multicast server
- Start client to join/subscribe any source multicast channel (S,G)
by sending IGMPv3 report
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
IperfDevice
|
Object of the device that joins the mcast group |
required |
|
str
|
multicast stream's group IP address to join |
required |
|
int
|
multicast stream's port number |
required |
Returns:
| Type | Description |
|---|---|
IPerfSession
|
object holding data on the iPerf Session |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
if there is a multicat stream. |
Source code in boardfarm3/use_cases/multicast.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | |
join_iperf_multicast_ssm_group
join_iperf_multicast_ssm_group(
on_which_device: IperfDevice,
multicast_source_addr: str,
multicast_group_addr: str,
port: int,
) -> IPerfSession
Start an iPerf server binding to a multicast address in background.
This Use Case is applicable for SSM (source-specific multicast) channels (S,G)
Session will have the following parameters by default: - 1s interval between periodic bandwidth, jitter, and loss reports.
The Use Case will return an iPerf Session object holding following info: - Target device class object on which iperf command is executed - PID of the iperf session - Multicast group address - Multicast port - CSV output file of the iPerf session
.. note::
- The multicast source will always be a WAN device.
- CSV output file can only be accessed once you leave the multicast group.
.. hint:: This Use Case implements statements from the test suite such as:
- Start an Ethernet LAN client to request CPE for
IPv4 SSM traffic from WAN multicast server
- Start client to join/subscribe a specific source and Group (S,G)
channel by sending IGMPv3 report
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
IperfDevice
|
Object of the device that joins the mcast group |
required |
|
str
|
WAN IP address used to run the mcast stream |
required |
|
str
|
multicast stream's group IP address to join |
required |
|
int
|
multicast stream's port number |
required |
Returns:
| Type | Description |
|---|---|
IPerfSession
|
object holding data on the iPerf Session |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
if there is a multicat stream. |
Source code in boardfarm3/use_cases/multicast.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | |
kill_all_iperf
kill_all_iperf(device_list: list[IperfDevice]) -> None
Kill all iPerf sessions on target devices.
This should be called for cleaning purposes.
.. hint:: This Use Case implements statements from the test suite such as:
- Kill all iPerf session on target devices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[IperfDevice]
|
list of target devices |
required |
Source code in boardfarm3/use_cases/multicast.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |
leave_iperf_multicast_group
leave_iperf_multicast_group(session: IPerfSession) -> IPerfResult
Send IGMP leave to stop receiving multicast traffic.
This is achieved by stopping the iPerf server bounded to a multicast channel ASM/SSM.
Executes a kill -15
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
IPerfSession
|
Session object created during the join |
required |
Returns:
| Type | Description |
|---|---|
IPerfResult
|
iPerf result |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
If the device fails to leave the multicast group. |
Source code in boardfarm3/use_cases/multicast.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 | |
parse_mcast_trace
parse_mcast_trace(
dev: IperfDevice,
fname: str,
expected_sequence: list[tuple[str, ...]],
ip_version: int = 4,
) -> list[tuple[str, ...]]
Compare captured PCAP file against an expected sequence of packets.
This returns a matched subset of the whole packet trace. The sequence of the matched packets must align with expected sequence. The length of the matched sequence is equal to expected sequence.
In case a packet is missing in captured sequence, an empty value is maintained in output at the same index as that of the expected sequence.
IP packets in expected sequence must follow the following order:
- IP source
- IP destination
- MAC source
- MAC destination
- IP protocol number (1 - ICMP, 2 - IGMP, 6 - TCP, 17 - UDP)
- IGMP version (v3 by default)
- IGMP Record Type number (5 - Allow new sources, 6 - Block old sources)
- IGMP Multicast Address (if provided in group records)
- IGMP Source Address (if provided in group records)
IPv6 packets will be parsed and following values are returned in a list:
- IPv6 source
- IPv6 destination
- MAC source
- MAC destination
- IPv6 Next Header (0 - ICMPv6, 6 - TCP, 17 - UDP)
- MLDv2 version (130 - MLDv2 Query, 143 - MLDv2 Report)
- MLDv2 Record Type number (5 - Allow new sources, 6 - Block old sources)
- MLDv2 Multicast Address (if provided in group records)
- MLDv2 Source Address (if provided in group records)
You can use * to mark a field as Any
.. hint:: This Use Case implements statements from the test suite such as: test suite such as:
- Check IGMPv3 report to subscribe to (S,G) from LAN on eRouter
LAN interface
- Check Multicast traffic from WAN multicast server is received
on eRouter WAN interface and forwarded to Ethernet LAN client
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
IperfDevice
|
Descriptor of iPerf capable device with PCAP file |
required |
|
str
|
name of the PCAP file |
required |
|
list[tuple[str, ...]]
|
expected sequence to match against captured sequence |
required |
|
int
|
IP version, defaults to 4 |
4
|
Returns:
| Type | Description |
|---|---|
list[tuple[str, ...]]
|
matched captured sequence against the expected sequence |
Source code in boardfarm3/use_cases/multicast.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
start_iperf_multicast_stream
start_iperf_multicast_stream(
on_which_device: WAN,
multicast_group_addr: str,
port: int,
time: int,
bit_rate: float,
) -> IPerfStream
Start an iPerf client sending data on multicast address in background.
Session will have the following parameters by default: - TTL value set to 5
.. hint:: This Use Case implements statements from the test suite such as:
- Start multicast server on WAN network to provide
the multicast traffic in unreserved multicast group IP
range 232.0.0.0/8
- Start multicast server on WAN network to provide
the multicast traffic in unreserved multicast group IP
range FF38::8000:0/96
- Start multicast stream on a specific Group channel
by sending IGMPv3 report
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WAN
|
WAN object that runs the multicast stream. |
required |
|
str
|
multicast stream's group IP address |
required |
|
int
|
multicast stream's port number |
required |
|
int
|
total time the session should run for |
required |
|
float
|
bit_rate of data to be sent (in Mbps) |
required |
Returns:
| Type | Description |
|---|---|
IPerfStream
|
object holding data on the iPerf stream. |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
if there is a multicat stream. |
Source code in boardfarm3/use_cases/multicast.py
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | |
tcpdump
Start packet capture using tcpdump and kill the process at the end.
Applies specific filter for multicast traffic only.
.. hint:: This Use Case implements statements from the test suite such as:
- Capturing packets sent from and to eRouter WAN and eRouter LAN interfaces
- Make sure you can capture packets sent from and to eRouter WAN interface
and Ethernet LAN client
:yield: process ID
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
IperfDevice
|
LAN, WAN or WLAN device instance |
required |
|
str
|
name of the pcap file to which the capture will be stored |
required |
|
str | None
|
additional filters for capture, defaults to "ip multicast" |
'ip multicast'
|
Source code in boardfarm3/use_cases/multicast.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
wait_for_multicast_stream_to_end
wait_for_multicast_stream_to_end(stream_list: list[IPerfStream]) -> None
Wait for all multicast streams to end.
The Use Case will wait for a time equal to the stream with the highest wait time.
If a stream from the list does not exit within the max wait time, then throw an error.
.. hint:: To be used along with the Use Case start_iperf_multicast_stream
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[IPerfStream]
|
List of IPerfStreams |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
if empty list is passed |
UseCaseFailure
|
if a session fails to exit. |
Source code in boardfarm3/use_cases/multicast.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 | |
networking
Common Networking use cases.
Functions:
| Name | Description |
|---|---|
connect_via_ssh |
SSH from a device to another. |
create_tcp_session |
Create a TCP session from source to destination device on a port. |
create_tcp_udp_session |
Create both TCP and UDP session from source to destination device on a port. |
create_udp_session |
Create a UDP session from source to destination device on a port. |
delete_arp_table_entry |
Delete arp table entry. |
disable_ipv6 |
Disable ipv6 on the specified interface. |
dns_lookup |
Perform |
enable_ipv6 |
Enable IPv6 on the specified interface. |
flush_arp_cache |
Flushes arp cache entries. |
get_arp_table_info |
Fetch arp entries. |
get_interface_mac_addr |
Get the MAC address of the provided interface. |
get_ip6tables_list |
Return ip6tables rules as dictionary. |
get_ip6tables_policy |
Get firewall's ip6tables policy. |
get_iptables_list |
Return iptables rules as dictionary. |
get_iptables_policy |
Return iptables policies as dictionary. |
get_nslookup_data |
Perform nslookup with given arguments and return the parsed results. |
hping_flood |
Validate SYN, UDP and ICMP flood operation. |
http_get |
Check if the given HTTP server is running. |
is_client_ip_in_pool |
Check for client IP in IP pool. |
is_icmp_packet_present |
Check whether the expected ICMP sequence matches with the captured sequence. |
is_ip6table_empty |
Return True if ip6tables is empty. |
is_iptable_empty |
Return True if iptables is empty. |
netcat |
Run netcat command to initiate brute force. |
netstat_all_tcp |
Get all TCP ports. |
netstat_all_udp |
Get all UDP ports. |
netstat_listening_ports |
Get all listening ports. |
nmap_scan |
Perform Complete scan on destination via nmap network utility on source device. |
nping |
Perform nping command and kill process once done. |
ping |
Ping remote host IP. |
start_http_server |
Start http server on given client. |
trigger_ip_flood |
Perform IP flooding via nmap network utility on source device. |
verify_tunnel_packets |
Verify the expected encapsulated info with the captured sequence. |
connect_via_ssh
connect_via_ssh(
from_which_device: SSHDeviceType,
to_which_device: SSHDeviceType,
protocol: int = 4,
username: str = "root",
password: str = "bigfoot1",
) -> bool
SSH from a device to another.
This use case validates if SSH is possible from a device to another.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
SSHDeviceType
|
Device initiating the SSH connection |
required |
|
SSHDeviceType
|
Target SSH device |
required |
|
int
|
IP address family, defaults to 4 |
4
|
|
str
|
SSH username, defaults to root |
'root'
|
|
str
|
SSH password, defaults to bigfoot1 |
'bigfoot1'
|
Returns:
| Type | Description |
|---|---|
bool
|
True if SSH successful, else False |
Raises:
| Type | Description |
|---|---|
ConnectionError
|
If connectivity exists, but SSH not successful |
Source code in boardfarm3/use_cases/networking.py
828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 | |
create_tcp_session
create_tcp_session(
source_device: LAN | WLAN | WAN,
destination_device: LAN | WLAN | WAN | CPE,
ip_type: str,
port: str | int,
max_retries: int = 4,
timeout: int = 30,
) -> dict[str, str]
Create a TCP session from source to destination device on a port.
.. hint:: This Use Case implements statements from the test suite such as:
- Create a TCP session from source to destination device on a port.
Runs nmap network utility on source device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WLAN | WAN
|
Source device |
required |
|
LAN | WLAN | WAN | CPE
|
destination device |
required |
|
str
|
type of IP address: "ipv4", "ipv6" |
required |
|
str | int
|
port or range of ports: "666-999" |
required |
|
int
|
maximum number retries for nmap |
4
|
|
int
|
pexpect timeout for the command in seconds, defaults to 30 |
30
|
Returns:
| Type | Description |
|---|---|
dict[str,str]
|
XML output of the nmap command in form of dictionary |
Source code in boardfarm3/use_cases/networking.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |
create_tcp_udp_session
create_tcp_udp_session(
source_device: LAN | WLAN | WAN,
destination_device: LAN | WLAN | WAN | CPE,
ip_type: str,
port: str | int,
max_retries: int = 4,
timeout: int = 30,
) -> dict[str, str]
Create both TCP and UDP session from source to destination device on a port.
.. hint:: This Use Case implements statements from the test suite such as:
- Run nmap from client to erouter WAN IP.
Runs nmap network utility on source device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WLAN | WAN
|
source device |
required |
|
LAN | WLAN | WAN | CPE
|
destination device |
required |
|
str
|
type of IP address: "ipv4", "ipv6" |
required |
|
str | int
|
port or range of ports: "666-999" |
required |
|
int
|
maximum number retries for nmap |
4
|
|
int
|
pexpect timeout for the command in seconds, defaults to 30 |
30
|
Returns:
| Type | Description |
|---|---|
dict[str,str]
|
XML output of the nmap command in form of dictionary |
Source code in boardfarm3/use_cases/networking.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | |
create_udp_session
create_udp_session(
source_device: LAN | WLAN | WAN,
destination_device: LAN | WLAN | WAN | CPE,
ip_type: str,
port: str | int,
max_retries: int,
timeout: int = 30,
) -> dict[str, str]
Create a UDP session from source to destination device on a port.
.. hint:: This Use Case implements statements from the test suite such as:
- Create a UDP session from source to destination device on a port.
Runs nmap network utility on source device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WLAN | WAN
|
Source device |
required |
|
LAN | WLAN | WAN | CPE
|
Destination device |
required |
|
str
|
type of ipaddress: "ipv4", "ipv6" |
required |
|
str | int
|
port or range of ports: "666-999" |
required |
|
int
|
maximum number retries for nmap |
required |
|
int
|
pexpect timeout for the command in seconds, defaults to 30 |
30
|
Returns:
| Type | Description |
|---|---|
dict[str,str]
|
XML output of the nmap command in form of dictionary |
Source code in boardfarm3/use_cases/networking.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | |
delete_arp_table_entry
Delete arp table entry.
.. hint:: This Use Case implements statements from the test suite such as:
Delete ARP table entry
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN
|
device on which cache to be cleared |
required |
|
str
|
ip of the host entry to be deleted |
required |
|
str
|
interface on which the host needs to be deleted |
required |
Source code in boardfarm3/use_cases/networking.py
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 | |
disable_ipv6
Disable ipv6 on the specified interface.
The use case executes the following commands:
- sysctl net.ipv6.conf.
.. hint:: This Use Case implements statements from the test suite such as:
- Disable IPv6 on the specified interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WLAN
|
LAN or WLAN device object |
required |
Source code in boardfarm3/use_cases/networking.py
494 495 496 497 498 499 500 501 502 503 504 505 506 507 | |
dns_lookup
dns_lookup(
host: LAN | WAN, domain_name: str, ipv6: bool = False, opts: str = ""
) -> list[dict[str, Any]]
Perform dig command in the devices to resolve DNS.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify that IPv4 domain name can be resolved to IP.
- Verify the DNS IPv4 address assigned by the service provider
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN
|
host where the dig command has to be run |
required |
|
str
|
domain name which needs lookup |
required |
|
bool
|
flag to perform IPv4 or IPv6 lookup, defaults to False |
False
|
|
str
|
options to be provided to dig command, defaults to "" |
''
|
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
returns dig output from jc parser |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
when domain_name cannot resolve |
Source code in boardfarm3/use_cases/networking.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |
enable_ipv6
Enable IPv6 on the specified interface.
The Use Case executes the following commands:
- sysctl net.ipv6.conf.
.. hint:: This Use Case implements statements from the test suite such as:
- Enable IPv6 on the specified interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WLAN
|
LAN or WLAN device object |
required |
Source code in boardfarm3/use_cases/networking.py
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | |
flush_arp_cache
Flushes arp cache entries.
.. hint:: This Use Case implements statements from the test suite such as:
Generate ARP Request for...
- ping can be used post clearing cache and ARP pakcets can be ovserved in pkt capture
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN
|
device on which cache to be cleared |
required |
Source code in boardfarm3/use_cases/networking.py
981 982 983 984 985 986 987 988 989 990 991 992 993 994 | |
get_arp_table_info
Fetch arp entries.
.. hint:: This Use Case implements statements from the test suite such as:
Show ARP table / Get ARP entries
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN
|
device on which cache to be cleared |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, str]]
|
list of parsed ARP table entries |
Source code in boardfarm3/use_cases/networking.py
997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 | |
get_interface_mac_addr
Get the MAC address of the provided interface.
.. hint:: This Use Case implements statements from the test suite such as:
- Get the mac address of the provided interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WLAN | WAN | CPE
|
device having the interface |
required |
|
str
|
interface name |
required |
Returns:
| Type | Description |
|---|---|
str
|
MAC address of the provided interface |
Source code in boardfarm3/use_cases/networking.py
510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 | |
get_ip6tables_list
get_ip6tables_list(
device: DeviceWithFwType, opts: str = "", extra_opts: str = "-nvL --line-number"
) -> dict[str, list[dict]]
Return ip6tables rules as dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DeviceWithFwType
|
type of the device |
required |
|
str
|
_command line arguments for ip6tables command, defaults to "" |
''
|
|
str
|
extra command line arguments for ip6tables command, defaults to -nvL --line-number |
'-nvL --line-number'
|
Returns:
| Type | Description |
|---|---|
dict[str, list[dict]]
|
ip6tables rules dictionary |
Source code in boardfarm3/use_cases/networking.py
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 | |
get_ip6tables_policy
get_ip6tables_policy(
device: DeviceWithFwType, opts: str = "", extra_opts: str = "-nvL --line-number"
) -> dict[str, str]
Get firewall's ip6tables policy.
.. hint:: This Use Case implements statements from the test suite such as:
- Get the Firewall's ip6tables policy
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DeviceWithFwType
|
device instance |
required |
|
str
|
options for ip6tables command, defaults to "" |
''
|
|
str
|
options for ip6tables command, defaults to "-nvL --line-number" |
'-nvL --line-number'
|
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
dict of ip6tables policy |
Source code in boardfarm3/use_cases/networking.py
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 | |
get_iptables_list
get_iptables_list(
device: DeviceWithFwType, opts: str = "", extra_opts: str = "-nvL --line-number"
) -> dict[str, list[dict]]
Return iptables rules as dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DeviceWithFwType
|
type of the device |
required |
|
str
|
_command line arguments for iptables command, defaults to "" |
''
|
|
str
|
extra command line arguments for iptables command, defaults to -nvL --line-number |
'-nvL --line-number'
|
Returns:
| Type | Description |
|---|---|
dict[str, list[dict]]
|
iptables rules dictionary |
Source code in boardfarm3/use_cases/networking.py
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 | |
get_iptables_policy
get_iptables_policy(
device: DeviceWithFwType, opts: str = "", extra_opts: str = "-nvL --line-number"
) -> dict[str, str]
Return iptables policies as dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DeviceWithFwType
|
type of the device |
required |
|
str
|
command line arguments for iptables command, defaults to "" |
''
|
|
str
|
extra command line arguments for iptables command, defaults to "-nvL --line-number" |
'-nvL --line-number'
|
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
iptables policies dictionary |
Source code in boardfarm3/use_cases/networking.py
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 | |
get_nslookup_data
get_nslookup_data(
device: LAN | WAN, domain_name: str, opts: str = "", extra_opts: str = ""
) -> dict[str, Any]
Perform nslookup with given arguments and return the parsed results.
to get A records, pass -q=A in opts
to get AAAA records, pass -q=AAAA in opts
to just get the DNS records, opts and extra opts are not needed
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN
|
type of the device |
required |
|
str
|
domain name to perform nslookup on |
required |
|
str
|
nslookup command line options, defaults to "" |
''
|
|
str
|
nslookup additional command line options, defaults to "" |
''
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
parsed nslookup results as dictionary |
Source code in boardfarm3/use_cases/networking.py
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 | |
hping_flood
hping_flood(
device: LAN | WAN,
protocol: str,
target: str,
packet_count: str,
extra_args: str | None = None,
pkt_interval: str = "",
) -> str
Validate SYN, UDP and ICMP flood operation.
.. hint:: This Use Case implements statements from the test suite such as:
- To validate SYN flood, ICMP flood (from WAN & LAN) and UDP flood (from WAN)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN
|
object of the device class where tcpdump is captured |
required |
|
str
|
mode, for ex 'S': syn-flood '1': ping-flood (icmp) '2': udp |
required |
|
str
|
target IP addr |
required |
|
str
|
number of packets to be transmitted. |
required |
|
str | None
|
extra arguments to be passed, defaults to None |
None
|
|
str
|
wait for X microseconds before sending next packet uX, defaults to "", uX for X microseconds, for example -i u1000 |
''
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Source code in boardfarm3/use_cases/networking.py
881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 | |
http_get
http_get(
device: LAN | WAN,
url: str,
timeout: int = 20,
no_proxy: bool = False,
is_insecure: bool = False,
follow_redirects: bool = False,
) -> HTTPResult
Check if the given HTTP server is running.
This Use Case executes a curl command with a given timeout from the given client. The destination is specified by the URL parameter
.. hint:: This Use Case implements statements from the test suite such as:
- Verify HTTP server is accessible from [] via eRouter IP
- Verify that the HTTP server running on the client is accessible
- Try to connect to the HTTP server from [] client
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN
|
the device from where HTTP response to get |
required |
|
str
|
URL to get the response |
required |
|
int
|
connection timeout for the curl command in seconds, default 20 |
20
|
|
bool
|
no_proxy option for curl command, defaults to False |
False
|
|
bool
|
is_insecure option for curl command, defaults to False |
False
|
|
bool
|
follow_redirects option for curl command, defaults to False |
False
|
Returns:
| Type | Description |
|---|---|
HTTPResult
|
parsed HTTP Get response |
Source code in boardfarm3/use_cases/networking.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
is_client_ip_in_pool
is_client_ip_in_pool(
pool_bounds: tuple[IPv4Address, IPv4Address], client: LAN | WAN
) -> bool
Check for client IP in IP pool.
.. hint:: This Use Case implements statements from the test suite such as:
- Configure the LAN client with Static IP from the higher range of the subnet
defined in the config file and Default gateway is set to the lowest IP
(eRouter LAN interface) address of subnet
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
tuple[IPv4Address, IPv4Address]
|
lowest and highest IP from DHCP pool |
required |
|
LAN | WAN
|
client to be checked |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if LAN/WIFILAN IP is lowest in pool range |
Source code in boardfarm3/use_cases/networking.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | |
is_icmp_packet_present
is_icmp_packet_present(
captured_sequence: list[ICMPPacketData], expected_sequence: list[ICMPPacketData]
) -> bool
Check whether the expected ICMP sequence matches with the captured sequence.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[ICMPPacketData]
|
Sequence of ICMP packets filtered from captured pcap file |
required |
|
list[ICMPPacketData]
|
Example for IPv4 source and destination and |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if ICMP expected sequences matches with the captured sequence |
Source code in boardfarm3/use_cases/networking.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
is_ip6table_empty
is_ip6table_empty(
device: DeviceWithFwType, opts: str = "", extra_opts: str = "-nvL --line-number"
) -> bool
Return True if ip6tables is empty.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DeviceWithFwType
|
type of the device |
required |
|
str
|
command line arguments for ip6tables command, defaults to "" |
''
|
|
str
|
extra command line arguments for ip6tables command, defaults to "" |
'-nvL --line-number'
|
Returns:
| Type | Description |
|---|---|
bool
|
True if ip6tables is empty, False otherwise |
Source code in boardfarm3/use_cases/networking.py
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | |
is_iptable_empty
is_iptable_empty(
device: DeviceWithFwType, opts: str = "", extra_opts: str = "-nvL --line-number"
) -> bool
Return True if iptables is empty.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DeviceWithFwType
|
type of the device |
required |
|
str
|
command line arguments for iptables command, defaults to "" |
''
|
|
str
|
extra command line arguments for iptables command, defaults to "" |
'-nvL --line-number'
|
Returns:
| Type | Description |
|---|---|
bool
|
True if iptables is empty, False otherwise |
Source code in boardfarm3/use_cases/networking.py
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 | |
netcat
netcat(device: LAN, host_ip: str, port: str, additional_args: str) -> None
Run netcat command to initiate brute force.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN
|
lan device |
required |
|
str
|
host ip address |
required |
|
str
|
port number of the host |
required |
|
str
|
additional args to be provided in netcat command |
required |
Source code in boardfarm3/use_cases/networking.py
705 706 707 708 709 710 711 712 713 714 715 716 717 | |
netstat_all_tcp
Get all TCP ports.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE | LAN | WAN
|
type of the device |
required |
|
str
|
command line options |
'-at'
|
|
str
|
extra command line options |
''
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
parsed netstat output |
Source code in boardfarm3/use_cases/networking.py
808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 | |
netstat_all_udp
Get all UDP ports.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE | LAN | WAN
|
type of the device |
required |
|
str
|
command line options |
'-au'
|
|
str
|
extra command line options |
''
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
parsed netstat output |
Source code in boardfarm3/use_cases/networking.py
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 | |
netstat_listening_ports
netstat_listening_ports(
device: CPE | LAN | WAN, opts: str = "-nlp", extra_opts: str = ""
) -> DataFrame
Get all listening ports.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPE | LAN | WAN
|
type of the device |
required |
|
str
|
command line options |
'-nlp'
|
|
str
|
extra command line options |
''
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
parsed netstat output |
Source code in boardfarm3/use_cases/networking.py
768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 | |
nmap_scan
nmap_scan(
source_device: LAN | WLAN | WAN,
destination_device: LAN | WLAN | WAN | CPE,
ip_type: str,
timeout: int = 30,
) -> dict[str, str]
Perform Complete scan on destination via nmap network utility on source device.
.. hint:: This Use Case implements statements from the test suite such as:
- Perform Complete scan on destination via nmap network utility on source device
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WLAN | WAN
|
source device |
required |
|
LAN | WLAN | WAN | CPE
|
destination device |
required |
|
str
|
type of IP address: "ipv4", "ipv6" |
required |
|
int
|
pexpect timeout for the command in seconds, defaults to 30 |
30
|
Returns:
| Type | Description |
|---|---|
dict[str,str]
|
XML output of the nmap command in form of dictionary |
Source code in boardfarm3/use_cases/networking.py
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | |
nping
nping(
device: LAN,
interface_ip: str,
ipv6: bool = False,
extra_args: str = "",
port_range: str = "0-65535",
hit_count: str = "2",
rate: str = "200",
mode: str = "udp",
) -> Generator[str]
Perform nping command and kill process once done.
.. hint:: This Use Case implements statements from the test suite such as:
- Execute the command from the connected LAN Client to do nping
on [] side network
:yield: process id
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN
|
connected client to perform nping command from. |
required |
|
str
|
interface ip addr |
required |
|
bool
|
if ipv6 addr to be used, defaults to False |
False
|
|
str
|
any extra arguments |
''
|
|
str
|
target port range, defaults to all ports |
'0-65535'
|
|
str
|
the number of times to target each host, defaults to 2 |
'2'
|
|
str
|
num of packets per second to send, defaults to 200 |
'200'
|
|
str
|
probe mode. tcp/udp/icmp etc protocol, defaults to udp |
'udp'
|
Source code in boardfarm3/use_cases/networking.py
720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 | |
ping
ping(
device: LAN | WAN | WLAN,
ping_ip: str,
ping_count: int = 4,
ping_interface: str | None = None,
timeout: int = 50,
json_output: bool = False,
options: str = "",
) -> bool | dict[str, Any]
Ping remote host IP.
Return True if ping has 0% loss or parsed output in JSON if json_output=True flag is provided.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | WLAN
|
device on which ping is performed |
required |
|
str
|
IP to ping |
required |
|
int
|
number of concurrent pings, defaults to 4 |
4
|
|
str | None
|
ping via interface, defaults to None |
None
|
|
int
|
timeout, defaults to 50 |
50
|
|
bool
|
True if ping output in dictionary format else False, defaults to False |
False
|
|
str
|
extra ping options, defaults to "" |
''
|
Returns:
| Type | Description |
|---|---|
bool | dict[str, Any]
|
bool or dict of ping output |
Source code in boardfarm3/use_cases/networking.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
start_http_server
start_http_server(
device: LAN | WAN, port: int | str, ip_version: str | int
) -> Generator
Start http server on given client.
.. hint:: This Use Case implements statements from the test suite such as:
- Start the HTTP server on the [] client
:yield: PID of the http server process
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN
|
device on which server will start |
required |
|
int | str
|
port on which the server listen for incomming connections |
required |
|
str | int
|
ip version of server values can strictly be 4 or 6 |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
wrong ip_version value is given in api call |
Source code in boardfarm3/use_cases/networking.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
trigger_ip_flood
trigger_ip_flood(
source_device: LAN | WLAN | WAN,
destination_device: LAN | WLAN | WAN | CPE,
ip_type: str,
port: str | int,
min_rate: int,
max_retries: int = 4,
timeout: int = 30,
) -> dict[str, str]
Perform IP flooding via nmap network utility on source device.
.. hint:: This Use Case implements statements from the test suite such as:
- Perform IP flooding via nmap network utility on source device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WLAN | WAN
|
source device |
required |
|
LAN | WLAN | WAN | CPE
|
destination device |
required |
|
str
|
type of IP address: "ipv4", "ipv6" |
required |
|
str | int
|
port or range of ports: "666-999" |
required |
|
int
|
send packets no slower than min_rate per second |
required |
|
int
|
maximum number retries for nmap |
4
|
|
int
|
pexpect timeout for the command in seconds, defaults to 30 |
30
|
Returns:
| Type | Description |
|---|---|
dict[str,str]
|
XML output of the nmap command in form of dictionary |
Source code in boardfarm3/use_cases/networking.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 | |
verify_tunnel_packets
verify_tunnel_packets(
captured_sequence: list[tuple[str, ...]], expected_sequence: list[tuple[str, ...]]
) -> bool
Verify the expected encapsulated info with the captured sequence.
.. hint:: This Use Case implements statements from the test suite such as:
- Traffic from Ethernet LAN client to Internet, must be encapsulated like below
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[tuple[str, ...]]
|
Sequence of packets filtered from captured pcap file |
required |
|
list[tuple[str, ...]]
|
Example for encapsulated traffic .. code-block:: python [ ( "10.1.2.105,10.15.137.242", "44:d4:54:e1:9e:57,44:d4:54:e1:9e:57", "172.30.113.175,8.8.8.8", "52:54:00:67:85:42,52:54:00:67:85:42", ) ] |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if ICMP expected sequences matches with the captured sequence and encapsulated as expected sequence with outer and inner layer |
Source code in boardfarm3/use_cases/networking.py
920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 | |
ripv2
RIPv2 Use Cases library.
All Use Cases are independent of the device.
Functions:
| Name | Description |
|---|---|
parse_rip_trace |
Read and filter RIP packets from the captured file. |
parse_rip_trace
parse_rip_trace(
dev: LAN | WAN, fname: str, frame_time: bool, rm_pcap: bool
) -> list[RIPv2PacketData]
Read and filter RIP packets from the captured file.
The Routing Information Protocol is one of a family of IP Routing protocols. RIP is a simple vector routing protocol. This usecase parses RIP protocol packets.
.. code-block:: python
# example usage
cmts_packet_cap = read_rip_trace(
device=LanClient, fname="some_capture.pcap", frame_time=False, rm_pcap=False
)
.. hint:: This Use Case implements statements from the test suite such as:
- Check that CPE is sending and receiving RIPv2 route advertisements to the CMTS
- Verify that CPE is sending RIPv2 route advertisements every 30 seconds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN
|
device where captures were taken, LAN, WAN |
required |
|
str
|
PCAP file to be read |
required |
|
bool
|
If True stores timestap value in RIPv2PacketData else stores None |
required |
|
bool
|
if True remove the PCAP file after reading else keeps the file |
required |
Returns:
| Type | Description |
|---|---|
List[RIPv2PacketData]
|
list of RIP packets as .. code-block:: python [ ( frame, src ip, dst ip, rip contact, rip msg:media_attribute:connection:info, time ) ] |
Raises:
| Type | Description |
|---|---|
UseCaseFailure
|
when no RIPv2 trace is found in PCAP file |
Source code in boardfarm3/use_cases/ripv2.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
voice
Voice use cases library.
This module deals with only SIP end points. All APIs are independent of board under test.
Functions:
| Name | Description |
|---|---|
add_user_profile |
Register user profile on the SIP Server. |
answer_a_call |
Answer a ringing call by target SIP agent. |
answer_waiting_call |
Answer the waiting call and hang up on the current call. |
call_a_number |
Have the Caller dial the given phone number. |
call_a_phone |
Call the Callee by the Caller. |
disable_call_forwarding_busy |
Disable call forwarding on a phone when busy. |
disable_call_forwarding_no_answer |
Disable call forwarding on a phone when not answered. |
disable_unconditional_call_forwarding |
Disable unconditional call forwarding on a phone. |
disconnect_the_call |
Disconnecting a call on a SIP agent. |
enable_call_forwarding_busy |
Enable call forwarding on a phone when busy. |
enable_call_forwarding_no_answer |
Enable call forwarding on a phone when there's no answer. |
enable_unconditional_call_forwarding |
Enable unconditional call forwarding on a phone. |
get_sip_expiry_time |
Get the call expiry timer from the config file. |
initialize_phone |
Configure the phone, and start the application. |
is_call_connected |
Verify if a call is connected. |
is_call_dialing |
Verify if a phone is dialing and a call in progress. |
is_call_ended |
Verify if the call has been disconnected and ended. |
is_call_idle |
Verify if a phone is in idle state. |
is_call_in_conference |
Verify if a call is in conference. |
is_call_not_answered |
Verify if callee did not pick up the call. |
is_call_on_hold |
Verify if a call is on hold. |
is_call_ringing |
Verify if a ringtone is detected on a phone device. |
is_call_waiting |
Verify if the phone notifies for the call on other line to be waiting. |
is_code_ended |
Verify if the dialed code or number has expired. |
is_dialtone_detected |
Verify if a dialtone is detected off_hook. |
is_incall_connected |
Verify if a call is incall connected. |
is_incall_dialing |
Verify if a phone is incall and call is dialing/in progress. |
is_incall_playing_dialtone |
Verify phone is connected on one line and playing dialtone on another line. |
is_line_busy |
To verify if the caller was notified that the callee is BUSY. |
is_off_hook_warning |
Verify phone has been left off-hook without use for an extended period. |
is_playing_dialtone |
Verify if the phone is playing a dialtone. |
is_user_profile_present |
Check whether the user profile is registered on the SIP Server or not. |
merge_two_calls |
Merge the two calls for conference calling. |
place_call_offhold |
Place an ongoing call on hold to off-hold. |
place_call_onhold |
Place an ongoing call on-hold. |
press_R_button |
Press the R button. |
put_phone_offhook |
Put the phone off hook. |
remove_user_profile |
Deregister user profile from the SIP Server. |
set_sip_expiry_time |
Modify the call expires timer in the config file of the sip_proxy. |
shutdown_phone |
Go on_hook and stop the phone application. |
stop_and_start_sip_server |
Stop and start the SIP server. |
tcpdump |
Start packet capture using tcpdump and kills the process at the end. |
toggle_call |
Toggle between the calls. |
add_user_profile
add_user_profile(where_to_add: VoiceServer, whom_to_add: VoiceClient) -> None
Register user profile on the SIP Server.
.. hint:: This Use Case implements statements from the test suite such as:
- Add user profile of (User) to the SIP Server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceServer
|
SIP Server |
required |
|
VoiceClient
|
Phone device to be registered |
required |
Raises:
| Type | Description |
|---|---|
VoiceError
|
if the device already exist on the SIP Server |
Source code in boardfarm3/use_cases/voice.py
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 | |
answer_a_call
answer_a_call(who_answers: VoiceClient) -> bool
Answer a ringing call by target SIP agent.
Execution order: - Ensure there is a ring on the target agent. - Pick up the call - Ensure the line is connected
.. hint:: This Use Case implements statements from the test suite such as:
- (User) answers to (User)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent who is suppose to answer the call. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if call is connected, else False |
Raises:
| Type | Description |
|---|---|
VoiceError
|
In case answering the call fails. |
Source code in boardfarm3/use_cases/voice.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
answer_waiting_call
answer_waiting_call(who_answers: VoiceClient) -> None
Answer the waiting call and hang up on the current call.
.. hint:: This Use Case implements statements from the test suite such as:
- (User) presses R1
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent who is suppose to answer the call. |
required |
Source code in boardfarm3/use_cases/voice.py
254 255 256 257 258 259 260 261 262 263 264 | |
call_a_number
Have the Caller dial the given phone number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent that initiates the call |
required |
|
str
|
Phone number to be dialled |
required |
Source code in boardfarm3/use_cases/voice.py
83 84 85 86 87 88 89 90 91 | |
call_a_phone
Call the Callee by the Caller.
.. hint:: This Use Case implements statements from the test suite such as:
- (User) calls (User)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent who intiates the call |
required |
|
VoiceClient
|
SIP agent who receives the call |
required |
Raises:
| Type | Description |
|---|---|
VoiceError
|
In case the call fails. |
Source code in boardfarm3/use_cases/voice.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
disable_call_forwarding_busy
disable_call_forwarding_busy(who_disables: VoiceClient, sip_srv: SIPServer) -> None
Disable call forwarding on a phone when busy.
.. hint:: This Use Case implements statements from the test suite such as:
- Disable call forwarding on (User)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
Agent that disables call forwarding busy |
required |
|
SIPServer
|
SIP server to retrieve the Vertical Service Code from |
required |
Source code in boardfarm3/use_cases/voice.py
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 | |
disable_call_forwarding_no_answer
disable_call_forwarding_no_answer(
who_disables: VoiceClient, sip_srv: SIPServer
) -> None
Disable call forwarding on a phone when not answered.
.. hint:: This Use Case implements statements from the test suite such as:
- Disable call forwarding no answer on (User)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
Agent that disables call forwarding no answer |
required |
|
SIPServer
|
SIP server to retrieve the Vertical Service Code from |
required |
Source code in boardfarm3/use_cases/voice.py
630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 | |
disable_unconditional_call_forwarding
disable_unconditional_call_forwarding(
who_disables: VoiceClient, sip_srv: SIPServer
) -> None
Disable unconditional call forwarding on a phone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
Agent that disables call forwarding busy |
required |
|
SIPServer
|
SIP server to retrieve the Vertical Service Code from |
required |
Source code in boardfarm3/use_cases/voice.py
691 692 693 694 695 696 697 698 699 700 701 702 703 | |
disconnect_the_call
disconnect_the_call(who_disconnects: VoiceClient) -> bool
Disconnecting a call on a SIP agent.
The user will not verify if the call is ongoing. It will simply call the on_hook implementation.
.. hint:: This Use Case implements statements from the test suite such as:
- (User) goes on hook.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent who is suppose to disconnect the call. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if call is disconnected |
Raises:
| Type | Description |
|---|---|
VoiceError
|
In case disconnecting the call fails. |
Source code in boardfarm3/use_cases/voice.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
enable_call_forwarding_busy
enable_call_forwarding_busy(
who_forwards: VoiceClient, forward_to: VoiceClient, sip_srv: SIPServer
) -> None
Enable call forwarding on a phone when busy.
This thus forwards a call to another user
.. hint:: This Use Case implements statements from the test suite such as:
- Enable Call Forwarding Busy on (User) to (User)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
Agent that enables call forwarding busy |
required |
|
VoiceClient
|
SIP Client to which agent forwards the call to |
required |
|
SIPServer
|
sip server |
required |
Source code in boardfarm3/use_cases/voice.py
576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 | |
enable_call_forwarding_no_answer
enable_call_forwarding_no_answer(
who_forwards: VoiceClient, forward_to: VoiceClient, sip_srv: SIPServer
) -> None
Enable call forwarding on a phone when there's no answer.
This thus forwards a call to another user
.. hint:: This Use Case implements statements from the test suite such as:
- Enable Call Forwarding No Answer on (User) to (User)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
Agent that enables call forwarding no answer |
required |
|
VoiceClient
|
SIP Client to which agent forwards the call to |
required |
|
SIPServer
|
SIP server to retrieve the Vertical Service Code from |
required |
Source code in boardfarm3/use_cases/voice.py
603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 | |
enable_unconditional_call_forwarding
enable_unconditional_call_forwarding(
who_forwards: VoiceClient, forward_to: VoiceClient, sip_srv: SIPServer
) -> None
Enable unconditional call forwarding on a phone.
This thus forwards a call to another user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
Agent that enables call forwarding busy |
required |
|
VoiceClient
|
SIP Client to which agent forwards the call to |
required |
|
SIPServer
|
SIP server |
required |
Source code in boardfarm3/use_cases/voice.py
668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 | |
get_sip_expiry_time
get_sip_expiry_time(sip_proxy: VoiceServer) -> int
Get the call expiry timer from the config file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceServer
|
SIP server |
required |
Returns:
| Type | Description |
|---|---|
int
|
expiry timer saved in the config |
Raises:
| Type | Description |
|---|---|
VoiceError
|
if the SIP Server is not installed |
Source code in boardfarm3/use_cases/voice.py
790 791 792 793 794 795 796 797 798 799 800 801 802 | |
initialize_phone
initialize_phone(target_phone: VoiceClient) -> None
Configure the phone, and start the application.
.. hint:: This Use Case implements statements from the test suite such as:
- Configure the phone, and start the application.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
Target phone to be initialized |
required |
Source code in boardfarm3/use_cases/voice.py
219 220 221 222 223 224 225 226 227 228 229 230 | |
is_call_connected
is_call_connected(who_is_connected: VoiceClient) -> bool
Verify if a call is connected.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify if a call is connected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP client on which connection needs to be checked |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if call is connected. |
Source code in boardfarm3/use_cases/voice.py
421 422 423 424 425 426 427 428 429 430 431 432 433 | |
is_call_dialing
is_call_dialing(who_is_dialing: VoiceClient) -> bool
Verify if a phone is dialing and a call in progress.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify if a phone is dialing and a call in progress.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent used to verify dialing |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if in progress dialing is detected |
Source code in boardfarm3/use_cases/voice.py
357 358 359 360 361 362 363 364 365 366 367 368 369 | |
is_call_ended
is_call_ended(whose_call_ended: VoiceClient) -> bool
Verify if the call has been disconnected and ended.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify if the call has been disconnected and ended.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP Client |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if call is disconnected |
Source code in boardfarm3/use_cases/voice.py
499 500 501 502 503 504 505 506 507 508 509 510 511 | |
is_call_idle
is_call_idle(who_is_idle: VoiceClient) -> bool
Verify if a phone is in idle state.
.. hint:: This Use Case implements statements from the test suite such as:
- (User) goes on Hook
- Verify if a phone is in idle state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent used to verify idle |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if idle is detected |
Source code in boardfarm3/use_cases/voice.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 | |
is_call_in_conference
is_call_in_conference(who_in_conference: VoiceClient) -> bool
Verify if a call is in conference.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify if a call is in conference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP client on which conference state needs to be checked |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if call is in conference state |
Source code in boardfarm3/use_cases/voice.py
468 469 470 471 472 473 474 475 476 477 478 479 480 | |
is_call_not_answered
is_call_not_answered(whose_call: VoiceClient) -> bool
Verify if callee did not pick up the call.
The Caller will receive a NO CARRIER or TIMEOUT reply.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify if callee did not pick up the call.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
Callee |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True is not answered, else False |
Source code in boardfarm3/use_cases/voice.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
is_call_on_hold
is_call_on_hold(who_is_onhold: VoiceClient) -> bool
Verify if a call is on hold.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify if a call is on hold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP client on which hold state needs to be checked |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if call is on hold. |
Source code in boardfarm3/use_cases/voice.py
453 454 455 456 457 458 459 460 461 462 463 464 465 | |
is_call_ringing
is_call_ringing(who_is_ringing: VoiceClient) -> bool
Verify if a ringtone is detected on a phone device.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify if a ringtone is detected on a phone device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent used to verify ringtone |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if ringtone is detected |
Source code in boardfarm3/use_cases/voice.py
406 407 408 409 410 411 412 413 414 415 416 417 418 | |
is_call_waiting
is_call_waiting(who_is_waiting: VoiceClient) -> bool
Verify if the phone notifies for the call on other line to be waiting.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify if the phone notifies for the call on other line to be waiting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP Client |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if call is in waiting |
Source code in boardfarm3/use_cases/voice.py
530 531 532 533 534 535 536 537 538 539 540 541 542 | |
is_code_ended
is_code_ended(whose_code_ended: VoiceClient) -> bool
Verify if the dialed code or number has expired.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify if the dialed code or number has expired.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP Client |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if code ended |
Source code in boardfarm3/use_cases/voice.py
515 516 517 518 519 520 521 522 523 524 525 526 527 | |
is_dialtone_detected
is_dialtone_detected(agent: VoiceClient) -> bool
Verify if a dialtone is detected off_hook.
Device will be first placed on_hook. This is done to ensure disconnecting any previous sessions.
After verifying dial tone device will again go back to on_hook state.
.. hint:: This Use Case implements statements from the test suite such as:
- (User) goes off hook
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent used to verify dialtone. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if dialtone is detected. |
Source code in boardfarm3/use_cases/voice.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
is_incall_connected
is_incall_connected(who_is_incall_connected: VoiceClient) -> bool
Verify if a call is incall connected.
.. hint:: This Use Case implements statements from the test suite such as:
- (User) answers to (User)
- Verify if a call is incall connected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP client on which connection needs to be checked |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if phone is incall connected. |
Source code in boardfarm3/use_cases/voice.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 | |
is_incall_dialing
is_incall_dialing(who_is_incall_dialing: VoiceClient) -> bool
Verify if a phone is incall and call is dialing/in progress.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify if a phone is incall and call is dialing/in progress.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent used to verify incall dialing |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if in progress dialing is detected |
Source code in boardfarm3/use_cases/voice.py
373 374 375 376 377 378 379 380 381 382 383 384 385 | |
is_incall_playing_dialtone
is_incall_playing_dialtone(who_is_playing_incall_dialtone: VoiceClient) -> bool
Verify phone is connected on one line and playing dialtone on another line.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify phone is connected on one line and playing dialtone on another line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP Client |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if call is incall playing dialtone state |
Source code in boardfarm3/use_cases/voice.py
546 547 548 549 550 551 552 553 554 555 556 557 558 | |
is_line_busy
is_line_busy(on_which_agent: VoiceClient, who_is_busy: VoiceClient) -> bool
To verify if the caller was notified that the callee is BUSY.
Some phone will send this explicitly and will have RINGING 180 as well inside their trace.
.. hint:: This Use Case implements statements from the test suite such as:
- To verify if the caller was notified that the callee is BUSY.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
Caller who will receive BUSY |
required |
|
VoiceClient
|
Callee who replies BUSY |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if caller received BUSY, else False |
Source code in boardfarm3/use_cases/voice.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
is_off_hook_warning
is_off_hook_warning(who_has_offhook_warning: VoiceClient) -> bool
Verify phone has been left off-hook without use for an extended period.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify phone has been left off-hook without use for an extended period.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP Client |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if phone generates off hook warning state |
Source code in boardfarm3/use_cases/voice.py
561 562 563 564 565 566 567 568 569 570 571 572 573 | |
is_playing_dialtone
is_playing_dialtone(who_is_playing_dialtone: VoiceClient) -> bool
Verify if the phone is playing a dialtone.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify if the phone is playing a dialtone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP Client |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if dialtone is playing else False |
Source code in boardfarm3/use_cases/voice.py
484 485 486 487 488 489 490 491 492 493 494 495 496 | |
is_user_profile_present
is_user_profile_present(sip_proxy: VoiceServer, whose_profile: VoiceClient) -> bool
Check whether the user profile is registered on the SIP Server or not.
.. hint:: This Use Case implements statements from the test suite such as:
- Make sure that (User) is successfully registered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceServer
|
SIP Server |
required |
|
VoiceClient
|
Phone device to be checked |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if phone device is registered on the SIP Server |
Source code in boardfarm3/use_cases/voice.py
752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 | |
merge_two_calls
merge_two_calls(who_is_conferencing: VoiceClient) -> None
Merge the two calls for conference calling.
Ensure call waiting must be enabled. There must be a call on other line to add to conference.
.. hint:: This Use Case implements statements from the test suite such as:
- (User) presses R3 and initiates 3-Way Conference
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent that adds all calls in a conference. |
required |
Source code in boardfarm3/use_cases/voice.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | |
place_call_offhold
place_call_offhold(who_places: VoiceClient) -> None
Place an ongoing call on hold to off-hold.
There must be an active call to be placed off hold.
.. hint:: This Use Case implements statements from the test suite such as:
- (User) presses flash hook
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent that is suppose to place the call off-hold. |
required |
Source code in boardfarm3/use_cases/voice.py
321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |
place_call_onhold
place_call_onhold(who_places: VoiceClient) -> None
Place an ongoing call on-hold.
There must be an active call to be placed on hold.
.. hint:: This Use Case implements statements from the test suite such as:
- (User) presses flash hook
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent that is suppose to place the call on-hold. |
required |
Raises:
| Type | Description |
|---|---|
VoiceError
|
If there is no on-going call |
Source code in boardfarm3/use_cases/voice.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | |
press_R_button
press_R_button(who_presses: VoiceClient) -> None
Press the R button.
Used when we put a call on hold, or during dialing.
.. hint:: This Use Case implements statements from the test suite such as:
- (User) presses R button
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
Agent that presses the R button. |
required |
Source code in boardfarm3/use_cases/voice.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 | |
put_phone_offhook
put_phone_offhook(who_puts_offhook: VoiceClient) -> None
Put the phone off hook.
.. hint:: This Use Case implements statements from the test suite such as:
- (User) goes off Hook.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent who puts phone off hook |
required |
Source code in boardfarm3/use_cases/voice.py
94 95 96 97 98 99 100 101 102 103 104 | |
remove_user_profile
remove_user_profile(where_to_remove: VoiceServer, whom_to_remove: VoiceClient) -> None
Deregister user profile from the SIP Server.
.. hint:: This Use Case implements statements from the test suite such as:
- Remove the user profile of (User A) from SIP Server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceServer
|
SIP Server |
required |
|
VoiceClient
|
Phone device to be removed |
required |
Raises:
| Type | Description |
|---|---|
VoiceError
|
if the device does not already exist on the SIP Server |
Source code in boardfarm3/use_cases/voice.py
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 | |
set_sip_expiry_time
set_sip_expiry_time(sip_proxy: VoiceServer, to_what_time: int = 60) -> None
Modify the call expires timer in the config file of the sip_proxy.
.. hint:: This Use Case implements statements from the test suite such as:
- Modify the call expires timer in the config file of the sip_proxy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceServer
|
SIP Server |
required |
|
int
|
New expiry time to be set, defaults to 60 |
60
|
Raises:
| Type | Description |
|---|---|
VoiceError
|
if the sipserver is not installed |
Source code in boardfarm3/use_cases/voice.py
769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 | |
shutdown_phone
shutdown_phone(target_phone: VoiceClient) -> None
Go on_hook and stop the phone application.
.. hint:: This Use Case implements statements from the test suite such as:
- Go on_hook and stop the phone application.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
Target phone to be initialized. |
required |
Source code in boardfarm3/use_cases/voice.py
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | |
stop_and_start_sip_server
stop_and_start_sip_server(sip_proxy: VoiceServer) -> Generator[None, Any, None]
Stop and start the SIP server.
:yield: in between stopping and starting the SIP server
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceServer
|
The SIP server to be restarted |
required |
Source code in boardfarm3/use_cases/voice.py
805 806 807 808 809 810 811 812 813 814 815 816 817 818 | |
tcpdump
Start packet capture using tcpdump and kills the process at the end.
.. hint:: This Use Case implements statements from the test suite such as:
- Start the packets capture to be able to analyze SIP/RTP/RTCP protocol
:yield: process id
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceServer
|
device object for a VoiceServer |
required |
|
str
|
name of the pcap file to which the capture will be stored |
required |
|
str
|
additional filters for capture, defaults to "" |
''
|
Source code in boardfarm3/use_cases/voice.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |
toggle_call
toggle_call(who_toggles: VoiceClient) -> None
Toggle between the calls.
.. hint:: This Use Case implements statements from the test suite such as:
- (User) presses R2 button
Need to first validate, there is an incoming call on other line. If not throw an exception.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VoiceClient
|
SIP agent who is suppose to toggle the call |
required |
Source code in boardfarm3/use_cases/voice.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
wifi
Wi-Fi Use Cases library.
All APIs are independent of board under test.
Functions:
| Name | Description |
|---|---|
check_and_connect_to_wifi |
Check if specific Wi-Fi is enabled and try to connect appropriate client. |
connect_wifi_client |
Connect client to Wi-Fi. |
disconnect_wifi_client |
Disconnect client from Wi-Fi. |
enable_and_disable_monitor_mode |
Enable and disbale monitor mode. |
get_bssid |
Get the Wi-Fi Basic Service Set Identifier. |
get_passphrase |
Get the Wi-Fi passphrase. |
get_ssid |
Get the Wi-Fi SSID. |
get_wifi_clients |
Return list of wlan_devices based on filters network and band type. |
is_wifi_connected |
Get the state of the interface. |
list_wifi_ssid |
Return the list of Wi-Fi SSIDs. |
scan_ssid_name |
Scan for the particular SSID based on the network type and band. |
wifi_check_ssid |
Check the SSID provided is present in the scan list. |
check_and_connect_to_wifi
check_and_connect_to_wifi(who_to_connect: WLAN, cpe: CPE) -> None
Check if specific Wi-Fi is enabled and try to connect appropriate client.
.. hint:: This Use Case implements statements from the test suite such as:
- Check if specific Wi-Fi is enabled and try to connect appropriate client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WLAN
|
Wi-Fi client device |
required |
|
CPE
|
the CPE to connect to |
required |
Source code in boardfarm3/use_cases/wifi.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
connect_wifi_client
connect_wifi_client(
who_to_connect: WLAN,
cpe: CPE,
ssid: str | None = None,
password: str | None = None,
bssid: str | None = None,
) -> None
Connect client to Wi-Fi.
.. hint:: This Use Case implements statements from the test suite such as:
- Verify that the connection to 2.4GHz private Wi-Fi SSID is successful.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WLAN
|
client to connect |
required |
|
CPE
|
the CPE to connect to |
required |
|
str | None
|
SSID of the network to connect |
None
|
|
str | None
|
password of the network to connect |
None
|
|
str | None
|
BSSID of the network to connect |
None
|
Source code in boardfarm3/use_cases/wifi.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
disconnect_wifi_client
disconnect_wifi_client(who_to_disconnect: WLAN) -> None
Disconnect client from Wi-Fi.
.. hint:: This Use Case implements statements from the test suite such as:
- Disconnect the client from 5GHz Wi-Fi network
- Disconnect the client from 2.4GHz Wi-Fi network
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WLAN
|
client to disconnect |
required |
Source code in boardfarm3/use_cases/wifi.py
159 160 161 162 163 164 165 166 167 168 169 170 | |
enable_and_disable_monitor_mode
Enable and disbale monitor mode.
:yield: in between enabling and disabling monitor mode
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WLAN
|
device instance |
required |
Source code in boardfarm3/use_cases/wifi.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 | |
get_bssid
Get the Wi-Fi Basic Service Set Identifier.
.. hint:: This Use Case implements statements from the test suite such as:
- Get the Wi-Fi Basic Service Set Identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
network type of the client E.g: private, guest, community |
required |
|
str
|
band of the client |
required |
|
CPE
|
the CPE that is beaming the SSID |
required |
|
str
|
mode to get the BSSID. E.g. console (default), snmp, acs, dmcli |
'console'
|
Returns:
| Type | Description |
|---|---|
str | None
|
MAC physical address of the access point |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
not implemented for modes other than console |
Source code in boardfarm3/use_cases/wifi.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
get_passphrase
Get the Wi-Fi passphrase.
.. hint:: This Use Case implements statements from the test suite such as:
- Get the Wi-Fi passphrase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
network type of the client E.g: private, guest, community |
required |
|
CPE
|
the CPE that is beaming the SSID |
required |
Returns:
| Type | Description |
|---|---|
str
|
encrypted password for a network |
Source code in boardfarm3/use_cases/wifi.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
get_ssid
Get the Wi-Fi SSID.
.. hint:: This Use Case implements statements from the test suite such as:
- Get the Wi-Fi SSID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
network type of the client E.g: private, guest, community |
required |
|
str
|
Wi-Fi band of the client |
required |
|
CPE
|
the CPE that is beaming the SSID |
required |
|
str
|
way to retrieve the information, defaults to "console" |
'console'
|
Returns:
| Type | Description |
|---|---|
str | None
|
SSID of the Wi-Fi for a given network type and band |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
not implemented for modes other than console |
Source code in boardfarm3/use_cases/wifi.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
get_wifi_clients
Return list of wlan_devices based on filters network and band type.
.. hint:: This Use Case implements statements from the test suite such as:
- Return list of wlan_devices based on filters network and band type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
network type of the client Eg: private, guest, community |
required |
|
str
|
band of the client in GHz |
required |
Returns:
| Type | Description |
|---|---|
list[WLAN]
|
list of WLAN devices |
Source code in boardfarm3/use_cases/wifi.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
is_wifi_connected
Get the state of the interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WLAN
|
device instance |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if connected |
Source code in boardfarm3/use_cases/wifi.py
249 250 251 252 253 254 255 256 257 | |
list_wifi_ssid
Return the list of Wi-Fi SSIDs.
.. hint:: This Use Case implements statements from the test suite such as:
- Return the list of Wi-Fi SSIDs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WLAN
|
WLAN device instance |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
list of Wi-Fi SSIDs |
Source code in boardfarm3/use_cases/wifi.py
199 200 201 202 203 204 205 206 207 208 209 210 211 | |
scan_ssid_name
Scan for the particular SSID based on the network type and band.
.. hint:: This Use Case implements statements from the test suite such as:
- Scan for the particular SSID based on the network type and band.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WLAN
|
WLAN device instance |
required |
|
CPE
|
the CPE to connect to |
required |
Returns:
| Type | Description |
|---|---|
bool
|
true if the SSID is available, false otherwise |
Source code in boardfarm3/use_cases/wifi.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | |
wifi_check_ssid
Check the SSID provided is present in the scan list.
.. hint:: This Use Case implements statements from the test suite such as:
- Check the SSID provided is present in the scan list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WLAN
|
WLAN device instance |
required |
|
str
|
SSID name to be verified |
required |
Returns:
| Type | Description |
|---|---|
bool
|
true if the ssid_name is available, false otherwise |
Source code in boardfarm3/use_cases/wifi.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |