lib
Boardfarm libs.
Modules:
| Name | Description |
|---|---|
SNMPv2 |
SNMP v2 module for SNMP communication. |
boardfarm_config |
Boardfarm environment config module. |
boardfarm_pexpect |
Boardfarm pexpect session module. |
connection_factory |
Connection decider module. |
connections |
Boardfarm connections package. |
cpe_sw |
Common libraries of CPE Sw component. |
custom_typing |
Boardfarm3 custom type hints package. |
dataclass |
Boardfarm3 dataclasses. |
device_manager |
Boardfarm device manager. |
dmcli |
RDKB dmcli command line interface module. |
docker_factory |
Docker Factory v2 related libraries. |
gui |
Keep SonarQube happy. |
hal |
Hardware abstraction layers for different CPE components. |
interactive_shell |
Boardfarm interactive shell module. |
mibs_compiler |
MIBs to JSON compiler module. |
multicast |
Multicast library. |
network_utils |
Network utilities module. |
networking |
Boardfarm networking module. |
odh |
Boardfarm ODH client Package. |
parsers |
Linux command output parsers. |
power |
Power module. |
python_executor |
Python executor module. |
regexlib |
Useful regexes library. |
shell_prompt |
Boardfarm v3 base device shell prompts. |
utils |
Boardfarm common utilities module. |
wrappers |
Boardfarm decorators module. |
SNMPv2
SNMP v2 module for SNMP communication.
Classes:
| Name | Description |
|---|---|
SNMPv2 |
SNMP v2 module for SNMP communication. |
SNMPv2
SNMPv2(device: WAN, target_ip: str, mibs_compiler: MibsCompiler)
SNMP v2 module for SNMP communication.
Initialize SNMPv2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WAN
|
device instance |
required |
|
str
|
target ip address |
required |
|
MibsCompiler
|
mibs compiler instance |
required |
Methods:
| Name | Description |
|---|---|
snmpbulkget |
Perform SNMP bulkget on the device with given arguments. |
snmpget |
Perform an snmpget with given arguments. |
snmpset |
Perform an snmpset with given arguments. |
snmpwalk |
Perform an snmpwalk with given arguments. |
Source code in boardfarm3/lib/SNMPv2.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
snmpbulkget
snmpbulkget(
mib_name: str,
index: int | None = None,
community: str = "private",
non_repeaters: int = 0,
max_repetitions: int = 10,
retries: int = 3,
timeout: int = 100,
extra_args: str = "",
cmd_timeout: int = 30,
) -> list[tuple[str, str, str]]
Perform SNMP bulkget on the device with given arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
mib name used to perform snmp |
required |
|
int | None
|
index used along with mib_name, defaults to None |
None
|
|
str
|
SNMP Community string, defaults to "private" |
'private'
|
|
int
|
value treated as get request, defaults to 0 |
0
|
|
int
|
value treated as get next operation, defaults to 10 |
10
|
|
int
|
no.of time commands are executed on exception, defaults to 3 |
3
|
|
int
|
timeout in seconds, defaults to 100 |
100
|
|
str
|
extra arguments to be passed in the command, defaults to "" |
''
|
|
int
|
timeout to wait for command to give otuput |
30
|
Returns:
| Type | Description |
|---|---|
list[tuple[str, str, str]]
|
output of snmpbulkget command |
Raises:
| Type | Description |
|---|---|
SNMPError
|
when MIB is not available |
Source code in boardfarm3/lib/SNMPv2.py
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 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 | |
snmpget
snmpget(
mib_name: str,
index: int = 0,
community: str = "private",
extra_args: str = "",
timeout: int = 10,
retries: int = 3,
cmd_timeout: int = 30,
) -> tuple[str, str, str]
Perform an snmpget with given arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
mib name used to perform snmp |
required |
|
int
|
index used along with mib_name |
0
|
|
str
|
SNMP Community string that allows access to DUT, defaults to 'private' |
'private'
|
|
str
|
Any extra arguments to be passed in the command |
''
|
|
int
|
timeout in seconds |
10
|
|
int
|
the no. of time the commands are executed on exception/timeout |
3
|
|
int
|
timeout to wait for command to give otuput |
30
|
Returns:
| Type | Description |
|---|---|
Tuple[str, str, str]
|
value, value type and complete output |
Source code in boardfarm3/lib/SNMPv2.py
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 | |
snmpset
snmpset(
mib_name: str,
value: str,
stype: str,
index: int = 0,
community: str = "private",
extra_args: str = "",
timeout: int = 10,
retries: int = 3,
cmd_timeout: int = 30,
) -> tuple[str, str, str]
Perform an snmpset with given arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
mib name used to perform snmp |
required |
|
str
|
value to be set for the mib name |
required |
|
str
|
defines the datatype of value to be set for mib_name stype: one of i, u, t, a, o, s, x, d, b i: INTEGER, u: unsigned INTEGER, t: TIMETICKS, a: IPADDRESS o: OBJID, s: STRING, x: HEX STRING, d: DECIMAL STRING, b: BITS U: unsigned int64, I: signed int64, F: float, D: double |
required |
|
int
|
index used along with mib_name |
0
|
|
str
|
SNMP Community string that allows access to DUT, defaults to 'private' |
'private'
|
|
str
|
Any extra arguments to be passed in the command |
''
|
|
int
|
timeout in seconds |
10
|
|
int
|
the no. of time the commands are executed on exception/timeout |
3
|
|
int
|
timeout to wait for command to give otuput |
30
|
Returns:
| Type | Description |
|---|---|
Tuple[str, str, str]
|
value, value type and complete output |
Source code in boardfarm3/lib/SNMPv2.py
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 | |
snmpwalk
snmpwalk(
mib_name: str,
index: int | None = None,
community: str = "private",
retries: int = 3,
timeout: int = 100,
extra_args: str = "",
cmd_timeout: int = 30,
) -> tuple[dict[str, list[str]], str]
Perform an snmpwalk with given arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
mib name used to perform snmp |
required |
|
int | None
|
index used along with mib_name |
None
|
|
str
|
SNMP Community string that allows access to DUT, defaults to 'private' |
'private'
|
|
int
|
the no. of time the commands are executed on exception/timeout |
3
|
|
int
|
timeout in seconds |
100
|
|
str
|
Any extra arguments to be passed in the command |
''
|
|
int
|
timeout to wait for command to give otuput |
30
|
Returns:
| Type | Description |
|---|---|
Tuple[Dict[str, List[str]], str]
|
dictionary of mib_oid as key and list(value, type) as value and complete output |
Raises:
| Type | Description |
|---|---|
SNMPError
|
no matching output |
Source code in boardfarm3/lib/SNMPv2.py
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 | |
boardfarm_config
Boardfarm environment config module.
Classes:
| Name | Description |
|---|---|
BoardfarmConfig |
Boardfarm environment config. |
Functions:
| Name | Description |
|---|---|
get_inventory_config |
Return inventory config based on given arguments. |
get_json |
Get the inventory json either from a URL or a system path. |
parse_boardfarm_config |
Get environment config from given json files. |
BoardfarmConfig
BoardfarmConfig(
merged_config: list[dict],
env_config: dict[str, Any],
inventory_config: dict[str, Any],
)
Boardfarm environment config.
Initialize boardfarm config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[dict]
|
merged devices config |
required |
|
dict[str, Any]
|
environment configuration |
required |
|
dict[str, Any]
|
inventory configuration |
required |
Methods:
| Name | Description |
|---|---|
get_board_model |
Return the env config ["environment_def"]["board"]["model"]. |
get_board_sku |
Return the env config ["environment_def"]["board"]["SKU"] value. |
get_board_station_number |
Get station number of the board. |
get_device_config |
Get device merged config. |
get_devices_config |
Get merged devices config. |
get_prov_mode |
Return the provisioning mode of the DUT. |
Attributes:
| Name | Type | Description |
|---|---|---|
env_config |
dict[str, Any]
|
Environment config dictionary. |
inventory_config |
dict[str, Any]
|
Inventory config dictionary. |
resource_name |
str
|
Resource name. |
Source code in boardfarm3/lib/boardfarm_config.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
env_config
property
env_config: dict[str, Any]
Environment config dictionary.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
env config response |
inventory_config
property
inventory_config: dict[str, Any]
Inventory config dictionary.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
inventory config response |
resource_name
cached
property
resource_name: str
Resource name.
Returns:
| Type | Description |
|---|---|
str
|
resource name of the board |
get_board_model
get_board_model() -> str
Return the env config ["environment_def"]["board"]["model"].
Returns:
| Type | Description |
|---|---|
str
|
Board model |
Raises:
| Type | Description |
|---|---|
EnvConfigError
|
when given model is unknown |
Source code in boardfarm3/lib/boardfarm_config.py
102 103 104 105 106 107 108 109 110 111 112 113 114 | |
get_board_sku
get_board_sku() -> str
Return the env config ["environment_def"]["board"]["SKU"] value.
Returns:
| Type | Description |
|---|---|
str
|
SKU value |
Raises:
| Type | Description |
|---|---|
EnvConfigError
|
when given sku is unknown |
Source code in boardfarm3/lib/boardfarm_config.py
90 91 92 93 94 95 96 97 98 99 100 | |
get_board_station_number
get_board_station_number() -> int
Get station number of the board.
Returns:
| Type | Description |
|---|---|
int
|
station number |
Source code in boardfarm3/lib/boardfarm_config.py
63 64 65 66 67 68 | |
get_device_config
get_device_config(device_name: str) -> dict[str, Any]
Get device merged config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
device name |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
merged device config |
Raises:
| Type | Description |
|---|---|
EnvConfigError
|
when given device name is unknown |
Source code in boardfarm3/lib/boardfarm_config.py
77 78 79 80 81 82 83 84 85 86 87 88 | |
get_devices_config
get_devices_config() -> list[dict]
Get merged devices config.
Returns:
| Type | Description |
|---|---|
list[dict]
|
merged devices config |
Source code in boardfarm3/lib/boardfarm_config.py
70 71 72 73 74 75 | |
get_prov_mode
get_prov_mode() -> str
Return the provisioning mode of the DUT.
Returns:
| Type | Description |
|---|---|
str
|
ipv4, ipv6, dslite, dualstack, disabled |
Raises:
| Type | Description |
|---|---|
EnvConfigError
|
when given sku is unknown |
Source code in boardfarm3/lib/boardfarm_config.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
get_inventory_config
get_inventory_config(resource_name: str, inventory_json_path: str) -> dict[str, Any]
Return inventory config based on given arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
inventory resource name |
required |
|
str
|
inventory json config path |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
inventory configuration |
Raises:
| Type | Description |
|---|---|
EnvConfigError
|
on resource name not found in inventory config |
EnvConfigError
|
on invalid location config |
Source code in boardfarm3/lib/boardfarm_config.py
211 212 213 214 215 216 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 | |
get_json
get_json(resource_name: str) -> dict[str, Any]
Get the inventory json either from a URL or a system path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
inventory resource name |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
the inventory json from the specified path |
Source code in boardfarm3/lib/boardfarm_config.py
196 197 198 199 200 201 202 203 204 205 206 207 208 | |
parse_boardfarm_config
parse_boardfarm_config(
inventory_config: dict[str, Any], env_json_config: dict[str, Any]
) -> BoardfarmConfig
Get environment config from given json files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, Any]
|
inventory config |
required |
|
dict[str, Any]
|
environment config |
required |
Returns:
| Type | Description |
|---|---|
BoardfarmConfig
|
boardfarm config instance |
Source code in boardfarm3/lib/boardfarm_config.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 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | |
boardfarm_pexpect
Boardfarm pexpect session module.
Classes:
| Name | Description |
|---|---|
BoardfarmPexpect |
Boardfarm pexpect session. |
BoardfarmPexpect
BoardfarmPexpect(
session_name: str,
command: str,
save_console_logs: str,
args: list[str],
**kwargs: dict[str, Any],
)
Boardfarm pexpect session.
Initialize boardfarm pexpect.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
pexpect session name |
required |
|
str
|
command to start pexpect session |
required |
|
str
|
save console logs to the disk |
required |
|
list[str]
|
additional arguments to the command |
required |
|
dict[str, Any]
|
may contains the 'env' for pexpect, optional |
{}
|
Methods:
| Name | Description |
|---|---|
execute_command |
Execute a command in the pexpect session. |
get_last_output |
Get last output from the buffer. |
start_interactive_session |
Start interactive pexpect session. |
Source code in boardfarm3/lib/boardfarm_pexpect.py
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 | |
execute_command
abstractmethod
Execute a command in the pexpect session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to execute |
required |
|
int
|
timeout in seconds. Defaults to -1 |
-1
|
Returns:
| Type | Description |
|---|---|
str
|
output of given command execution |
Source code in boardfarm3/lib/boardfarm_pexpect.py
124 125 126 127 128 129 130 131 132 | |
get_last_output
get_last_output() -> str
Get last output from the buffer.
Returns:
| Type | Description |
|---|---|
str
|
last output from the buffer |
Source code in boardfarm3/lib/boardfarm_pexpect.py
117 118 119 120 121 122 | |
start_interactive_session
start_interactive_session() -> None
Start interactive pexpect session.
Source code in boardfarm3/lib/boardfarm_pexpect.py
134 135 136 137 | |
connection_factory
Connection decider module.
Functions:
| Name | Description |
|---|---|
connection_factory |
Return connection of given type. |
connection_factory
connection_factory(
connection_type: str, connection_name: str, **kwargs: Any
) -> BoardfarmPexpect
Return connection of given type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
type of the connection |
required |
|
str
|
name of the connection |
required |
|
Any
|
arguments to the connection |
{}
|
Returns:
| Type | Description |
|---|---|
BoardfarmPexpect
|
BoardfarmPexpect: connection of given type |
Raises:
| Type | Description |
|---|---|
EnvConfigError
|
when given connection type is not supported |
Source code in boardfarm3/lib/connection_factory.py
15 16 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 | |
connections
Boardfarm connections package.
Modules:
| Name | Description |
|---|---|
connect_and_run |
Connect and run module. |
ldap_authenticated_serial |
SSH connection module. |
local_cmd |
Connect to a device with a local command. |
ser2net_connection |
ser2net connection module. |
serial_connection |
Connect to a device with a local serial command. |
ssh_connection |
SSH connection module. |
telnet |
Telnet connection module. |
connect_and_run
Connect and run module.
Classes:
| Name | Description |
|---|---|
RuntimeConnectable |
Runtine connectable protocol class. |
Functions:
| Name | Description |
|---|---|
connect_and_run |
Connect run and disconnect to console at runtime. |
RuntimeConnectable
Runtine connectable protocol class.
Methods:
| Name | Description |
|---|---|
connect_console |
Connect to the console. |
disconnect_console |
Disconnect from the console. |
is_console_connected |
Get status of the connection. |
connect_console
connect_console() -> None
Connect to the console.
Source code in boardfarm3/lib/connections/connect_and_run.py
16 17 | |
disconnect_console
disconnect_console() -> None
Disconnect from the console.
Source code in boardfarm3/lib/connections/connect_and_run.py
19 20 | |
is_console_connected
is_console_connected() -> bool
Get status of the connection.
Source code in boardfarm3/lib/connections/connect_and_run.py
22 23 | |
connect_and_run
connect_and_run(func: Callable[P, T]) -> Callable[P, T]
Connect run and disconnect to console at runtime.
Note: This is implemented only for instance methods
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Callable[P, T]
|
the decorated method |
required |
Returns:
| Type | Description |
|---|---|
Callable[P, T]
|
True or False |
Source code in boardfarm3/lib/connections/connect_and_run.py
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 | |
ldap_authenticated_serial
SSH connection module.
Classes:
| Name | Description |
|---|---|
LdapAuthenticatedSerial |
Connect to a serial with ldap credentials. |
LdapAuthenticatedSerial
LdapAuthenticatedSerial(
name: str,
ip_addr: str,
ldap_credentials: str,
shell_prompt: list[str],
port: int = 22,
save_console_logs: str = "",
**kwargs: dict[str, Any],
)
Connect to a serial with ldap credentials.
Initialize ldap authenticated serial connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
connection name |
required |
|
str
|
server ip address |
required |
|
str
|
ldap credentials |
required |
|
list[str]
|
shell prompt patterns |
required |
|
int
|
port number, defaults to 22 |
22
|
|
str
|
save console logs to disk, defaults to "" |
''
|
|
dict[str, Any]
|
other keyword arguments |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
invalid LDAP credentials |
Methods:
| Name | Description |
|---|---|
check_output |
Return an output of the command. |
execute_command |
Execute a command in the SSH session. |
execute_command_async |
Execute a command in the SSH session. |
get_last_output |
Get last output from the buffer. |
login_to_server |
Login to serial server. |
login_to_server_async |
Login to serial server. |
start_interactive_session |
Start interactive pexpect session. |
sudo_sendline |
Add sudo in the sendline if username is root. |
Source code in boardfarm3/lib/connections/ldap_authenticated_serial.py
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 | |
check_output
Return an output of the command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to execute |
required |
|
int
|
timeout for command execute, defaults to 30 |
30
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Raises:
| Type | Description |
|---|---|
BoardfarmException
|
if command doesn't execute in specified timeout |
Source code in boardfarm3/lib/connections/ssh_connection.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
execute_command
Execute a command in the SSH session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to execute |
required |
|
int
|
timeout in seconds. defaults to -1 |
-1
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Source code in boardfarm3/lib/connections/ssh_connection.py
115 116 117 118 119 120 121 122 123 124 125 126 | |
execute_command_async
async
Execute a command in the SSH session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to execute |
required |
|
int
|
timeout in seconds. defaults to -1 |
-1
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Source code in boardfarm3/lib/connections/ssh_connection.py
128 129 130 131 132 133 134 135 136 137 138 139 | |
get_last_output
get_last_output() -> str
Get last output from the buffer.
Returns:
| Type | Description |
|---|---|
str
|
last output from the buffer |
Source code in boardfarm3/lib/boardfarm_pexpect.py
117 118 119 120 121 122 | |
login_to_server
login_to_server(password: str | None = None) -> None
Login to serial server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
LDAP password |
None
|
Raises:
| Type | Description |
|---|---|
DeviceConnectionError
|
failed to connect to device via serial |
Source code in boardfarm3/lib/connections/ldap_authenticated_serial.py
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 | |
login_to_server_async
async
login_to_server_async(password: str | None = None) -> None
Login to serial server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
LDAP password |
None
|
Raises:
| Type | Description |
|---|---|
DeviceConnectionError
|
failed to connect to device via serial |
Source code in boardfarm3/lib/connections/ldap_authenticated_serial.py
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 | |
start_interactive_session
start_interactive_session() -> None
Start interactive pexpect session.
Source code in boardfarm3/lib/boardfarm_pexpect.py
134 135 136 137 | |
sudo_sendline
sudo_sendline(cmd: str) -> None
Add sudo in the sendline if username is root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to send |
required |
Source code in boardfarm3/lib/connections/ssh_connection.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
local_cmd
Connect to a device with a local command.
Classes:
| Name | Description |
|---|---|
LocalCmd |
Connect to a device with a local command. |
LocalCmd
LocalCmd(
name: str,
conn_command: str,
save_console_logs: str,
shell_prompt: list[str] | None = None,
args: list[str] | None = None,
**kwargs: dict[str, Any],
)
Connect to a device with a local command.
Initialize local command connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
connection name |
required |
|
str
|
command to start the session |
required |
|
str
|
save console logs to disk |
required |
|
list[str] | None
|
shell prompt pattern, defaults to None |
None
|
|
list[str] | None
|
arguments to the command, defaults to None |
None
|
|
dict[str, Any]
|
additional keyword args |
{}
|
Methods:
| Name | Description |
|---|---|
execute_command |
Execute a command in the local command session. |
get_last_output |
Get last output from the buffer. |
login_to_server |
Login. |
start_interactive_session |
Start interactive pexpect session. |
Source code in boardfarm3/lib/connections/local_cmd.py
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 | |
execute_command
Execute a command in the local command session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to execute |
required |
|
int
|
timeout in seconds. defaults to -1 |
-1
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Source code in boardfarm3/lib/connections/local_cmd.py
83 84 85 86 87 88 89 90 91 92 93 94 95 | |
get_last_output
get_last_output() -> str
Get last output from the buffer.
Returns:
| Type | Description |
|---|---|
str
|
last output from the buffer |
Source code in boardfarm3/lib/boardfarm_pexpect.py
117 118 119 120 121 122 | |
login_to_server
login_to_server(password: str | None = None) -> None
Login.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
ssh password |
None
|
Raises:
| Type | Description |
|---|---|
DeviceConnectionError
|
connection failed via local command |
ValueError
|
if shell prompt is unavailable |
Source code in boardfarm3/lib/connections/local_cmd.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 80 81 | |
start_interactive_session
start_interactive_session() -> None
Start interactive pexpect session.
Source code in boardfarm3/lib/boardfarm_pexpect.py
134 135 136 137 | |
ser2net_connection
ser2net connection module.
Classes:
| Name | Description |
|---|---|
Ser2NetConnection |
Allow telnet session to be established with the ser2net daemon. |
Ser2NetConnection
Ser2NetConnection(
session_name: str, command: str, save_console_logs: str, args: list[str]
)
Allow telnet session to be established with the ser2net daemon.
Requires the ser2net daemon to be running. Configuration to be stored in /etc/ser2net.conf Several devices can be connected to a host without the need for a terminal server. The following is a sample configuration for a single console:
2001:telnet:0:/dev/ttyUSB0:115200 NONE 1STOPBIT 8DATABITS XONXOFF banner max-connections=1
The telnet:0 disables the timeout on the telnet session. No authentication needed.
Initialize the Ser2Net connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
pexpect session name |
required |
|
str
|
command to start the pexpect session |
required |
|
str
|
save console logs to disk |
required |
|
list[str]
|
additional arguments to the command |
required |
Methods:
| Name | Description |
|---|---|
close |
Close the connection. |
execute_command |
Execute a command in the Telnet session. |
execute_command_async |
Execute a command in the Telnet session. |
get_last_output |
Get last output from the buffer. |
login_to_server |
Login to Ser2Net server. |
login_to_server_async |
Login to Ser2Net server using asyncio. |
start_interactive_session |
Start interactive pexpect session. |
Source code in boardfarm3/lib/connections/ser2net_connection.py
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 | |
close
close(force: bool = True) -> None
Close the connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
bool
|
True to send a SIGKILL, False for SIGINT/UP, default True |
True
|
Source code in boardfarm3/lib/connections/telnet.py
114 115 116 117 118 119 120 121 122 | |
execute_command
Execute a command in the Telnet session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to be executed |
required |
|
int
|
timeout for command execute, defaults to 30 |
30
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Source code in boardfarm3/lib/connections/telnet.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
execute_command_async
async
Execute a command in the Telnet session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to execute |
required |
|
int
|
timeout in seconds. defaults to -1 |
-1
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Source code in boardfarm3/lib/connections/telnet.py
101 102 103 104 105 106 107 108 109 110 111 112 | |
get_last_output
get_last_output() -> str
Get last output from the buffer.
Returns:
| Type | Description |
|---|---|
str
|
last output from the buffer |
Source code in boardfarm3/lib/boardfarm_pexpect.py
117 118 119 120 121 122 | |
login_to_server
login_to_server(password: str | None = None) -> None
Login to Ser2Net server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
Telnet password |
None
|
Raises:
| Type | Description |
|---|---|
DeviceConnectionError
|
connection failed to Telnet server |
Source code in boardfarm3/lib/connections/ser2net_connection.py
72 73 74 75 76 77 78 79 80 81 82 83 84 | |
login_to_server_async
async
login_to_server_async(password: str | None = None) -> None
Login to Ser2Net server using asyncio.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
Telnet password |
None
|
Raises:
| Type | Description |
|---|---|
DeviceConnectionError
|
connection failed to Telnet server |
Source code in boardfarm3/lib/connections/ser2net_connection.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
start_interactive_session
start_interactive_session() -> None
Start interactive pexpect session.
Source code in boardfarm3/lib/boardfarm_pexpect.py
134 135 136 137 | |
serial_connection
Connect to a device with a local serial command.
Basically a local command with no authentication on connection.
Classes:
| Name | Description |
|---|---|
SerialConnection |
Connect to a device with local serail command. |
SerialConnection
SerialConnection(
name: str,
conn_command: str,
save_console_logs: str,
shell_prompt: list[str] | None = None,
args: list[str] | None = None,
**kwargs: dict[str, Any],
)
Connect to a device with local serail command.
No authentication needed. Just connect!
Initialize local command serial connection.
No authentication!
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
connection name |
required |
|
str
|
command to start the session |
required |
|
str
|
save console logs to disk |
required |
|
list[str] | None
|
shell prompt pattern, defaults to None |
None
|
|
list[str] | None
|
arguments to the command, defaults to None |
None
|
|
dict[str, Any]
|
additional keyword args |
{}
|
Raises:
| Type | Description |
|---|---|
DeviceConnectionError
|
on connection failure |
Methods:
| Name | Description |
|---|---|
execute_command |
Execute a command in the local command session. |
get_last_output |
Get last output from the buffer. |
login_to_server |
Do not do anything, just connect. |
start_interactive_session |
Start interactive pexpect session. |
Source code in boardfarm3/lib/connections/serial_connection.py
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 | |
execute_command
Execute a command in the local command session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to execute |
required |
|
int
|
timeout in seconds. defaults to -1 |
-1
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Source code in boardfarm3/lib/connections/serial_connection.py
73 74 75 76 77 78 79 80 81 82 83 84 85 | |
get_last_output
get_last_output() -> str
Get last output from the buffer.
Returns:
| Type | Description |
|---|---|
str
|
last output from the buffer |
Source code in boardfarm3/lib/boardfarm_pexpect.py
117 118 119 120 121 122 | |
login_to_server
login_to_server(password: str | None = None) -> None
Do not do anything, just connect.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
unused |
None
|
Source code in boardfarm3/lib/connections/serial_connection.py
67 68 69 70 71 | |
start_interactive_session
start_interactive_session() -> None
Start interactive pexpect session.
Source code in boardfarm3/lib/boardfarm_pexpect.py
134 135 136 137 | |
ssh_connection
SSH connection module.
Classes:
| Name | Description |
|---|---|
SSHConnection |
Connect to a device via SSH. |
SSHConnection
SSHConnection(
name: str,
ip_addr: str,
username: str,
shell_prompt: list[str],
port: int = 22,
password: str | None = None,
save_console_logs: str = "",
**kwargs: dict[str, Any],
)
Connect to a device via SSH.
Initialize SSH connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
connection name |
required |
|
str
|
ip address |
required |
|
str
|
ssh username |
required |
|
list[str]
|
shell prompt pattern |
required |
|
int
|
port number, defaults to 22 |
22
|
|
str | None
|
password, defaults to None |
None
|
|
str
|
save console logs, defaults to "" |
''
|
|
dict[str, Any]
|
other keyword arguments |
{}
|
Methods:
| Name | Description |
|---|---|
check_output |
Return an output of the command. |
execute_command |
Execute a command in the SSH session. |
execute_command_async |
Execute a command in the SSH session. |
get_last_output |
Get last output from the buffer. |
login_to_server |
Login to SSH session. |
login_to_server_async |
Login to SSH session. |
start_interactive_session |
Start interactive pexpect session. |
sudo_sendline |
Add sudo in the sendline if username is root. |
Source code in boardfarm3/lib/connections/ssh_connection.py
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 | |
check_output
Return an output of the command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to execute |
required |
|
int
|
timeout for command execute, defaults to 30 |
30
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Raises:
| Type | Description |
|---|---|
BoardfarmException
|
if command doesn't execute in specified timeout |
Source code in boardfarm3/lib/connections/ssh_connection.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
execute_command
Execute a command in the SSH session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to execute |
required |
|
int
|
timeout in seconds. defaults to -1 |
-1
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Source code in boardfarm3/lib/connections/ssh_connection.py
115 116 117 118 119 120 121 122 123 124 125 126 | |
execute_command_async
async
Execute a command in the SSH session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to execute |
required |
|
int
|
timeout in seconds. defaults to -1 |
-1
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Source code in boardfarm3/lib/connections/ssh_connection.py
128 129 130 131 132 133 134 135 136 137 138 139 | |
get_last_output
get_last_output() -> str
Get last output from the buffer.
Returns:
| Type | Description |
|---|---|
str
|
last output from the buffer |
Source code in boardfarm3/lib/boardfarm_pexpect.py
117 118 119 120 121 122 | |
login_to_server
login_to_server(password: str | None = None) -> None
Login to SSH session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
ssh password |
None
|
Raises:
| Type | Description |
|---|---|
DeviceConnectionError
|
connection failed to SSH server |
Source code in boardfarm3/lib/connections/ssh_connection.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
login_to_server_async
async
login_to_server_async(password: str | None = None) -> None
Login to SSH session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
ssh password |
None
|
Raises:
| Type | Description |
|---|---|
DeviceConnectionError
|
connection failed to SSH server |
Source code in boardfarm3/lib/connections/ssh_connection.py
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 | |
start_interactive_session
start_interactive_session() -> None
Start interactive pexpect session.
Source code in boardfarm3/lib/boardfarm_pexpect.py
134 135 136 137 | |
sudo_sendline
sudo_sendline(cmd: str) -> None
Add sudo in the sendline if username is root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to send |
required |
Source code in boardfarm3/lib/connections/ssh_connection.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
telnet
Telnet connection module.
Classes:
| Name | Description |
|---|---|
TelnetConnection |
A simple telnet session. |
TelnetConnection
TelnetConnection(
session_name: str, command: str, save_console_logs: str, args: list[str]
)
A simple telnet session.
Initialize the Ser2Net connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
pexpect session name |
required |
|
str
|
command to start the pexpect session |
required |
|
str
|
save console logs to disk |
required |
|
list[str]
|
additional arguments to the command |
required |
Methods:
| Name | Description |
|---|---|
close |
Close the connection. |
execute_command |
Execute a command in the Telnet session. |
execute_command_async |
Execute a command in the Telnet session. |
get_last_output |
Get last output from the buffer. |
login_to_server |
Login to Telnet server. |
login_to_server_async |
Login to Telnet seerver using asyncio. |
start_interactive_session |
Start interactive pexpect session. |
Source code in boardfarm3/lib/connections/telnet.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
close
close(force: bool = True) -> None
Close the connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
bool
|
True to send a SIGKILL, False for SIGINT/UP, default True |
True
|
Source code in boardfarm3/lib/connections/telnet.py
114 115 116 117 118 119 120 121 122 | |
execute_command
Execute a command in the Telnet session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to be executed |
required |
|
int
|
timeout for command execute, defaults to 30 |
30
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Source code in boardfarm3/lib/connections/telnet.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
execute_command_async
async
Execute a command in the Telnet session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command to execute |
required |
|
int
|
timeout in seconds. defaults to -1 |
-1
|
Returns:
| Type | Description |
|---|---|
str
|
command output |
Source code in boardfarm3/lib/connections/telnet.py
101 102 103 104 105 106 107 108 109 110 111 112 | |
get_last_output
get_last_output() -> str
Get last output from the buffer.
Returns:
| Type | Description |
|---|---|
str
|
last output from the buffer |
Source code in boardfarm3/lib/boardfarm_pexpect.py
117 118 119 120 121 122 | |
login_to_server
login_to_server(password: str | None = None) -> None
Login to Telnet server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
Telnet password |
None
|
Raises:
| Type | Description |
|---|---|
DeviceConnectionError
|
connection failed to Telnet server |
Source code in boardfarm3/lib/connections/telnet.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
login_to_server_async
async
login_to_server_async(password: str | None = None) -> None
Login to Telnet seerver using asyncio.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
Telnet password (currently unused) |
None
|
Raises:
| Type | Description |
|---|---|
DeviceConnectionError
|
connection failed to Telnet server |
Source code in boardfarm3/lib/connections/telnet.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
start_interactive_session
start_interactive_session() -> None
Start interactive pexpect session.
Source code in boardfarm3/lib/boardfarm_pexpect.py
134 135 136 137 | |
cpe_sw
Common libraries of CPE Sw component.
Classes:
| Name | Description |
|---|---|
CPESwLibraries |
CPE SW common libraries. |
CPESwLibraries
CPE SW common libraries.
Initialise the CPE software.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CPEHW
|
cpe hardware instance |
required |
Methods:
| Name | Description |
|---|---|
add_info_to_file |
Add data into a file. |
enable_logs |
Enable logs for given component. |
factory_reset |
Perform factory reset CPE via given method. |
finalize_boot |
Validate board settings post boot. |
get_board_logs |
Get the console log for the time period mentioned. |
get_boottime_log |
Return the boot time log from the board. |
get_date |
Get the system date and time. |
get_file_content |
Get the content of the given file. |
get_interface_ipv4_netmask |
Return given interface IPv4 netmask. |
get_interface_ipv4addr |
Return given interface IPv4 address. |
get_interface_ipv6addr |
Return given interface IPv6 address. |
get_interface_link_local_ipv6_addr |
Return given interface link local IPv6 address. |
get_interface_mac_addr |
Return given interface mac address. |
get_interface_mtu_size |
Get the MTU size of the interface in bytes. |
get_load_avg |
Return current load average of the cable modem. |
get_memory_utilization |
Return current memory utilization of the cable modem. |
get_ntp_sync_status |
Execute ntpq command to get the synchronization status. |
get_provision_mode |
Return provision mode. |
get_running_processes |
Return the currently running processes in the CPE via the |
get_seconds_uptime |
Return uptime in seconds. |
get_tr069_log |
Return the TR-069 log from the board. |
is_link_up |
Check given interface is up or not. |
is_online |
Is the device online. |
is_production |
Is production software. |
is_tr069_connected |
Is TR-69 agent is connected. |
kill_process_immediately |
Kill the process based on the provided PID. |
read_event_logs |
Return the event logs from the |
reset |
Perform reset via given method. |
set_date |
Set the device's date and time. |
verify_cpe_is_booting |
Verify CPE is booting. |
wait_for_boot |
Wait for CPE to boot. |
Attributes:
| Name | Type | Description |
|---|---|---|
aftr_iface |
str
|
AFTR interface name. |
cpe_id |
str
|
TR069 CPE ID. |
dmcli |
DMCLIAPI
|
Dmcli instance running in CPE Software. |
erouter_iface |
str
|
e-Router interface name. |
firewall |
IptablesFirewall
|
Firewall component of cpe software. |
guest_iface |
str
|
Guest network interface name. |
gui_password |
str
|
GUI login password. |
json_values |
dict[str, Any]
|
CPE Specific JSON values. |
lan_gateway_ipv4 |
IPv4Address
|
LAN Gateway IPv4 address. |
lan_gateway_ipv6 |
IPv6Address
|
LAN Gateway IPv6 address. |
lan_iface |
str
|
LAN interface name. |
lan_network_ipv4 |
IPv4Network
|
LAN IPv4 network. |
nw_utility |
NetworkUtility
|
Network utility component of cpe software. |
tr69_cpe_id |
str
|
TR-69 CPE Identifier. |
version |
str
|
CPE software version. |
wifi |
WiFiHal
|
Wifi instance CPE Software. |
Source code in boardfarm3/lib/cpe_sw.py
32 33 34 35 36 37 38 39 40 41 | |
aftr_iface
abstractmethod
property
aftr_iface: str
AFTR interface name.
cpe_id
abstractmethod
property
cpe_id: str
TR069 CPE ID.
dmcli
property
dmcli: DMCLIAPI
Dmcli instance running in CPE Software.
Returns:
| Type | Description |
|---|---|
DMCLIAPI
|
the object instance |
erouter_iface
abstractmethod
property
erouter_iface: str
e-Router interface name.
firewall
property
firewall: IptablesFirewall
Firewall component of cpe software.
Returns:
| Type | Description |
|---|---|
IptablesFirewall
|
Network firewall libraries |
guest_iface
abstractmethod
property
guest_iface: str
Guest network interface name.
gui_password
abstractmethod
property
gui_password: str
GUI login password.
json_values
abstractmethod
property
json_values: dict[str, Any]
CPE Specific JSON values.
lan_gateway_ipv4
abstractmethod
property
lan_gateway_ipv4: IPv4Address
LAN Gateway IPv4 address.
lan_gateway_ipv6
property
lan_gateway_ipv6: IPv6Address
LAN Gateway IPv6 address.
Returns:
| Type | Description |
|---|---|
IPv6Address
|
IPv6 address of LAN GW |
lan_iface
abstractmethod
property
lan_iface: str
LAN interface name.
lan_network_ipv4
property
lan_network_ipv4: IPv4Network
LAN IPv4 network.
Returns:
| Type | Description |
|---|---|
IPv4Network
|
LAN IPv4 network |
nw_utility
property
nw_utility: NetworkUtility
Network utility component of cpe software.
Returns:
| Type | Description |
|---|---|
NetworkUtility
|
Network utility libraries |
tr69_cpe_id
abstractmethod
property
tr69_cpe_id: str
TR-69 CPE Identifier.
version
abstractmethod
property
version: str
CPE software version.
This will reload after each flash.
add_info_to_file
Add data into a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
contents/data to be added to a file. |
required |
|
str
|
filename with absolute path |
required |
Source code in boardfarm3/lib/cpe_sw.py
422 423 424 425 426 427 428 429 430 | |
enable_logs
Enable logs for given component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
component name |
required |
|
str
|
flag name, Default: "enable" |
'enable'
|
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
pending implementation |
Source code in boardfarm3/lib/cpe_sw.py
272 273 274 275 276 277 278 279 | |
factory_reset
abstractmethod
factory_reset(method: str | None = None) -> bool
Perform factory reset CPE via given method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
factory reset method. Default None. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True on successful factory reset, False otherwise |
Source code in boardfarm3/templates/cpe/cpe_sw.py
139 140 141 142 143 144 145 146 147 | |
finalize_boot
abstractmethod
finalize_boot() -> bool
Validate board settings post boot.
Returns:
| Type | Description |
|---|---|
bool
|
True on successful validation |
Source code in boardfarm3/templates/cpe/cpe_sw.py
381 382 383 384 385 386 387 | |
get_board_logs
get_board_logs(timeout: int = 300) -> str
Get the console log for the time period mentioned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
time value to collect the logs for, defaults to 300 |
300
|
Returns:
| Type | Description |
|---|---|
str
|
Console logs for a given time period |
Raises:
| Type | Description |
|---|---|
BoardfarmException
|
if the console is not initialised, i.e. board has no console connections |
Source code in boardfarm3/lib/cpe_sw.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | |
get_boottime_log
get_boottime_log() -> list[str]
Return the boot time log from the board.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
pending implementation |
Source code in boardfarm3/lib/cpe_sw.py
393 394 395 396 397 398 | |
get_date
get_date() -> str | None
Get the system date and time.
.. code-block:: python
# example output
donderdag, mei 23, 2024 14:23:39
Returns:
| Type | Description |
|---|---|
str | None
|
date |
Source code in boardfarm3/lib/cpe_sw.py
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | |
get_file_content
Get the content of the given file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
name of the file with absolute path |
required |
|
int
|
timeout value to fetch the file content |
required |
Returns:
| Type | Description |
|---|---|
str
|
contents of the file |
Source code in boardfarm3/lib/cpe_sw.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 | |
get_interface_ipv4_netmask
get_interface_ipv4_netmask(interface: str) -> IPv4Address
Return given interface IPv4 netmask.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
name of the interface |
required |
Returns:
| Type | Description |
|---|---|
IPv4Address
|
netmask of the interface |
Source code in boardfarm3/lib/cpe_sw.py
185 186 187 188 189 190 191 192 193 194 195 196 197 | |
get_interface_ipv4addr
get_interface_ipv4addr(interface: str) -> str
Return given interface IPv4 address.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
interface name |
required |
Returns:
| Type | Description |
|---|---|
str
|
IPv4 address |
Raises:
| Type | Description |
|---|---|
ValueError
|
if unable to parse IPv4Address |
Source code in boardfarm3/lib/cpe_sw.py
156 157 158 159 160 161 162 163 164 165 166 167 | |
get_interface_ipv6addr
get_interface_ipv6addr(interface: str) -> str
Return given interface IPv6 address.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
interface name |
required |
Returns:
| Type | Description |
|---|---|
str
|
IPv6 address |
Source code in boardfarm3/lib/cpe_sw.py
169 170 171 172 173 174 175 | |
get_interface_link_local_ipv6_addr
get_interface_link_local_ipv6_addr(interface: str) -> str
Return given interface link local IPv6 address.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
interface name |
required |
Returns:
| Type | Description |
|---|---|
str
|
link local IPv6 address |
Source code in boardfarm3/lib/cpe_sw.py
177 178 179 180 181 182 183 | |
get_interface_mac_addr
get_interface_mac_addr(interface: str) -> str
Return given interface mac address.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
interface name |
required |
Returns:
| Type | Description |
|---|---|
str
|
mac address of the given interface |
Source code in boardfarm3/lib/cpe_sw.py
215 216 217 218 219 220 221 222 223 224 225 | |
get_interface_mtu_size
abstractmethod
get_interface_mtu_size(interface: str) -> int
Get the MTU size of the interface in bytes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
name of the interface |
required |
Returns:
| Type | Description |
|---|---|
int
|
size of the MTU in bytes |
Source code in boardfarm3/templates/cpe/cpe_sw.py
395 396 397 398 399 400 401 402 403 404 | |
get_load_avg
get_load_avg() -> float
Return current load average of the cable modem.
Returns:
| Type | Description |
|---|---|
float
|
current load average for the past minute |
Source code in boardfarm3/lib/cpe_sw.py
234 235 236 237 238 239 240 241 242 243 244 | |
get_memory_utilization
get_memory_utilization() -> dict[str, int]
Return current memory utilization of the cable modem.
Returns:
| Type | Description |
|---|---|
dict[str, int]
|
current memory utilization of cpe |
Source code in boardfarm3/lib/cpe_sw.py
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 | |
get_ntp_sync_status
get_ntp_sync_status() -> list[dict[str, Any]]
Execute ntpq command to get the synchronization status.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
pending implementation |
Source code in boardfarm3/lib/cpe_sw.py
376 377 378 379 380 381 382 383 | |
get_provision_mode
abstractmethod
get_provision_mode() -> str
Return provision mode.
Source code in boardfarm3/templates/cpe/cpe_sw.py
117 118 119 120 | |
get_running_processes
get_running_processes(ps_options: str | None = '-A') -> Iterable[ParsedPSOutput]
Return the currently running processes in the CPE via the ps command.
.. code-block:: python
# parsed_ps_output
[
{"pid": 1, "tty": None, "time": "00:02:29", "cmd": "init"},
{"pid": 2, "tty": None, "time": "00:00:00", "cmd": "kthreadd"},
{"pid": 3, "tty": None, "time": "00:00:36", "cmd": "ksoftirqd/0"},
{"pid": 5, "tty": None, "time": "00:00:00", "cmd": "kworker/0:0H"},
...
{'pid': 2613, 'tty': None, 'time': '00:03:25', 'cmd': 'CcspTr069PaSsp'}
...
]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
The options to be passed to the ps command, defaults to "-A" |
'-A'
|
Returns:
| Type | Description |
|---|---|
Iterable[ParsedPSOutput]
|
the currently running processes as a parsed tuple of dictionaries |
Source code in boardfarm3/lib/cpe_sw.py
345 346 347 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 | |
get_seconds_uptime
get_seconds_uptime() -> float
Return uptime in seconds.
Returns:
| Type | Description |
|---|---|
float
|
uptime in seconds |
Raises:
| Type | Description |
|---|---|
ValueError
|
if failed to get uptime |
Source code in boardfarm3/lib/cpe_sw.py
88 89 90 91 92 93 94 95 96 97 98 99 100 | |
get_tr069_log
get_tr069_log() -> list[str]
Return the TR-069 log from the board.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
pending implementation |
Source code in boardfarm3/lib/cpe_sw.py
400 401 402 403 404 405 | |
is_link_up
Check given interface is up or not.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
interface name, defaults to "BROADCAST,MULTICAST,UP" |
required |
|
str
|
interface state |
'BROADCAST,MULTICAST,UP'
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the link is up |
Source code in boardfarm3/lib/cpe_sw.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
is_online
is_online() -> bool
Is the device online.
Returns:
| Type | Description |
|---|---|
bool
|
True if the device is online, False otherwise |
Raises:
| Type | Description |
|---|---|
ValueError
|
if erouter mode not in ["dual", "ipv4", "ipv6"] |
Source code in boardfarm3/lib/cpe_sw.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
is_production
abstractmethod
is_production() -> bool
Is production software.
Production software has limited capabilities.
Source code in boardfarm3/templates/cpe/cpe_sw.py
122 123 124 125 126 127 128 | |
is_tr069_connected
is_tr069_connected() -> bool
Is TR-69 agent is connected.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
pending implementation |
Source code in boardfarm3/lib/cpe_sw.py
227 228 229 230 231 232 | |
kill_process_immediately
kill_process_immediately(pid: int) -> None
Kill the process based on the provided PID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
process number |
required |
Source code in boardfarm3/lib/cpe_sw.py
385 386 387 388 389 390 391 | |
read_event_logs
read_event_logs() -> JSONDictType | list[JSONDictType] | Iterator[JSONDictType]
Return the event logs from the logread command.
.. code-block:: python
# example output
[
{
"priority": None,
"date": "May 8 02:28:26",
"hostname": "mv1cbn-arm",
"tag": "kern",
"content": ".debug kernel: PP MC Session delete: failed for src...",
},
{
"priority": None,
"date": "May 8 02:42:46",
"hostname": "mv1cbn-arm",
"tag": "user",
"content": ".debug MCPROXY: del mroute gaddr: 239.255.255.250, ...",
},
{
"priority": None,
"date": "May 8 02:42:56",
"hostname": "mv1cbn-arm",
"tag": "kern",
"content": ".debug kernel: PP MC Session delete: failed for src...",
},
{
"priority": None,
"date": "May 8 02:57:16",
"hostname": "mv1cbn-arm",
"tag": "user",
"content": ".debug MCPROXY: del mroute gaddr: 239.255.255.250, ...",
},
]
Returns:
| Type | Description |
|---|---|
JSONDictType | list[JSONDictType] | Iterator[JSONDictType]
|
the event logs from the |
Source code in boardfarm3/lib/cpe_sw.py
298 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 337 338 339 340 341 342 343 | |
reset
abstractmethod
reset(method: str | None = None) -> None
Perform reset via given method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
reset method. Default None |
None
|
Source code in boardfarm3/templates/cpe/cpe_sw.py
130 131 132 133 134 135 136 137 | |
set_date
set_date(date_string: str) -> bool
Set the device's date and time.
It should execute date -s {date_string} on the device's console.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
value to be changed |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if set is successful |
Source code in boardfarm3/lib/cpe_sw.py
453 454 455 456 457 458 459 460 461 462 463 464 | |
verify_cpe_is_booting
abstractmethod
verify_cpe_is_booting() -> None
Verify CPE is booting.
Source code in boardfarm3/templates/cpe/cpe_sw.py
112 113 114 115 | |
wait_for_boot
abstractmethod
wait_for_boot() -> None
Wait for CPE to boot.
Source code in boardfarm3/templates/cpe/cpe_sw.py
149 150 151 152 | |
custom_typing
Boardfarm3 custom type hints package.
Modules:
| Name | Description |
|---|---|
cpe |
Collection on Enum to be used. |
dhcp |
DHCP type hints for Provisioner Templates. |
jc |
Type hints for jc parsed output. |
cpe
Collection on Enum to be used.
Classes:
| Name | Description |
|---|---|
CPEInterfaces |
Define all the interfaces on CPE. |
HostInterfaces |
Define all the interfaces on the Host device. |
CPEInterfaces
Define all the interfaces on CPE.
The corresponding value should be available as an instance on board object.
HostInterfaces
Define all the interfaces on the Host device.
The corresponding value should be available as an instance on the device object.
dhcp
DHCP type hints for Provisioner Templates.
jc
Type hints for jc parsed output.
Classes:
| Name | Description |
|---|---|
ParsedPSOutput |
Typing for parsed output returned by jc for the ps command. |
ParsedPSOutput
Typing for parsed output returned by jc for the ps command.
dataclass
Boardfarm3 dataclasses.
These are used to store/load information required by usecases.
Modules:
| Name | Description |
|---|---|
dhcp |
Dataclasses to store DHCP info. |
interface |
Data classes to store IP interface info. |
network_models |
Data classes to store all models related to network. |
packets |
Data classes to store network packets. |
dhcp
Dataclasses to store DHCP info.
Classes:
| Name | Description |
|---|---|
DHCPV6Options |
DHCPV6Options data class. |
DHCPV6TraceData |
DHCPv6TraceData data class. |
DHCPV6Options
dataclass
DHCPV6Options(option_data: ResultDict)
DHCPV6Options data class.
Attributes:
| Name | Type | Description |
|---|---|---|
option_1 |
ResultDict | None
|
DHCP IPv6 option 1. |
option_14 |
ResultDict | None
|
DHCP IPv6 option 14. |
option_16 |
ResultDict | None
|
DHCP IPv6 option 16. |
option_17 |
ResultDict | None
|
DHCP IPv6 option 17. |
option_2 |
ResultDict | None
|
DHCP IPv6 option 2. |
option_20 |
ResultDict | None
|
DHCP IPv6 option 20. |
option_23 |
ResultDict | None
|
DHCP IPv6 option 23. |
option_24 |
ResultDict | None
|
DHCP IPv6 option 24. |
option_25 |
ResultDict | None
|
DHCP IPv6 option 25. |
option_26 |
ResultDict | None
|
DHCP IPv6 option 26. |
option_3 |
ResultDict | None
|
DHCP IPv6 option 3. |
option_5 |
ResultDict | None
|
DHCP IPv6 option 5. |
option_6 |
ResultDict | None
|
DHCP IPv6 option 6. |
option_64 |
ResultDict | None
|
DHCP IPv6 option 64. |
option_8 |
ResultDict | None
|
DHCP IPv6 option 8. |
option_1
property
option_1: ResultDict | None
DHCP IPv6 option 1.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 1. |
option_14
property
option_14: ResultDict | None
DHCP IPv6 option 14.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 14. |
option_16
property
option_16: ResultDict | None
DHCP IPv6 option 16.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 16. |
option_17
property
option_17: ResultDict | None
DHCP IPv6 option 17.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 17. |
option_2
property
option_2: ResultDict | None
DHCP IPv6 option 2.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 2. |
option_20
property
option_20: ResultDict | None
DHCP IPv6 option 20.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 20. |
option_23
property
option_23: ResultDict | None
DHCP IPv6 option 23.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 23. |
option_24
property
option_24: ResultDict | None
DHCP IPv6 option 24.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 24. |
option_25
property
option_25: ResultDict | None
DHCP IPv6 option 25.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 25. |
option_26
property
option_26: ResultDict | None
DHCP IPv6 option 26.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 26. |
option_3
property
option_3: ResultDict | None
DHCP IPv6 option 3.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 3. |
option_5
property
option_5: ResultDict | None
DHCP IPv6 option 5.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 5. |
option_6
property
option_6: ResultDict | None
DHCP IPv6 option 6.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 6. |
option_64
property
option_64: ResultDict | None
DHCP IPv6 option 64.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 64. |
option_8
property
option_8: ResultDict | None
DHCP IPv6 option 8.
Returns:
| Type | Description |
|---|---|
ResultDict | None
|
DHCP IPv6 option 8. |
DHCPV6TraceData
dataclass
DHCPV6TraceData(
source: IPAddresses,
destination: IPAddresses,
dhcpv6_packet: ResultDict,
dhcpv6_message_type: int,
)
DHCPv6TraceData data class.
Holds source, destination, DHCPv6_packet and DHCPv6_message_type.
interface
Data classes to store IP interface info.
Classes:
| Name | Description |
|---|---|
IPAddresses |
To store IP address information. |
IPAddresses
dataclass
IPAddresses(
ipv4: IPv4Address | None,
ipv6: IPv6Address | None,
link_local_ipv6: IPv6Address | None,
)
To store IP address information.
network_models
Data classes to store all models related to network.
Classes:
| Name | Description |
|---|---|
IPerf3TrafficGenerator |
IPerf3TrafficGenerator data classes. |
IPerf3TrafficGenerator
dataclass
IPerf3TrafficGenerator(
traffic_sender: LAN | WAN | WLAN,
sender_pid: int | None,
traffic_receiver: LAN | WAN | WLAN,
receiver_pid: int | None,
server_log_file: str = "",
client_log_file: str = "",
)
IPerf3TrafficGenerator data classes.
It holds sender/receiver devices and their process IDs.
packets
Data classes to store network packets.
Classes:
| Name | Description |
|---|---|
ICMPPacketData |
ICMP packet data class. |
RIPv2PacketData |
Class to hold RIP packet details for Use Case. |
ICMPPacketData
dataclass
ICMPPacketData(query_code: int, source: IPAddresses, destination: IPAddresses)
ICMP packet data class.
To hold all the packet information specific to ICMP packets.
source and destination could be either IPv4 or IPv6 addresses.
query_code defines the type of message received or sent and could be
among the following:
* Type 0 = Echo Reply
* Type 8 = Echo Request
* Type 9 = Router Advertisement
* Type 10 = Router Solicitation
* Type 13 = Timestamp Request
* Type 14 = Timestamp Reply
RIPv2PacketData
dataclass
RIPv2PacketData(
source: IPv4Address,
destination: IPv4Address,
ip_address: list[IPv4Address],
subnet: list[IPv4Interface | IPv6Interface],
frame_time: datetime | None = None,
)
Class to hold RIP packet details for Use Case.
device_manager
Boardfarm device manager.
Classes:
| Name | Description |
|---|---|
DeviceManager |
Manages all the devices in the environment. |
Functions:
| Name | Description |
|---|---|
get_device_manager |
Return device manager instance if already instantiated. |
DeviceManager
DeviceManager(plugin_manager: PluginManager)
Manages all the devices in the environment.
Initialize device manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
PluginManager
|
plugin manager |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
when DeviceManager is already initialized |
Methods:
| Name | Description |
|---|---|
get_device_by_type |
Get first device of the given type. |
get_devices_by_type |
Get devices of given type. |
register_device |
Register a device as plugin with boardfarm. |
unregister_device |
Unregister a device from boardfarm. |
Source code in boardfarm3/lib/device_manager.py
29 30 31 32 33 34 35 36 37 38 39 40 | |
get_device_by_type
get_device_by_type(device_type: type[T]) -> T
Get first device of the given type.
In order to get all devices of given type use get_devices_by_type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
type[T]
|
device type |
required |
Returns:
| Type | Description |
|---|---|
T
|
device of given type |
Raises:
| Type | Description |
|---|---|
DeviceNotFound
|
when device of given type not available |
Source code in boardfarm3/lib/device_manager.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
get_devices_by_type
get_devices_by_type(device_type: type[T]) -> dict[str, T]
Get devices of given type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
type[T]
|
device type |
required |
Returns:
| Type | Description |
|---|---|
dict[str, T]
|
devices of given type |
Source code in boardfarm3/lib/device_manager.py
42 43 44 45 46 47 48 49 50 51 52 | |
register_device
register_device(device: BoardfarmDevice) -> None
Register a device as plugin with boardfarm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
BoardfarmDevice
|
device instance to register |
required |
Source code in boardfarm3/lib/device_manager.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
unregister_device
unregister_device(device_name: str) -> None
Unregister a device from boardfarm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
name of device to unregister |
required |
Source code in boardfarm3/lib/device_manager.py
87 88 89 90 91 92 | |
get_device_manager
get_device_manager() -> DeviceManager
Return device manager instance if already instantiated.
When you run boardfarm it will initialize the DeviceManager.
Returns:
| Type | Description |
|---|---|
DeviceManager
|
device manager instance |
Raises:
| Type | Description |
|---|---|
ValueError
|
when device manager in not instantiated |
Source code in boardfarm3/lib/device_manager.py
95 96 97 98 99 100 101 102 103 104 105 106 107 | |
dmcli
RDKB dmcli command line interface module.
Classes:
| Name | Description |
|---|---|
DMCLIAPI |
RDKB dmcli command line interface utility. |
DMCLIError |
Raise this on DMCLI command line utility errors. |
DMCLIOut |
DMCLI command output data. |
DMCLIAPI
DMCLIAPI(console: BoardfarmPexpect)
RDKB dmcli command line interface utility.
Initialize DMCLIAPI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
BoardfarmPexpect
|
console instance which has dmcli utility |
required |
Methods:
| Name | Description |
|---|---|
AddObject |
Add object via dmcli. |
DelObject |
Add object via dmcli. |
GPV |
Get given parameter value via dmcli. |
SPV |
Set given parameter via dmcli. |
Source code in boardfarm3/lib/dmcli.py
34 35 36 37 38 39 40 | |
AddObject
Add object via dmcli.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
param to be added |
required |
Returns:
| Type | Description |
|---|---|
DMCLIOut
|
dmcli output object |
Source code in boardfarm3/lib/dmcli.py
67 68 69 70 71 72 73 74 | |
DelObject
Add object via dmcli.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
param to delete |
required |
Returns:
| Type | Description |
|---|---|
DMCLIOut
|
dmcli output object |
Source code in boardfarm3/lib/dmcli.py
106 107 108 109 110 111 112 113 | |
GPV
Get given parameter value via dmcli.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
param to get |
required |
Returns:
| Type | Description |
|---|---|
DMCLIOut
|
dmcli output object |
Source code in boardfarm3/lib/dmcli.py
96 97 98 99 100 101 102 103 104 | |
SPV
SPV(
param: str, value: str, type_set: str = "string", sleep_timeout: float = 0.0
) -> DMCLIOut
Set given parameter via dmcli.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
param in which value is to be set |
required |
|
str
|
value to be set |
required |
|
str
|
type of value set, defaults to string |
'string'
|
|
float
|
sleep values when SPV, defaults to 0.0 |
0.0
|
Returns:
| Type | Description |
|---|---|
DMCLIOut
|
dmcli output object |
Source code in boardfarm3/lib/dmcli.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
DMCLIError
Raise this on DMCLI command line utility errors.
DMCLIOut
dataclass
DMCLIOut(status: str, rtype: str, rval: str, console_out: str)
DMCLI command output data.
Properties: status, rtype, rval, console_out
docker_factory
Docker Factory v2 related libraries.
Modules:
| Name | Description |
|---|---|
docker_compose_generator |
Library to generate docker-compose.yml payload to docker factory v2. |
docker_compose_generator
Library to generate docker-compose.yml payload to docker factory v2.
Classes:
| Name | Description |
|---|---|
DockerComposeGenerator |
Class to manage docker-compose.yml payload for docker factory v2. |
DockerComposeGenerator
DockerComposeGenerator(boardfarm_config: BoardfarmConfig)
Class to manage docker-compose.yml payload for docker factory v2.
Initialize the YMLManager for Docker Factory v2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
BoardfarmConfig
|
Boardfarm Config instance |
required |
Methods:
| Name | Description |
|---|---|
generate_docker_compose |
Generate the docker-compose yml to be used as payload for docker factory. |
Source code in boardfarm3/lib/docker_factory/docker_compose_generator.py
23 24 25 26 27 28 29 30 31 32 | |
generate_docker_compose
generate_docker_compose() -> dict[str, Any]
Generate the docker-compose yml to be used as payload for docker factory.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The docker compose payload for docker factory |
Source code in boardfarm3/lib/docker_factory/docker_compose_generator.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | |
gui
Keep SonarQube happy.
Modules:
| Name | Description |
|---|---|
gui_helper |
Module for Selenium webdriver interaction implementations. |
prplos |
Keep ruff happy. |
gui_helper
Module for Selenium webdriver interaction implementations.
Classes:
| Name | Description |
|---|---|
GuiHelper |
GuiHelper class to get webdrivers for testing. |
GuiHelperNoProxy |
GuiHelper without proxy. |
ScreenshotListener |
Take a screenshot on exceptions/events. |
Functions:
| Name | Description |
|---|---|
element_is_present_by_css |
Determine if element is present by its css selector. |
firefox_webproxy_driver |
Initialize proxy firefox webdriver. |
get_web_driver |
Return proxy webdriver. |
save_screenshot |
Save screenshot of the driver window. |
GuiHelper
GuiHelper(
device: LAN | WAN | WLAN, default_delay: int = 20, output_dir: str | None = None
)
GuiHelper class to get webdrivers for testing.
GUI helper class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | WLAN
|
device instance |
required |
|
int
|
default delay in seconds, defaults to 20 |
20
|
|
str | None
|
output directory path, defaults to None |
None
|
Methods:
| Name | Description |
|---|---|
get_web_driver |
Return event firing web driver. |
get_webdriver_without_event_firing |
Return webdriver without the EventFiringWebDriver. |
Source code in boardfarm3/lib/gui/gui_helper.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | |
get_web_driver
get_web_driver() -> EventFiringWebDriver
Return event firing web driver.
Returns:
| Type | Description |
|---|---|
EventFiringWebDriver
|
web driver instance |
Source code in boardfarm3/lib/gui/gui_helper.py
366 367 368 369 370 371 372 373 374 375 376 377 378 379 | |
get_webdriver_without_event_firing
get_webdriver_without_event_firing(headless: bool = True) -> WebDriver
Return webdriver without the EventFiringWebDriver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
bool
|
run in headless mode, defaults to True |
True
|
Returns:
| Type | Description |
|---|---|
WebDriver
|
web driver instance |
Source code in boardfarm3/lib/gui/gui_helper.py
381 382 383 384 385 386 387 388 389 390 391 | |
GuiHelperNoProxy
GuiHelperNoProxy(
default_delay: int = 20, output_dir: str | None = None, headless: bool = True
)
GuiHelper without proxy.
GUI helper class without proxy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
default delay in seconds, defaults to 20 |
20
|
|
str | None
|
output directory path, defaults to None |
None
|
|
bool
|
turns on/off headless mode, defaults to True |
True
|
Methods:
| Name | Description |
|---|---|
get_web_driver |
Return event firing web driver. |
get_webdriver_without_event_firing |
Return webdriver without the EventFiringWebDriver. |
Source code in boardfarm3/lib/gui/gui_helper.py
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | |
get_web_driver
get_web_driver() -> EventFiringWebDriver
Return event firing web driver.
Returns:
| Type | Description |
|---|---|
EventFiringWebDriver
|
web driver instance |
Source code in boardfarm3/lib/gui/gui_helper.py
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 | |
get_webdriver_without_event_firing
get_webdriver_without_event_firing(headless: bool = True) -> WebDriver
Return webdriver without the EventFiringWebDriver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
bool
|
run in headless mode, defaults to True |
True
|
Returns:
| Type | Description |
|---|---|
WebDriver
|
web driver instance |
Source code in boardfarm3/lib/gui/gui_helper.py
381 382 383 384 385 386 387 388 389 390 391 | |
ScreenshotListener
ScreenshotListener(screenshot_path: str)
Take a screenshot on exceptions/events.
This allows to capture screenshot based on selenium web driver events. Capturing screenshot can be varied by setting the logging.root.level When logging.root.level set to :
1. NOTSET - takes screenshots for on_exception and before_click events
2. INFO - takes screenshots for on_exception, before_click and
after_change_value_of events
3. DEBUG - takes screenshot for all the events
Init method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
the screenshot destination dir |
required |
Methods:
| Name | Description |
|---|---|
after_change_value_of |
Capture screenshot after change_value_of event. |
after_click |
Capture screenshot after click event. |
after_close |
Capture screenshot after close event. |
after_execute_script |
Capture screenshot after execute_script event. |
after_navigate_to |
Capture screenshot after navigate_to event. |
before_change_value_of |
Capture screenshot before change_value_of event. |
before_click |
Capture screenshot before click event. |
before_close |
Capture screenshot before close event. |
before_execute_script |
Capture screenshot before execute_script event. |
before_navigate_to |
Capture screenshot before navigate_to event. |
before_quit |
Capture screenshot before quit event. |
capture_screenshot |
Capture screenshot and save name.ext to disk. |
on_exception |
Capture screenshot on exception. |
Source code in boardfarm3/lib/gui/gui_helper.py
52 53 54 55 56 57 58 59 | |
after_change_value_of
Capture screenshot after change_value_of event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WebElement
|
unused |
required |
|
WebDriver
|
web driver |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
after_click
Capture screenshot after click event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WebElement
|
unused |
required |
|
WebDriver
|
web driver |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
after_close
after_close(driver: WebDriver) -> None
Capture screenshot after close event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WebDriver
|
web driver |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
241 242 243 244 245 246 247 248 | |
after_execute_script
Capture screenshot after execute_script event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
unused |
required |
|
WebDriver
|
web driver |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
after_navigate_to
Capture screenshot after navigate_to event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
unused |
required |
|
WebDriver
|
web driver |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
before_change_value_of
Capture screenshot before change_value_of event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WebElement
|
unused |
required |
|
WebDriver
|
web driver |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 | |
before_click
Capture screenshot before click event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WebElement
|
unused |
required |
|
WebDriver
|
web driver |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
143 144 145 146 147 148 149 150 151 152 153 154 155 | |
before_close
before_close(driver: WebDriver) -> None
Capture screenshot before close event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WebDriver
|
web driver |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
232 233 234 235 236 237 238 239 | |
before_execute_script
Capture screenshot before execute_script event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
unused |
required |
|
WebDriver
|
web driver |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
before_navigate_to
Capture screenshot before navigate_to event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
unused |
required |
|
WebDriver
|
web driver |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
before_quit
before_quit(driver: WebDriver) -> None
Capture screenshot before quit event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WebDriver
|
web driver |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
250 251 252 253 254 255 256 257 | |
capture_screenshot
Capture screenshot and save name.ext to disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WebDriver
|
web driver |
required |
|
str
|
the filename (with path if needed) |
required |
|
str
|
the extension, defaults to png |
'png'
|
Source code in boardfarm3/lib/gui/gui_helper.py
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 | |
on_exception
Capture screenshot on exception.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Exception
|
unused |
required |
|
WebDriver
|
web driver |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
99 100 101 102 103 104 105 106 107 108 109 110 111 | |
element_is_present_by_css
element_is_present_by_css(element_css: str) -> Callable[[AnyDriver], WebElement | bool]
Determine if element is present by its css selector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
element css selector |
required |
Returns:
| Type | Description |
|---|---|
Callable[[EC.AnyDriver], WebDriver | EventFiringWebDriver]
|
True if element is present, False otherwise |
Source code in boardfarm3/lib/gui/gui_helper.py
394 395 396 397 398 399 400 401 402 403 404 | |
firefox_webproxy_driver
firefox_webproxy_driver(
http_proxy: str, default_delay: int, headless: bool = False
) -> Firefox
Initialize proxy firefox webdriver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
proxy ip and port number |
required |
|
int
|
selenium default delay in seconds |
required |
|
bool
|
headless state, default to False |
False
|
Returns:
| Type | Description |
|---|---|
Firefox
|
gui selenium web driver instance |
Source code in boardfarm3/lib/gui/gui_helper.py
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 300 301 302 303 304 305 306 307 | |
get_web_driver
Return proxy webdriver.
Http proxy (dante) must be running on provided device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WAN | WLAN
|
device instance |
required |
|
int
|
default delay in seconds |
required |
|
bool
|
headless state, default to True |
True
|
Returns:
| Type | Description |
|---|---|
WebDriver
|
configured Firefox webdriver instance |
Source code in boardfarm3/lib/gui/gui_helper.py
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 | |
save_screenshot
save_screenshot(driver: WebDriver | EventFiringWebDriver) -> None
Save screenshot of the driver window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
WebDriver | EventFiringWebDriver
|
webdriver instance |
required |
Source code in boardfarm3/lib/gui/gui_helper.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | |
prplos
Keep ruff happy.
Modules:
| Name | Description |
|---|---|
pages |
Keep ruff happy. |
pages
Keep ruff happy.
Modules:
| Name | Description |
|---|---|
home |
PrplOS GUI Home Page. |
lcm |
PrplOS GUI LCM Page. |
login |
Login Page POM. |
page_helper |
Page Helper Module. |
prplos_base_pom |
PrplOS Base Page Oobject Module (POM). |
wan |
PrplOS GUI WAN Page. |
wifi |
PrplOS GUI WiFi Page. |
home
PrplOS GUI Home Page.
Classes:
| Name | Description |
|---|---|
HomePage |
Page Object for Home page. |
HomePage
HomePage(
driver: WebDriver | EventFiringWebDriver,
gw_ip: str | IPv4Address,
fluent_wait: int = 20,
)
Page Object for Home page.
Initialize HomePage POM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
WebDriver | EventFiringWebDriver
|
webdriver instance |
required |
gw_ip
|
str | IPv4Address
|
gateway ip address |
required |
fluent_wait
|
int
|
timeout in seconds to load the page, defaults to 20 |
20
|
Methods:
| Name | Description |
|---|---|
__getattribute__ |
Take a screenshot and save to a folder upon TimeoutException. |
click_networking_submenu |
Ckick on WAN menu option. |
is_page_loaded |
Verify the home page is completely loaded. |
logout |
Log out. |
wait_until_loaded |
Wait until the page is loaded completely. |
Attributes:
| Name | Type | Description |
|---|---|---|
cpu_info_element |
WebElement
|
CPU info box. |
memory_info_element |
WebElement
|
Memory info box. |
system_info_element |
WebElement
|
System info box. |
wan_info_element |
WebElement
|
WAN info element. |
Source code in boardfarm3/lib/gui/prplos/pages/home.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
cpu_info_element
property
cpu_info_element: WebElement
CPU info box.
Returns:
| Type | Description |
|---|---|
WebElement
|
the web element |
memory_info_element
property
memory_info_element: WebElement
Memory info box.
Returns:
| Type | Description |
|---|---|
WebElement
|
the web element |
system_info_element
property
system_info_element: WebElement
System info box.
Returns:
| Type | Description |
|---|---|
WebElement
|
the web element |
wan_info_element
property
wan_info_element: WebElement
WAN info element.
Returns:
| Type | Description |
|---|---|
WebElement
|
the web element |
__getattribute__
__getattribute__(name: str) -> None
Take a screenshot and save to a folder upon TimeoutException.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
the attribute |
required |
Returns:
| Type | Description |
|---|---|
related to the attribute
|
the attribute value |
Raises:
| Type | Description |
|---|---|
TimeoutException
|
if the attr was not found |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
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 | |
click_networking_submenu
click_networking_submenu(element: WebElement) -> None
Ckick on WAN menu option.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
WebElement
|
the element to click |
required |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
115 116 117 118 119 120 121 122 123 124 | |
is_page_loaded
is_page_loaded(driver: WebDriver | EventFiringWebDriver) -> bool
Verify the home page is completely loaded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
WebDriver | EventFiringWebDriver
|
webdriver instance |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if home page is loaded, Otherwise False |
Source code in boardfarm3/lib/gui/prplos/pages/home.py
39 40 41 42 43 44 45 46 47 48 49 | |
logout
logout() -> None
Log out.
All the pages derived from the POM have logged in!
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
126 127 128 129 130 131 132 | |
wait_until_loaded
wait_until_loaded(timeout: int | None = None) -> bool
Wait until the page is loaded completely.
Generic method to wait upto fluent_wait time or upto timeout specified by the user until the page is loaded and return the status
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
int | None
|
timeout in seconds to load the page, defaults to None |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if page is loaded, Otherwise False |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
89 90 91 92 93 94 95 96 97 98 99 100 | |
lcm
PrplOS GUI LCM Page.
Classes:
| Name | Description |
|---|---|
LCMPage |
Page Object for LCM page. |
LCMPage
LCMPage(
driver: WebDriver | EventFiringWebDriver,
gw_ip: str | IPv4Address,
fluent_wait: int = 20,
)
Page Object for LCM page.
Initialize LCMPage POM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
WebDriver | EventFiringWebDriver
|
webdriver instance |
required |
gw_ip
|
str | IPv4Address
|
gateway ip address |
required |
fluent_wait
|
int
|
timeout in seconds to load the page, defaults to 20 |
20
|
Methods:
| Name | Description |
|---|---|
__getattribute__ |
Take a screenshot and save to a folder upon TimeoutException. |
click_networking_submenu |
Ckick on WAN menu option. |
is_page_loaded |
Verify the home page is completely loaded. |
logout |
Log out. |
wait_until_loaded |
Wait until the page is loaded completely. |
Attributes:
| Name | Type | Description |
|---|---|---|
networking_lcm_header |
WebElement
|
The LCM header element. |
Source code in boardfarm3/lib/gui/prplos/pages/lcm.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
networking_lcm_header
property
networking_lcm_header: WebElement
The LCM header element.
Returns:
| Type | Description |
|---|---|
WebElement
|
the web element |
Raises:
| Type | Description |
|---|---|
NoSuchElementException
|
if not found |
__getattribute__
__getattribute__(name: str) -> None
Take a screenshot and save to a folder upon TimeoutException.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
the attribute |
required |
Returns:
| Type | Description |
|---|---|
related to the attribute
|
the attribute value |
Raises:
| Type | Description |
|---|---|
TimeoutException
|
if the attr was not found |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
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 | |
click_networking_submenu
click_networking_submenu(element: WebElement) -> None
Ckick on WAN menu option.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
WebElement
|
the element to click |
required |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
115 116 117 118 119 120 121 122 123 124 | |
is_page_loaded
is_page_loaded(driver: WebDriver | EventFiringWebDriver) -> bool
Verify the home page is completely loaded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
WebDriver | EventFiringWebDriver
|
webdriver instance |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if home page is loaded |
Source code in boardfarm3/lib/gui/prplos/pages/lcm.py
51 52 53 54 55 56 57 58 59 60 61 | |
logout
logout() -> None
Log out.
All the pages derived from the POM have logged in!
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
126 127 128 129 130 131 132 | |
wait_until_loaded
wait_until_loaded(timeout: int | None = None) -> bool
Wait until the page is loaded completely.
Generic method to wait upto fluent_wait time or upto timeout specified by the user until the page is loaded and return the status
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
int | None
|
timeout in seconds to load the page, defaults to None |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if page is loaded, Otherwise False |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
89 90 91 92 93 94 95 96 97 98 99 100 | |
login
Login Page POM.
Classes:
| Name | Description |
|---|---|
LoginPage |
Page Object for Login page. |
LoginPage
LoginPage(
driver: WebDriver | EventFiringWebDriver,
gw_ip: str | IPv4Address,
fluent_wait: int = 20,
use_https: bool = False,
)
Page Object for Login page.
Initialize LoginPage POM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
WebDriver | EventFiringWebDriver
|
webdriver instance |
required |
gw_ip
|
str | IPv4Address
|
gateway ip address |
required |
fluent_wait
|
int
|
timeout in seconds to load the page, defaults to 20 |
20
|
use_https
|
bool
|
whether to use http/s, defaults to False |
False
|
Methods:
| Name | Description |
|---|---|
is_page_loaded |
Verify the home page is completely loaded. |
login |
Login to the UI. |
Attributes:
| Name | Type | Description |
|---|---|---|
logo_element |
WebElement
|
Logo element. |
password_box_element |
WebElement
|
Password textbox element. |
username_box_element |
WebElement
|
Username textbox element. |
Source code in boardfarm3/lib/gui/prplos/pages/login.py
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 | |
logo_element
property
logo_element: WebElement
Logo element.
Returns:
| Type | Description |
|---|---|
WebElement
|
The web element |
password_box_element
property
password_box_element: WebElement
Password textbox element.
Returns:
| Type | Description |
|---|---|
WebElement
|
The web element |
username_box_element
property
username_box_element: WebElement
Username textbox element.
Returns:
| Type | Description |
|---|---|
WebElement
|
The web element |
is_page_loaded
is_page_loaded(driver: WebDriver | EventFiringWebDriver) -> bool
Verify the home page is completely loaded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
WebDriver | EventFiringWebDriver
|
webdriver instance |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if home page is loaded, Otherwise False |
Source code in boardfarm3/lib/gui/prplos/pages/login.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
login
Login to the UI.
Login to the UI or if the UI is not at the Login page then performs first installation operation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user
|
str
|
login username |
required |
password
|
str
|
login password |
required |
Source code in boardfarm3/lib/gui/prplos/pages/login.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
page_helper
Page Helper Module.
Functions:
| Name | Description |
|---|---|
get_element_by_css |
Get an element by CSS selector (wait if needed). |
initialize |
Initialize the page obj. |
wait_until_loaded |
Wait until the page is loaded completely. |
get_element_by_css
Get an element by CSS selector (wait if needed).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
Any
|
the webpage |
required |
element
|
str
|
the element |
required |
Returns:
| Type | Description |
|---|---|
WebElement
|
the web element |
Raises:
| Type | Description |
|---|---|
NoSuchElementException
|
if the element is not found |
Source code in boardfarm3/lib/gui/prplos/pages/page_helper.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
initialize
initialize(
page: Any,
driver: WebDriver | EventFiringWebDriver,
gw_ip: str | IPv4Address,
fluent_wait: int = 20,
use_https: bool = False,
user: str = PRPLOS_USER,
password: str = PRPLOS_PASSWORD,
) -> None
Initialize the page obj.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
Any
|
the page |
required |
driver
|
WebDriver | EventFiringWebDriver
|
the web driver |
required |
gw_ip
|
str | IPv4Address
|
the gateway ip |
required |
fluent_wait
|
int
|
browser fluent wait, defaults to 20 |
20
|
use_https
|
bool
|
use htpp/s, defaults to False |
False
|
user
|
str
|
username, defaults to admin |
PRPLOS_USER
|
password
|
str
|
login password, defaults to admin |
PRPLOS_PASSWORD
|
Source code in boardfarm3/lib/gui/prplos/pages/page_helper.py
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 | |
wait_until_loaded
Wait until the page is loaded completely.
Generic method to wait upto fluent_wait time or upto timeout specified by the user until the page is loaded and return the status
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
Any
|
the page obj |
required |
timeout
|
int | None
|
timeout in seconds to load the page, defaults to None |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if page is loaded |
Source code in boardfarm3/lib/gui/prplos/pages/page_helper.py
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 | |
prplos_base_pom
PrplOS Base Page Oobject Module (POM).
Classes:
| Name | Description |
|---|---|
PrplOSBasePOM |
Contains objects that are common to all the pages of the PrplOS GUI. |
PrplOSBasePOM
PrplOSBasePOM(
driver: WebDriver | EventFiringWebDriver,
gw_ip: str | IPv4Address,
fluent_wait: int = 20,
use_https: bool = False,
)
Contains objects that are common to all the pages of the PrplOS GUI.
Initialize the class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
WebDriver | EventFiringWebDriver
|
webdriver instance |
required |
gw_ip
|
str | IPv4Address
|
gateway ip address |
required |
fluent_wait
|
int
|
timeout in seconds to load the page, defaults to 20 |
20
|
use_https
|
bool
|
flag to specify whether http or https, defaults to false |
False
|
Methods:
| Name | Description |
|---|---|
__getattribute__ |
Take a screenshot and save to a folder upon TimeoutException. |
click_networking_submenu |
Ckick on WAN menu option. |
is_page_loaded |
Verify the page is completely loaded. |
logout |
Log out. |
wait_until_loaded |
Wait until the page is loaded completely. |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
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 | |
__getattribute__
__getattribute__(name: str) -> None
Take a screenshot and save to a folder upon TimeoutException.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
the attribute |
required |
Returns:
| Type | Description |
|---|---|
related to the attribute
|
the attribute value |
Raises:
| Type | Description |
|---|---|
TimeoutException
|
if the attr was not found |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
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 | |
click_networking_submenu
click_networking_submenu(element: WebElement) -> None
Ckick on WAN menu option.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
WebElement
|
the element to click |
required |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
115 116 117 118 119 120 121 122 123 124 | |
is_page_loaded
is_page_loaded(_driver: WebDriver | EventFiringWebDriver) -> bool
Verify the page is completely loaded.
Must be overridden in the derived class!
Raises:
| Type | Description |
|---|---|
AttributeError
|
if not overriden |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
102 103 104 105 106 107 108 109 110 111 112 113 | |
logout
logout() -> None
Log out.
All the pages derived from the POM have logged in!
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
126 127 128 129 130 131 132 | |
wait_until_loaded
wait_until_loaded(timeout: int | None = None) -> bool
Wait until the page is loaded completely.
Generic method to wait upto fluent_wait time or upto timeout specified by the user until the page is loaded and return the status
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
int | None
|
timeout in seconds to load the page, defaults to None |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if page is loaded, Otherwise False |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
89 90 91 92 93 94 95 96 97 98 99 100 | |
wan
PrplOS GUI WAN Page.
Classes:
| Name | Description |
|---|---|
WANPage |
Page Object for WAN page. |
WANPage
WANPage(
driver: WebDriver | EventFiringWebDriver,
gw_ip: str | IPv4Address,
fluent_wait: int = 20,
)
Page Object for WAN page.
Initialize WANPage POM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
WebDriver | EventFiringWebDriver
|
webdriver instance |
required |
gw_ip
|
str | IPv4Address
|
gateway ip address |
required |
fluent_wait
|
int
|
timeout in seconds to load the page, defaults to 20 |
20
|
Methods:
| Name | Description |
|---|---|
__getattribute__ |
Take a screenshot and save to a folder upon TimeoutException. |
click_networking_submenu |
Ckick on WAN menu option. |
is_page_loaded |
Verify the home page is completely loaded. |
logout |
Log out. |
wait_until_loaded |
Wait until the page is loaded completely. |
Attributes:
| Name | Type | Description |
|---|---|---|
networking_wan_header |
WebElement
|
The WAN header element. |
Source code in boardfarm3/lib/gui/prplos/pages/wan.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
networking_wan_header
property
networking_wan_header: WebElement
The WAN header element.
Returns:
| Type | Description |
|---|---|
WebElement
|
the web element |
Raises:
| Type | Description |
|---|---|
NoSuchElementException
|
if the correct header is not found |
__getattribute__
__getattribute__(name: str) -> None
Take a screenshot and save to a folder upon TimeoutException.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
the attribute |
required |
Returns:
| Type | Description |
|---|---|
related to the attribute
|
the attribute value |
Raises:
| Type | Description |
|---|---|
TimeoutException
|
if the attr was not found |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
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 | |
click_networking_submenu
click_networking_submenu(element: WebElement) -> None
Ckick on WAN menu option.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
WebElement
|
the element to click |
required |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
115 116 117 118 119 120 121 122 123 124 | |
is_page_loaded
is_page_loaded(driver: WebDriver | EventFiringWebDriver) -> bool
Verify the home page is completely loaded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
WebDriver | EventFiringWebDriver
|
webdriver instance |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if home page is loaded, Otherwise False |
Source code in boardfarm3/lib/gui/prplos/pages/wan.py
51 52 53 54 55 56 57 58 59 60 61 | |
logout
logout() -> None
Log out.
All the pages derived from the POM have logged in!
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
126 127 128 129 130 131 132 | |
wait_until_loaded
wait_until_loaded(timeout: int | None = None) -> bool
Wait until the page is loaded completely.
Generic method to wait upto fluent_wait time or upto timeout specified by the user until the page is loaded and return the status
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
int | None
|
timeout in seconds to load the page, defaults to None |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if page is loaded, Otherwise False |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
89 90 91 92 93 94 95 96 97 98 99 100 | |
wifi
PrplOS GUI WiFi Page.
Classes:
| Name | Description |
|---|---|
WiFiPage |
Page Object for WiFi page. |
WiFiPage
WiFiPage(
driver: WebDriver | EventFiringWebDriver,
gw_ip: str | IPv4Address,
fluent_wait: int = 20,
)
Page Object for WiFi page.
Initialize WiFiPage POM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
WebDriver | EventFiringWebDriver
|
webdriver instance |
required |
gw_ip
|
str | IPv4Address
|
gateway ip address |
required |
fluent_wait
|
int
|
timeout in seconds to load the page, defaults to 20 |
20
|
Methods:
| Name | Description |
|---|---|
__getattribute__ |
Take a screenshot and save to a folder upon TimeoutException. |
click_networking_submenu |
Ckick on WAN menu option. |
is_page_loaded |
Verify the home page is completely loaded. |
logout |
Log out. |
wait_until_loaded |
Wait until the page is loaded completely. |
Attributes:
| Name | Type | Description |
|---|---|---|
networking_wifi_header |
WebElement
|
The WiFi header element. |
Source code in boardfarm3/lib/gui/prplos/pages/wifi.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
networking_wifi_header
property
networking_wifi_header: WebElement
The WiFi header element.
Returns:
| Type | Description |
|---|---|
WebElement
|
the web element |
Raises:
| Type | Description |
|---|---|
NoSuchElementException
|
if not found |
__getattribute__
__getattribute__(name: str) -> None
Take a screenshot and save to a folder upon TimeoutException.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
the attribute |
required |
Returns:
| Type | Description |
|---|---|
related to the attribute
|
the attribute value |
Raises:
| Type | Description |
|---|---|
TimeoutException
|
if the attr was not found |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
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 | |
click_networking_submenu
click_networking_submenu(element: WebElement) -> None
Ckick on WAN menu option.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
WebElement
|
the element to click |
required |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
115 116 117 118 119 120 121 122 123 124 | |
is_page_loaded
is_page_loaded(driver: WebDriver | EventFiringWebDriver) -> bool
Verify the home page is completely loaded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
WebDriver | EventFiringWebDriver
|
webdriver instance |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if home page is loaded |
Source code in boardfarm3/lib/gui/prplos/pages/wifi.py
51 52 53 54 55 56 57 58 59 60 61 | |
logout
logout() -> None
Log out.
All the pages derived from the POM have logged in!
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
126 127 128 129 130 131 132 | |
wait_until_loaded
wait_until_loaded(timeout: int | None = None) -> bool
Wait until the page is loaded completely.
Generic method to wait upto fluent_wait time or upto timeout specified by the user until the page is loaded and return the status
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
int | None
|
timeout in seconds to load the page, defaults to None |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if page is loaded, Otherwise False |
Source code in boardfarm3/lib/gui/prplos/pages/prplos_base_pom.py
89 90 91 92 93 94 95 96 97 98 99 100 | |
hal
Hardware abstraction layers for different CPE components.
Modules:
| Name | Description |
|---|---|
cpe_wifi |
CPE WiFi HAL class. |
cpe_wifi
CPE WiFi HAL class.
Classes:
| Name | Description |
|---|---|
WiFiHal |
Contain CPE Wi-Fi software methods. |
WiFiHal
Contain CPE Wi-Fi software methods.
Methods:
| Name | Description |
|---|---|
enable_wifi |
Use Wifi Hal API to enable the wifi if not already enabled. |
get_bssid |
Get the wifi Basic Service Set Identifier. |
get_passphrase |
Get the passphrase for a network on an interface. |
get_ssid |
Get the wifi ssid for the wlan client with specific network and band. |
is_wifi_enabled |
Check if specific wifi is enabled. |
Attributes:
| Name | Type | Description |
|---|---|---|
wlan_ifaces |
dict[str, dict[str, str]]
|
Get all the wlan interfaces on board. |
wlan_ifaces
abstractmethod
property
wlan_ifaces: dict[str, dict[str, str]]
Get all the wlan interfaces on board.
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, str]]
|
interfaces e.g. private/guest/community |
enable_wifi
abstractmethod
Use Wifi Hal API to enable the wifi if not already enabled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
network type(private/guest/community) |
required |
|
str
|
wifi band(5/2.4 GHz) |
required |
Returns:
| Type | Description |
|---|---|
tuple[str, str, str]
|
tuple of ssid,bssid,passphrase |
Source code in boardfarm3/lib/hal/cpe_wifi.py
71 72 73 74 75 76 77 78 79 80 81 82 | |
get_bssid
abstractmethod
Get the wifi Basic Service Set Identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
network type(private/guest/community) |
required |
|
str
|
wifi band(5/2.4 GHz) |
required |
Returns:
| Type | Description |
|---|---|
Optional[str]
|
MAC physical address of the access point |
Source code in boardfarm3/lib/hal/cpe_wifi.py
34 35 36 37 38 39 40 41 42 43 44 45 | |
get_passphrase
abstractmethod
get_passphrase(iface: str) -> str
Get the passphrase for a network on an interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
name of the interface |
required |
Returns:
| Type | Description |
|---|---|
str
|
encrypted password for a network |
Source code in boardfarm3/lib/hal/cpe_wifi.py
47 48 49 50 51 52 53 54 55 56 | |
get_ssid
abstractmethod
Get the wifi ssid for the wlan client with specific network and band.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
network type(private/guest/community) |
required |
|
str
|
wifi band(5/2.4 GHz) |
required |
Returns:
| Type | Description |
|---|---|
Optional[str]
|
SSID of the WiFi for a given network type and band |
Source code in boardfarm3/lib/hal/cpe_wifi.py
21 22 23 24 25 26 27 28 29 30 31 32 | |
is_wifi_enabled
abstractmethod
is_wifi_enabled(network_type: str, band: str) -> bool
Check if specific wifi is enabled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
network type(private/guest/community) |
required |
|
str
|
wifi band(5/2.4 GHz) |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if enabled, False otherwise |
Source code in boardfarm3/lib/hal/cpe_wifi.py
58 59 60 61 62 63 64 65 66 67 68 69 | |
interactive_shell
Boardfarm interactive shell module.
Classes:
| Name | Description |
|---|---|
OptionsTable |
Boardfarm interactive console options table. |
Functions:
| Name | Description |
|---|---|
get_interactive_console_options |
Return options table with all boardfarm interactive shell options. |
OptionsTable
OptionsTable(title: str | None = None)
Boardfarm interactive console options table.
Initialize the OptionsTable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
title of the table, defaults to None |
None
|
Methods:
| Name | Description |
|---|---|
add_column |
Add a table column. |
add_option |
Add an action item to the table. |
show_table |
Show table and perform actions based on user input. |
Source code in boardfarm3/lib/interactive_shell.py
36 37 38 39 40 41 42 43 44 45 46 47 48 | |
add_column
add_column(
name: str,
justify: JustifyMethod | None = None,
style: str | None = None,
width: int | None = None,
) -> None
Add a table column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
name of the column |
required |
|
JustifyMethod | None
|
column content position, defaults to None |
None
|
|
str | None
|
table content style, defaults to None |
None
|
|
int | None
|
column width, defaults to None |
None
|
Source code in boardfarm3/lib/interactive_shell.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
add_option
add_option(
column_data: tuple[str, ...],
function: Callable,
args: tuple[Any, ...],
kwargs: dict[str, Any],
) -> None
Add an action item to the table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
tuple[str, ...]
|
table column data |
required |
|
Callable
|
function to be called for this option |
required |
|
tuple[Any, ...]
|
positional arguments to the function |
required |
|
dict[str, Any]
|
keyword arguments to the function |
required |
Source code in boardfarm3/lib/interactive_shell.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
show_table
show_table(exit_option: str, exit_option_description: str) -> None
Show table and perform actions based on user input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
exit option name |
required |
|
str
|
exit option description |
required |
Source code in boardfarm3/lib/interactive_shell.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
get_interactive_console_options
get_interactive_console_options(
device_manager: DeviceManager, cmdline_args: Namespace
) -> OptionsTable
Return options table with all boardfarm interactive shell options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DeviceManager
|
device manager instance |
required |
|
Namespace
|
command line arguments |
required |
Returns:
| Type | Description |
|---|---|
OptionsTable
|
option table with boardfarm interactive shell options |
Source code in boardfarm3/lib/interactive_shell.py
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 | |
mibs_compiler
MIBs to JSON compiler module.
Classes:
| Name | Description |
|---|---|
MibsCompiler |
MIBs to JSON compiler class. |
MibsCompiler
MibsCompiler(mibs_dirs: list[str])
MIBs to JSON compiler class.
Initialize MIBs to JSON compiler.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[str]
|
mibs directories |
required |
Methods:
| Name | Description |
|---|---|
get_mib_oid |
Get OID of given MIB. |
Source code in boardfarm3/lib/mibs_compiler.py
23 24 25 26 27 28 29 | |
get_mib_oid
get_mib_oid(mib_name: str) -> str
Get OID of given MIB.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
MIB name |
required |
Returns:
| Type | Description |
|---|---|
str
|
OID of the given MIB |
Raises:
| Type | Description |
|---|---|
ValueError
|
when unable to find given mib |
Source code in boardfarm3/lib/mibs_compiler.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
multicast
Multicast library.
Classes:
| Name | Description |
|---|---|
IPerfResult |
Store results of IPerf server session. |
IPerfSession |
Store details of IPerf session. |
IPerfStream |
Store details of IPerf stream. |
Multicast |
Multicast device component. |
MulticastGroupRecordType |
IGMPv3 Record Types. |
IPerfResult
dataclass
IPerfResult(_data: DataFrame | None)
Store results of IPerf server session.
Attributes:
| Name | Type | Description |
|---|---|---|
bandwidth |
str | None
|
Return resultant bandwidth in Mbps. |
result |
DataFrame | None
|
Return the entire result as a dataframe. |
total_loss |
str | None
|
Return no. of datagrams lost. |
bandwidth
property
bandwidth: str | None
Return resultant bandwidth in Mbps.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
resultant bandwidth, None if iperf failed |
result
property
result: DataFrame | None
Return the entire result as a dataframe.
Returns:
| Type | Description |
|---|---|
Optional[pandas.DataFrame]
|
iperf result in tablular format, None if iperf failed |
total_loss
property
total_loss: str | None
Return no. of datagrams lost.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
resultant total loss, None if iperf failed |
IPerfSession
dataclass
IPerfSession(device: IperfDevice, pid: str, address: str, port: int, output_file: str)
Store details of IPerf session.
IPerfStream
dataclass
IPerfStream(
device: IperfDevice,
pid: str,
address: str,
port: int,
output_file: str,
time: int = 0,
)
Store details of IPerf stream.
Multicast
Multicast(
device_name: str, iface_dut: str, console: BoardfarmPexpect, shell_prompt: list[str]
)
Multicast device component.
Initialize multicast component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
device name |
required |
|
str
|
DUT interface name |
required |
|
BoardfarmPexpect
|
console instance of the device |
required |
|
list[str]
|
shell prompt patterns |
required |
Methods:
| 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_sessions |
Kill all iperf sessions. |
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. |
send_igmpv3_report |
Send an IGMPv3 report with desired multicast record. |
send_mldv2_report |
Send an MLDv2 report with desired multicast record. |
start_iperf_multicast_stream |
Start an iperf client sending data on multicast address in background. |
wait_for_multicast_stream_to_end |
Wait for all multicast streams to end. |
Attributes:
| Name | Type | Description |
|---|---|---|
gateway_mac_addr |
str
|
Return the L2 address of DUT gateway from ARP table. |
Source code in boardfarm3/lib/multicast.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
gateway_mac_addr
property
gateway_mac_addr: str
Return the L2 address of DUT gateway from ARP table.
Returns:
| Type | Description |
|---|---|
str
|
MAC address in string format. |
join_iperf_multicast_asm_group
join_iperf_multicast_asm_group(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) # noqa: RST213 - false positive
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 |
|---|---|---|---|
|
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 |
Source code in boardfarm3/lib/multicast.py
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 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | |
join_iperf_multicast_ssm_group
join_iperf_multicast_ssm_group(
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 |
|---|---|---|---|
|
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 |
Source code in boardfarm3/lib/multicast.py
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 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 | |
kill_all_iperf_sessions
kill_all_iperf_sessions() -> None
Kill all iperf sessions.
Source code in boardfarm3/lib/multicast.py
134 135 136 137 138 | |
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 results object |
Raises:
| Type | Description |
|---|---|
MulticastError
|
when iperf session deosn't exit |
Source code in boardfarm3/lib/multicast.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 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | |
parse_mcast_trace
parse_mcast_trace(
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 assists in validating statements from the 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 |
|---|---|---|---|
|
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 |
Raises:
| Type | Description |
|---|---|
ValueError
|
when given ip version is invalid |
Source code in boardfarm3/lib/multicast.py
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 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 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | |
send_igmpv3_report
send_igmpv3_report(mcast_group_record: MulticastGroupRecord, count: int) -> None
Send an IGMPv3 report with desired multicast record.
Multicast source and group must be IPv4 addresses. Multicast sources need to be non-multicast addresses and group address needs to be a multicast address.
Implementation relies on a custom send_igmp_report script based on scapy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
MulticastGroupRecord
|
IGMPv3 multicast group record |
required |
|
int
|
num of packets to send in 1s interval |
required |
Raises:
| Type | Description |
|---|---|
MulticastError
|
when failed to execute send_mld_report command |
Source code in boardfarm3/lib/multicast.py
589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | |
send_mldv2_report
send_mldv2_report(mcast_group_record: MulticastGroupRecord, count: int) -> None
Send an MLDv2 report with desired multicast record.
Multicast source and group must be IPv6 addresses. Multicast sources need to be non-multicast addresses and group address needs to be a multicast address.
Implementation relies on a custom send_mld_report script based on scapy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
MulticastGroupRecord
|
MLDv2 multicast group record |
required |
|
int
|
num of packets to send in 1s interval |
required |
Raises:
| Type | Description |
|---|---|
MulticastError
|
when failed to execute send_mld_report command |
Source code in boardfarm3/lib/multicast.py
617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 | |
start_iperf_multicast_stream
start_iperf_multicast_stream(
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 |
|---|---|---|---|
|
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. |
Source code in boardfarm3/lib/multicast.py
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 550 551 | |
wait_for_multicast_stream_to_end
wait_for_multicast_stream_to_end(iperf_stream: 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 |
|---|---|---|---|
|
IPerfStream
|
iperf stream instance |
required |
Raises:
| Type | Description |
|---|---|
MulticastError
|
when multicast stream doesn't exit within given time |
Source code in boardfarm3/lib/multicast.py
553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 | |
MulticastGroupRecordType
IGMPv3 Record Types.
network_utils
Network utilities module.
Classes:
| Name | Description |
|---|---|
NetworkUtility |
Network utilities. |
NetworkUtility
NetworkUtility(console: BoardfarmPexpect)
Network utilities.
Initialize the network utility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
BoardfarmPexpect
|
console instance which has network utilities |
required |
Methods:
| Name | Description |
|---|---|
gen_uuid |
Generate unique identifier. |
netstat |
Perform netstat with given options. |
read_tcpdump |
Read tcpdump packets and delete the pcap file afterwards. |
scp |
Copy file between this device and the remote host. |
start_tcpdump |
Start tcpdump capture on given interface. |
stop_tcpdump |
Stop tcpdump process with given process id. |
tftp |
Transfer file via tftp. |
traceroute_host |
Run traceroute to given host ip and return result. |
Source code in boardfarm3/lib/network_utils.py
25 26 27 28 29 30 31 | |
gen_uuid
gen_uuid() -> str
Generate unique identifier.
Returns:
| Type | Description |
|---|---|
str
|
uuid |
Source code in boardfarm3/lib/network_utils.py
181 182 183 184 185 186 187 | |
netstat
netstat(opts: str = '', extra_opts: str = '') -> DataFrame
Perform netstat with given options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command line options |
''
|
|
str
|
extra command line options |
''
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
parsed netstat output |
Source code in boardfarm3/lib/network_utils.py
33 34 35 36 37 38 39 40 41 42 43 44 45 | |
read_tcpdump
read_tcpdump(
capture_file: str,
protocol: str = "",
opts: str = "",
timeout: int = 30,
rm_pcap: bool = True,
) -> str
Read tcpdump packets and delete the pcap file afterwards.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
tcpdump pcap file path |
required |
|
str
|
protocol to the filter |
''
|
|
str
|
command line options to tcpdump |
''
|
|
int
|
timeout for reading the tcpdump output |
30
|
|
bool
|
remove pcap file after read |
True
|
Returns:
| Type | Description |
|---|---|
str
|
tcpdump output |
Source code in boardfarm3/lib/network_utils.py
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 | |
scp
scp(
ip: str,
port: int | str,
user: str,
pwd: str,
source_path: str,
dest_path: str,
action: Literal["download", "upload"],
) -> None
Copy file between this device and the remote host.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
ip address of the remote host |
required |
|
int | str
|
port number of the remote host |
required |
|
str
|
username of the host |
required |
|
str
|
password of the host |
required |
|
str
|
source file path |
required |
|
str
|
destination path |
required |
|
Literal['download', 'upload']
|
scp action(download/upload) |
required |
Source code in boardfarm3/lib/network_utils.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 | |
start_tcpdump
Start tcpdump capture on given interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
tcpdump output file name |
required |
|
str
|
interface name to be captured |
required |
|
dict | None
|
filters as key value pair(eg: {"-v": "", "-c": "4"}) default to None |
None
|
Returns:
| Type | Description |
|---|---|
str
|
return the process id of the tcpdump capture |
Source code in boardfarm3/lib/network_utils.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
stop_tcpdump
stop_tcpdump(pid: str) -> None
Stop tcpdump process with given process id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
tcpdump process id |
required |
Source code in boardfarm3/lib/network_utils.py
64 65 66 67 68 69 70 | |
tftp
tftp(tftp_server_ip: str, source_file: str, dest_file: str, timeout: int = 60) -> None
Transfer file via tftp.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
|
tftp_server_ip
|
tftp server ip |
required |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
Unable to find the source file |
Source code in boardfarm3/lib/network_utils.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
traceroute_host
Run traceroute to given host ip and return result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
ip address of the host |
required |
|
str
|
ip address version |
''
|
|
str
|
command line options to traceroute |
''
|
Returns:
| Type | Description |
|---|---|
str
|
output of traceroute |
Source code in boardfarm3/lib/network_utils.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
networking
Boardfarm networking module.
Classes:
| Name | Description |
|---|---|
DNS |
Holds DNS names and their addresses. |
HTTPResult |
Class to save the object of parsed HTTP response. |
IptablesFirewall |
Linux iptables firewall. |
NSLookup |
NSLookup command line utility. |
Functions:
| Name | Description |
|---|---|
dns_lookup |
Perform |
http_get |
Peform http get (via curl) and return parsed result. |
is_link_up |
Check given interface is up or not. |
nmap |
Run an nmap scan from source to destination device. |
scp |
SCP file. |
start_tcpdump |
Start tcpdump capture on given interface. |
stop_tcpdump |
Stop tcpdump capture. |
tcpdump_read |
Read the given tcpdump and delete the file afterwards. |
traceroute_host |
Traceroute given host ip and return the details. |
DNS
DNS(
console: _LinuxConsole,
device_name: str,
ipv4_address: str | None = None,
ipv6_address: str | None = None,
ipv4_aux_address: IPv4Address | None = None,
ipv6_aux_address: IPv6Address | None = None,
aux_url: str | None = None,
)
Holds DNS names and their addresses.
Initialize DNS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_LinuxConsole
|
console or device instance |
required |
|
str
|
device name |
required |
|
str | None
|
ipv4 address of the device |
None
|
|
str | None
|
ipv6 address of the device |
None
|
|
IPv4Address | None
|
ipv4 aux address |
None
|
|
IPv6Address | None
|
ipv6 aux address |
None
|
|
str | None
|
aux url |
None
|
Methods:
| Name | Description |
|---|---|
configure_hosts |
Create the given number of reachable and unreachable ACS domain IP's. |
Source code in boardfarm3/lib/networking.py
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 | |
configure_hosts
configure_hosts(
reachable_ipv4: int,
unreachable_ipv4: int,
reachable_ipv6: int,
unreachable_ipv6: int,
) -> None
Create the given number of reachable and unreachable ACS domain IP's.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
no.of reachable IPv4 address for acs url |
required |
|
int
|
no.of unreachable IPv4 address for acs url |
required |
|
int
|
no.of reachable IPv6 address for acs url |
required |
|
int
|
no.of unreachable IPv6 address for acs url |
required |
Source code in boardfarm3/lib/networking.py
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 | |
HTTPResult
HTTPResult(response: str)
Class to save the object of parsed HTTP response.
Parse the response and save it as an instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
response from HTTP request |
required |
Source code in boardfarm3/lib/networking.py
565 566 567 568 569 570 571 572 | |
IptablesFirewall
IptablesFirewall(console: _LinuxConsole)
Linux iptables firewall.
Initialize IptablesFirewall.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_LinuxConsole
|
linux console or device instance |
required |
Methods:
| Name | Description |
|---|---|
add_drop_rule_ip6tables |
Add drop rule to ip6tables. |
add_drop_rule_iptables |
Add drop rule to iptables. |
del_drop_rule_ip6tables |
Delete drop rule from ip6tables. |
del_drop_rule_iptables |
Delete drop rule from iptables. |
get_ip6tables_list |
Return ip6tables rules as dictionary. |
get_ip6tables_policy |
Return ip6tables policies as dictionary. |
get_iptables_list |
Return iptables rules as dictionary. |
get_iptables_policy |
Return iptables policies as dictionary. |
is_ip6table_empty |
Return True if ip6tables is empty. |
is_iptable_empty |
Return True if iptables is empty. |
Source code in boardfarm3/lib/networking.py
240 241 242 243 244 245 246 | |
add_drop_rule_ip6tables
Add drop rule to ip6tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
ip6tables command line options |
required |
|
str
|
ip to be blocked from device |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
on given ip6tables rule can't be added |
Source code in boardfarm3/lib/networking.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | |
add_drop_rule_iptables
Add drop rule to iptables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
iptables command line options |
required |
|
str
|
ip to be blocked from device |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
on given iptables rule can't be added |
Source code in boardfarm3/lib/networking.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | |
del_drop_rule_ip6tables
Delete drop rule from ip6tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
ip6tables command line options |
required |
|
str
|
ip to be unblocked |
required |
Source code in boardfarm3/lib/networking.py
404 405 406 407 408 409 410 411 412 | |
del_drop_rule_iptables
Delete drop rule from iptables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
iptables command line options |
required |
|
str
|
ip to be unblocked |
required |
Source code in boardfarm3/lib/networking.py
394 395 396 397 398 399 400 401 402 | |
get_ip6tables_list
get_ip6tables_list(opts: str = '', extra_opts: str = '') -> dict[str, list[dict]]
Return ip6tables rules as dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command line arguments for ip6tables command |
''
|
|
str
|
extra command line arguments for ip6tables command |
''
|
Returns:
| Type | Description |
|---|---|
Dict[str, List[Dict]]
|
ip6tables rules dictionary |
Source code in boardfarm3/lib/networking.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | |
get_ip6tables_policy
get_ip6tables_policy(
opts: str = "", extra_opts: str = "-nvL --line-number"
) -> dict[str, str]
Return ip6tables policies as dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command line arguments for iptables command |
''
|
|
str
|
options for iptables command, defaults to -nvL --line-number |
'-nvL --line-number'
|
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
iptables policies dictionary |
Source code in boardfarm3/lib/networking.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | |
get_iptables_list
get_iptables_list(opts: str = '', extra_opts: str = '') -> dict[str, list[dict]]
Return iptables rules as dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command line arguments for iptables command |
''
|
|
str
|
extra command line arguments for iptables command |
''
|
Returns:
| Type | Description |
|---|---|
Dict[str, List[Dict]]
|
iptables rules dictionary |
Source code in boardfarm3/lib/networking.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | |
get_iptables_policy
get_iptables_policy(
opts: str = "", extra_opts: str = "-nvL --line-number"
) -> dict[str, str]
Return iptables policies as dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command line arguments for iptables command |
''
|
|
str
|
options for iptables command, defaults to -nvL --line-number |
'-nvL --line-number'
|
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
iptables policies dictionary |
Source code in boardfarm3/lib/networking.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | |
is_ip6table_empty
is_ip6table_empty(opts: str = '', extra_opts: str = '') -> bool
Return True if ip6tables is empty.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command line arguments for ip6tables command |
''
|
|
str
|
extra command line arguments for ip6tables command |
''
|
Returns:
| Type | Description |
|---|---|
bool
|
True if ip6tables is empty, False otherwise |
Source code in boardfarm3/lib/networking.py
332 333 334 335 336 337 338 339 340 341 342 | |
is_iptable_empty
is_iptable_empty(opts: str = '', extra_opts: str = '') -> bool
Return True if iptables is empty.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
command line arguments for iptables command |
''
|
|
str
|
extra command line arguments for iptables command |
''
|
Returns:
| Type | Description |
|---|---|
bool
|
True if iptables is empty, False otherwise |
Source code in boardfarm3/lib/networking.py
266 267 268 269 270 271 272 273 274 275 276 | |
NSLookup
NSLookup(console: _LinuxConsole)
NSLookup command line utility.
Initialize NSLookup.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_LinuxConsole
|
console or device instance |
required |
Methods:
| Name | Description |
|---|---|
__call__ |
Run nslookup with given arguments and return the parsed results. |
nslookup |
Run nslookup with given arguments and return the parsed results. |
Source code in boardfarm3/lib/networking.py
418 419 420 421 422 423 424 | |
__call__
__call__(domain_name: str, opts: str = '', extra_opts: str = '') -> dict[str, Any]
Run nslookup with given arguments and return the parsed results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
domain name to perform nslookup on |
required |
|
str
|
nslookup command line options |
''
|
|
str
|
nslookup additional command line options |
''
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
parsed nslookup results as dictionary |
Source code in boardfarm3/lib/networking.py
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | |
nslookup
nslookup(domain_name: str, opts: str = '', extra_opts: str = '') -> dict[str, Any]
Run nslookup with given arguments and return the parsed results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
domain name to perform nslookup on |
required |
|
str
|
nslookup command line options |
''
|
|
str
|
nslookup additional command line options |
''
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
parsed nslookup results as dictionary |
Source code in boardfarm3/lib/networking.py
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 | |
dns_lookup
dns_lookup(
console: _LinuxConsole, domain_name: str, record_type: str, opts: str = ""
) -> list[dict[str, Any]]
Perform dig command in the devices to resolve DNS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_LinuxConsole
|
console or device instance |
required |
|
str
|
domain name which needs lookup |
required |
|
str
|
AAAA for ipv6 else A |
required |
|
str
|
options to be provided to dig command, defaults to "" |
''
|
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
parsed dig command ouput |
Source code in boardfarm3/lib/networking.py
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 | |
http_get
http_get(
console: _LinuxConsole, url: str, timeout: int = 20, options: str = ""
) -> HTTPResult
Peform http get (via curl) and return parsed result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_LinuxConsole
|
console or device instance |
required |
|
str
|
url to get the response |
required |
|
int
|
connection timeout for the curl command in seconds |
20
|
|
str
|
additional curl command line options, defaults to "" |
''
|
Returns:
| Type | Description |
|---|---|
HTTPResult
|
parsed http response |
Source code in boardfarm3/lib/networking.py
597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | |
is_link_up
is_link_up(
console: _LinuxConsole, interface: str, pattern: str = "BROADCAST,MULTICAST,UP"
) -> bool
Check given interface is up or not.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_LinuxConsole
|
console or device instance |
required |
|
str
|
interface name, defaults to "BROADCAST,MULTICAST,UP" |
required |
|
str
|
interface state |
'BROADCAST,MULTICAST,UP'
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the link is up |
Source code in boardfarm3/lib/networking.py
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 | |
nmap
nmap(
source_device: LAN | WLAN | WAN,
destination_device: LAN | WLAN | WAN | CPE,
ip_type: str,
port: str | int | None = None,
protocol: str | None = None,
max_retries: int | None = None,
min_rate: int | None = None,
opts: str | None = None,
timeout: int = 30,
) -> dict[str, str]
Run an nmap scan from source to destination device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LAN | WLAN | WAN
|
device initiating the scan |
required |
|
LAN | WLAN | WAN | CPE
|
device to be scanned |
required |
|
str
|
IP version to use in scan, must be "ipv4" or "ipv6" |
required |
|
str | int | None
|
port or port range to scan, optional |
None
|
|
str | None
|
protocol to scan (e.g., tcp, udp), optional |
None
|
|
int | None
|
maximum number of retransmissions, optional |
None
|
|
int | None
|
minimum number of packets per second to send, optional |
None
|
|
str | None
|
additional nmap command-line options, optional |
None
|
|
int
|
timeout value for the scan (in seconds), defaults to 30 |
30
|
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
parsed nmap scan result as a dictionary |
Source code in boardfarm3/lib/networking.py
660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 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 703 704 705 706 707 708 709 710 711 | |
scp
scp(
console: _LinuxConsole,
host: str,
port: int | str,
username: str,
password: str,
src_path: str,
dst_path: str,
action: Literal["download", "upload"] = "download",
timeout: int = 30,
) -> None
SCP file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_LinuxConsole
|
linux device or console instance |
required |
|
str
|
remote ssh host ip address |
required |
|
int | str
|
remove ssh host port number |
required |
|
str
|
ssh username |
required |
|
str
|
ssh password |
required |
|
str
|
source file path |
required |
|
str
|
destination path |
required |
|
Literal['download', 'upload']
|
scp action(download/upload), defaults to "download" |
'download'
|
|
int
|
scp timeout in seconds, defaults to 30 |
30
|
Raises:
| Type | Description |
|---|---|
SCPConnectionError
|
on failed to scp file |
Source code in boardfarm3/lib/networking.py
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 | |
start_tcpdump
start_tcpdump(
console: _LinuxConsole,
interface: str,
port: str | None,
output_file: str = "pkt_capture.pcap",
filters: dict | None = None,
additional_filters: str | None = "",
) -> str
Start tcpdump capture on given interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_LinuxConsole
|
console or device instance |
required |
|
str
|
inteface name where packets to be captured |
required |
|
str | None
|
port number, can be a range of ports(eg: 443 or 433-443) |
required |
|
str
|
pcap file name, Defaults: pkt_capture.pcap |
'pkt_capture.pcap'
|
|
dict | None
|
filters as key value pair(eg: {"-v": "", "-c": "4"}) |
None
|
|
str | None
|
additional filters |
''
|
Returns:
| Type | Description |
|---|---|
str
|
console ouput and tcpdump process id |
Raises:
| Type | Description |
|---|---|
ValueError
|
on failed to start tcpdump |
Source code in boardfarm3/lib/networking.py
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 | |
stop_tcpdump
stop_tcpdump(console: _LinuxConsole, process_id: str) -> None
Stop tcpdump capture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_LinuxConsole
|
linux console or device instance |
required |
|
str
|
tcpdump process id |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
on failed to stop tcpdump process |
Source code in boardfarm3/lib/networking.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
tcpdump_read
tcpdump_read(
console: _LinuxConsole,
capture_file: str,
protocol: str = "",
opts: str = "",
timeout: int = 30,
rm_pcap: bool = True,
) -> str
Read the given tcpdump and delete the file afterwards.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_LinuxConsole
|
linux device or console instance |
required |
|
str
|
pcap file path |
required |
|
str
|
protocol to the filter |
''
|
|
str
|
command line options for reading pcap |
''
|
|
int
|
timeout in seconds for reading pcap |
30
|
|
bool
|
romove pcap file afterwards |
True
|
Returns:
| Type | Description |
|---|---|
str
|
tcpdump output |
Source code in boardfarm3/lib/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 | |
traceroute_host
traceroute_host(
console: _LinuxConsole, host_ip: str, version: str = "", options: str = ""
) -> str
Traceroute given host ip and return the details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_LinuxConsole
|
linux device or console instance |
required |
|
str
|
host ip address |
required |
|
str
|
ip version |
''
|
|
str
|
additional command line options |
''
|
Returns:
| Type | Description |
|---|---|
str
|
traceroute command output |
Source code in boardfarm3/lib/networking.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
odh
Boardfarm ODH client Package.
Modules:
| Name | Description |
|---|---|
kafka_client |
Kafka client implementation. |
kafka_client
Kafka client implementation.
Classes:
| Name | Description |
|---|---|
KafkaClient |
Kafka client implementation. |
KafkaClient
KafkaClient(bootstrap_server: str, topic_name: str)
Kafka client implementation.
Initialize the kafka client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Kafka server url |
required |
|
str
|
the topic to subscribe to |
required |
Methods:
| Name | Description |
|---|---|
close_connection_to_kafka |
Gracefully close the connection to the kafka server. |
consume_logs |
Consume logs from the kafka queue for a particular duration. |
consume_sw_update_logs |
Consume logs from the kafka queue for given time using offsets. |
read_kafka_messages |
Read a given number of messages from the kafka queue. |
subscribe_to_topic |
Subscribe to a list topics. |
Source code in boardfarm3/lib/odh/kafka_client.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
close_connection_to_kafka
close_connection_to_kafka() -> None
Gracefully close the connection to the kafka server.
Source code in boardfarm3/lib/odh/kafka_client.py
132 133 134 | |
consume_logs
consume_logs(time_period: int) -> list[Any]
Consume logs from the kafka queue for a particular duration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
time (in s) for which to consume logs from the queue. |
required |
Returns:
| Type | Description |
|---|---|
list[Any]
|
kafka logs |
Source code in boardfarm3/lib/odh/kafka_client.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
consume_sw_update_logs
consume_sw_update_logs(start_time: float, end_time: float) -> list[Any]
Consume logs from the kafka queue for given time using offsets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
float
|
start time to fetch logs |
required |
|
float
|
end time to fetch logs |
required |
Returns:
| Type | Description |
|---|---|
list[Any]
|
kafka logs |
Raises:
| Type | Description |
|---|---|
OffsetOutOfRangeError
|
if offset does not exist |
Source code in boardfarm3/lib/odh/kafka_client.py
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 | |
read_kafka_messages
read_kafka_messages(num_messages: int) -> list[Any]
Read a given number of messages from the kafka queue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
The number of messages to be read from the kafka queue |
required |
Returns:
| Type | Description |
|---|---|
list[Any]
|
list of telemetry logs |
Source code in boardfarm3/lib/odh/kafka_client.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
subscribe_to_topic
subscribe_to_topic(topics: list[str]) -> None
Subscribe to a list topics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[str]
|
the list of topics to subscribe to |
required |
Raises:
| Type | Description |
|---|---|
UnknownTopicOrPartitionError
|
if a topic does not exist |
Source code in boardfarm3/lib/odh/kafka_client.py
54 55 56 57 58 59 60 61 62 63 64 65 | |
parsers
Linux command output parsers.
Modules:
| Name | Description |
|---|---|
iptables_parser |
Parser module for iptables command output. |
netstat_parser |
Parse netstat command lines output into dataframes. |
nslookup_parser |
nslookup command line utility output parser module. |
iptables_parser
Parser module for iptables command output.
Classes:
| Name | Description |
|---|---|
IptablesParser |
Parse the iptables from table format to dict. |
IptablesParser
Parse the iptables from table format to dict.
Methods:
| Name | Description |
|---|---|
ip6tables |
Return parsed given ip6tables output. |
iptables |
Return parsed given iptables output. |
iptables_policy |
Return the iptables policy. |
ip6tables
ip6tables(ip6_tables: str) -> dict[str, list[dict]]
Return parsed given ip6tables output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
ip6tables command output |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, List[Dict]]
|
parsed ip6tables output in dictionary |
Source code in boardfarm3/lib/parsers/iptables_parser.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 | |
iptables
iptables(ip_tables: str) -> dict[str, list[dict]]
Return parsed given iptables output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
iptables command output |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, List[Dict]]
|
parsed iptables output in dictionary |
Source code in boardfarm3/lib/parsers/iptables_parser.py
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 | |
iptables_policy
iptables_policy(ip_tables: str) -> dict[str, str]
Return the iptables policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
output of iptables command |
required |
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
dict of iptable policy |
Source code in boardfarm3/lib/parsers/iptables_parser.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
netstat_parser
Parse netstat command lines output into dataframes.
Classes:
| Name | Description |
|---|---|
NetstatParser |
Parse netstat command lines output into dataframes. |
NetstatParser
NetstatParser()
Parse netstat command lines output into dataframes.
Initialize the NetstatParser.
Methods:
| Name | Description |
|---|---|
parse_netstat_output |
Parse given netstat output. |
Source code in boardfarm3/lib/parsers/netstat_parser.py
16 17 18 | |
parse_netstat_output
parse_netstat_output(output: str) -> DataFrame
Parse given netstat output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
netstat output |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
parsed netstat output in pandas.DataFrame |
Raises:
| Type | Description |
|---|---|
ValueError
|
on invalid netstat output |
Source code in boardfarm3/lib/parsers/netstat_parser.py
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 | |
nslookup_parser
nslookup command line utility output parser module.
Classes:
| Name | Description |
|---|---|
NslookupParser |
nslookup command line utility output parser module. |
NslookupParser
nslookup command line utility output parser module.
Methods:
| Name | Description |
|---|---|
parse_nslookup_output |
Parse the DNS query response into dict obj. |
parse_nslookup_output
parse_nslookup_output(response: str) -> dict[str, Any]
Parse the DNS query response into dict obj.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
nslookup CLI output |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
parsed nslookup output |
Source code in boardfarm3/lib/parsers/nslookup_parser.py
13 14 15 16 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 | |
power
Power module.
Functions:
| Name | Description |
|---|---|
get_pdu |
Get a PDU object to drive the power of an outlet. |
get_pdu
Get a PDU object to drive the power of an outlet.
Examples of pdu uris: "type://ip[:port]; outlet"
"netio://10.64.40.34; 2"
"px2://10.71.10.53:23; 2",
"px3://10.71.10.53:23; 2",
"eaton://10.71.10.53:23; 2"
more to come....
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
a uri with the PDU details |
required |
Returns:
| Type | Description |
|---|---|
PDU
|
a PDU templated object |
Raises:
| Type | Description |
|---|---|
ValueError
|
if the PDU URI is not recognised |
Source code in boardfarm3/lib/power.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
python_executor
Python executor module.
Classes:
| Name | Description |
|---|---|
PythonExecutor |
Helper to execute python commands over a given Linux console. |
PythonExecutor
PythonExecutor(console: BoardfarmPexpect, shell_prompt: list[str])
Helper to execute python commands over a given Linux console.
Initialise PythonExecutor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
BoardfarmPexpect
|
the console to execute the Python commands on |
required |
|
list[str]
|
the console shell prompt (usually a list of regexs) |
required |
Methods:
| Name | Description |
|---|---|
exit_python |
Exit the Python prompt. |
run |
Run the given Python command. |
Source code in boardfarm3/lib/python_executor.py
14 15 16 17 18 19 20 21 22 23 24 25 26 | |
exit_python
exit_python() -> None
Exit the Python prompt.
Source code in boardfarm3/lib/python_executor.py
57 58 59 60 61 62 63 | |
run
Run the given Python command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
the Python command |
required |
|
str
|
what to expect as output from the command, defaults to "" |
''
|
Returns:
| Type | Description |
|---|---|
str
|
the output of the Python command |
Raises:
| Type | Description |
|---|---|
DeviceConnectionError
|
on execution/connectivity issues |
Source code in boardfarm3/lib/python_executor.py
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 | |
regexlib
Useful regexes library.
shell_prompt
Boardfarm v3 base device shell prompts.
utils
Boardfarm common utilities module.
Functions:
| Name | Description |
|---|---|
disable_logs |
Disable logs for the logger with given name. |
get_nth_mac_address |
Get nth mac address from base mac address. |
get_pytest_name |
Get the test name from the test filename during runtime. |
get_static_ipaddress |
Return the static ip address of the device based on given ip version. |
get_value_from_dict |
Get value of given key from the dictionary recursively. |
ip_pool_to_list |
Generate ip address list based on ip pool boundaries. |
retry |
Retry a function if the output of the function is false. |
retry_on_exception |
Retry a method if any exception occurs. |
disable_logs
disable_logs(logger_name: str | None = None) -> Generator
Disable logs for the logger with given name.
:yield: log with the given name
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
logger name, defaults to None |
None
|
Source code in boardfarm3/lib/utils.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
get_nth_mac_address
get_nth_mac_address(mac_address: str, nth_number: int) -> str
Get nth mac address from base mac address.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
base mac address |
required |
|
int
|
n'th number from base mac address |
required |
Returns:
| Type | Description |
|---|---|
str
|
n'th mac address |
Source code in boardfarm3/lib/utils.py
20 21 22 23 24 25 26 27 | |
get_pytest_name
get_pytest_name() -> str
Get the test name from the test filename during runtime.
Returns:
| Type | Description |
|---|---|
str
|
current test name |
Source code in boardfarm3/lib/utils.py
30 31 32 33 34 35 36 37 38 39 | |
get_static_ipaddress
get_static_ipaddress(config: dict[str, Any], ip_version: str = 'ipv4') -> str | None
Return the static ip address of the device based on given ip version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, Any]
|
device config |
required |
|
str
|
ip version, defaults to "ipv4" |
'ipv4'
|
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the static ip address of the device |
Source code in boardfarm3/lib/utils.py
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 | |
get_value_from_dict
get_value_from_dict(key: str, dictionary: dict) -> Any
Get value of given key from the dictionary recursively.
This method is used to avoid nested checks for None to get a value from dictionary without raising KeyError.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
name of the key |
required |
|
dict
|
dictionary instance |
required |
Returns:
| Type | Description |
|---|---|
Any
|
value of given key if exists, otherwise None |
Source code in boardfarm3/lib/utils.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
ip_pool_to_list
Generate ip address list based on ip pool boundaries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
IPv4Address
|
first ip of the pool |
required |
|
IPv4Address
|
last ip of the pool |
required |
Returns:
| Type | Description |
|---|---|
list[IPv4Address]
|
list of ip addresses based on min ip address and maximum ip address of the pool |
Source code in boardfarm3/lib/utils.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
retry
Retry a function if the output of the function is false.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Callable
|
name of the function to retry |
required |
|
int
|
maximum number of times to be retried |
required |
|
Any
|
arguments to the function |
()
|
Returns:
| Type | Description |
|---|---|
Any
|
output of the function |
Source code in boardfarm3/lib/utils.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
retry_on_exception
Retry a method if any exception occurs.
Eventually, at last, throw the exception.
NOTE: args must be a tuple, hence a 1 arg tuple is (
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Callable
|
name of the function to retry |
required |
|
list | tuple
|
arguments to the function |
required |
|
int
|
maximum number of retries when a exception occur,defaults to 10. When negative, no retries are made. |
10
|
|
int
|
sleep time after every exception occur, defaults to 5 |
5
|
Returns:
| Type | Description |
|---|---|
Any
|
output of the function |
Source code in boardfarm3/lib/utils.py
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 | |
wrappers
Boardfarm decorators module.
Functions:
| Name | Description |
|---|---|
singleton |
Allow a class to become a decorator. |
singleton
singleton(cls: type[AnyClass]) -> Callable[..., AnyClass]
Allow a class to become a decorator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
type[AnyClass]
|
class to become a decorator |
required |
Returns:
| Type | Description |
|---|---|
Callable[..., AnyClass]
|
callable[...,AnyClass] |
Source code in boardfarm3/lib/wrappers.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |