Skip to content

hookspecs

Boardfarm plugin hookspecs.

Modules:

Name Description
core

Boardfarm main hook specifications.

devices

Boardfarm device hook specifications.

core

Boardfarm main hook specifications.

Functions:

Name Description
boardfarm_add_cmdline_args

Add new command line argument(s).

boardfarm_add_devices

Add devices to known devices list.

boardfarm_add_hookspecs

Add new hookspecs to extend and/or update the framework.

boardfarm_cmdline_parse

Parse command line arguments.

boardfarm_configure

Configure boardfarm based on command line arguments or environment config.

boardfarm_parse_config

Parse the config.

boardfarm_post_setup_env

Call after the environment setup is completed for all the devices.

boardfarm_register_devices

Register device to plugin manager.

boardfarm_release_devices

Release reserved devices after use.

boardfarm_reserve_devices

Reserve devices before starting the deployment.

boardfarm_setup_env

Boardfarm environment setup for all the devices.

boardfarm_shutdown_device

Shutdown boardfarm device after use.

boardfarm_add_cmdline_args

boardfarm_add_cmdline_args(argparser: ArgumentParser) -> None

Add new command line argument(s).

Parameters:

Name Type Description Default

argparser

ArgumentParser

argument parser

required
Source code in boardfarm3/plugins/hookspecs/core.py
25
26
27
28
29
30
31
@hookspec
def boardfarm_add_cmdline_args(argparser: ArgumentParser) -> None:
    """Add new command line argument(s).

    :param argparser: argument parser
    :type argparser: ArgumentParser
    """

boardfarm_add_devices

boardfarm_add_devices() -> dict[str, type[BoardfarmDevice]]

Add devices to known devices list.

This hook is used to let boardfarm know the devices which are configured in the inventory config. Each repo with a boardfarm device should implement this hook to add each devices to the list of known devices.

Returns:

Type Description
dict[str, type[BoardfarmDevice]]

dictionary with device name and class

Source code in boardfarm3/plugins/hookspecs/core.py
187
188
189
190
191
192
193
194
195
196
197
198
@hookspec
def boardfarm_add_devices() -> dict[str, type[BoardfarmDevice]]:
    """Add devices to known devices list.

    This hook is used to let boardfarm know the devices which are configured
    in the inventory config.
    Each repo with a boardfarm device should implement this hook to add each
    devices to the list of known devices.

    :return: dictionary with device name and class
    :rtype: dict[str, type[BoardfarmDevice]]
    """

boardfarm_add_hookspecs

boardfarm_add_hookspecs(plugin_manager: PluginManager) -> None

Add new hookspecs to extend and/or update the framework.

Parameters:

Name Type Description Default

plugin_manager

PluginManager

plugin manager

required
Source code in boardfarm3/plugins/hookspecs/core.py
16
17
18
19
20
21
22
@hookspec
def boardfarm_add_hookspecs(plugin_manager: PluginManager) -> None:
    """Add new hookspecs to extend and/or update the framework.

    :param plugin_manager: plugin manager
    :type plugin_manager: PluginManager
    """

boardfarm_cmdline_parse

boardfarm_cmdline_parse(
    argparser: ArgumentParser, cmdline_args: list[str]
) -> Namespace

Parse command line arguments.

Parameters:

Name Type Description Default

argparser

ArgumentParser

argument parser

required

cmdline_args

list[str]

command line arguments

required

Returns:

Type Description
Namespace

command line arguments

Source code in boardfarm3/plugins/hookspecs/core.py
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@hookspec(firstresult=True)
def boardfarm_cmdline_parse(
    argparser: ArgumentParser,
    cmdline_args: list[str],
) -> Namespace:
    """Parse command line arguments.

    :param argparser: argument parser
    :type argparser: ArgumentParser
    :param cmdline_args: command line arguments
    :type cmdline_args: list[str]
    :return: command line arguments
    :rtype: Namespace
    """

boardfarm_configure

boardfarm_configure(cmdline_args: Namespace, plugin_manager: PluginManager) -> None

Configure boardfarm based on command line arguments or environment config.

This hook allows to register/deregister boardfarm plugins when you pass a command line argument. This way a plugin will be registered to boardfarm only when required.

Parameters:

Name Type Description Default

cmdline_args

Namespace

command line arguments

required

plugin_manager

PluginManager

plugin manager

required
Source code in boardfarm3/plugins/hookspecs/core.py
72
73
74
75
76
77
78
79
80
81
82
83
84
@hookspec
def boardfarm_configure(cmdline_args: Namespace, plugin_manager: PluginManager) -> None:
    """Configure boardfarm based on command line arguments or environment config.

    This hook allows to register/deregister boardfarm plugins when you pass a
    command line argument. This way a plugin will be registered to boardfarm only
    when required.

    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param plugin_manager: plugin manager
    :type plugin_manager: PluginManager
    """

boardfarm_parse_config

boardfarm_parse_config(
    cmdline_args: Namespace,
    inventory_config: dict[str, Any],
    env_config: dict[str, Any],
) -> BoardfarmConfig

Parse the config.

This hook allows for the modification (if needed) of the configuration files, like inventory and environment, by using cmd line overrides.

Parameters:

Name Type Description Default

cmdline_args

Namespace

command line arguments

required

inventory_config

dict[str, Any]

inventory json

required

env_config

dict[str, Any]

environment json

required

Returns:

Type Description
BoardfarmConfig

a BoardfarmConfig object

Source code in boardfarm3/plugins/hookspecs/core.py
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@hookspec(firstresult=True)
def boardfarm_parse_config(
    cmdline_args: Namespace,
    inventory_config: dict[str, Any],
    env_config: dict[str, Any],
) -> BoardfarmConfig:
    """Parse the config.

    This hook allows for the modification (if needed) of the configuration files,
    like inventory and environment, by using cmd line overrides.

    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param inventory_config: inventory json
    :type inventory_config: dict[str, Any]
    :param env_config: environment json
    :type env_config: dict[str, Any]
    :return: a BoardfarmConfig object
    :rtype: BoardfarmConfig
    """

boardfarm_post_setup_env

boardfarm_post_setup_env(
    cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Call after the environment setup is completed for all the devices.

This hook is used to perform required operations after the board is deployed.

Parameters:

Name Type Description Default

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/core.py
129
130
131
132
133
134
135
136
137
138
139
140
141
142
@hookspec
def boardfarm_post_setup_env(
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Call after the environment setup is completed for all the devices.

    This hook is used to perform required operations after the board is deployed.

    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

boardfarm_register_devices

boardfarm_register_devices(
    config: BoardfarmConfig, cmdline_args: Namespace, plugin_manager: PluginManager
) -> DeviceManager

Register device to plugin manager.

This hook is responsible to register devices to the device manager after initialization based on the given inventory and environment config.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

plugin_manager

PluginManager

plugin manager instance

required

Returns:

Type Description
DeviceManager

device manager with all registered devices

Source code in boardfarm3/plugins/hookspecs/core.py
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
@hookspec(firstresult=True)
def boardfarm_register_devices(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    plugin_manager: PluginManager,
) -> DeviceManager:
    """Register device to plugin manager.

    This hook is responsible to register devices to the device manager after
    initialization based on the given inventory and environment config.

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param plugin_manager: plugin manager instance
    :type plugin_manager: PluginManager
    :return: device manager with all registered devices
    :rtype: DeviceManager
    """

boardfarm_release_devices

boardfarm_release_devices(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    plugin_manager: PluginManager,
    deployment_status: dict[str, Any],
) -> None

Release reserved devices after use.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

plugin_manager

PluginManager

plugin manager instance

required

deployment_status

dict[str, Any]

deployment status data

required
Source code in boardfarm3/plugins/hookspecs/core.py
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
@hookspec
def boardfarm_release_devices(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    plugin_manager: PluginManager,
    deployment_status: dict[str, Any],
) -> None:
    """Release reserved devices after use.

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param plugin_manager: plugin manager instance
    :type plugin_manager: PluginManager
    :param deployment_status: deployment status data
    :type deployment_status: Dict[str, Any]
    """

boardfarm_reserve_devices

boardfarm_reserve_devices(
    cmdline_args: Namespace, plugin_manager: PluginManager
) -> dict[str, Any]

Reserve devices before starting the deployment.

This hook is used to reserve devices before deployment.

Parameters:

Name Type Description Default

cmdline_args

Namespace

command line arguments

required

plugin_manager

PluginManager

plugin manager instance

required

Returns:

Type Description
dict[str, Any]

inventory configuration

Source code in boardfarm3/plugins/hookspecs/core.py
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
@hookspec(firstresult=True)
def boardfarm_reserve_devices(
    cmdline_args: Namespace,
    plugin_manager: PluginManager,
) -> dict[str, Any]:
    """Reserve devices before starting the deployment.

    This hook is used to reserve devices before deployment.

    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param plugin_manager: plugin manager instance
    :type plugin_manager: PluginManager
    :return: inventory configuration
    :rtype: dict[str, Any]
    """

boardfarm_setup_env

boardfarm_setup_env(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    plugin_manager: PluginManager,
    device_manager: DeviceManager,
) -> DeviceManager

Boardfarm environment setup for all the devices.

This hook is used to deploy boardfarm devices.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config

required

cmdline_args

Namespace

command line arguments

required

plugin_manager

PluginManager

plugin manager instance

required

device_manager

DeviceManager

device manager instance

required

Returns:

Type Description
DeviceManager

device manager with all devices in the environment

Source code in boardfarm3/plugins/hookspecs/core.py
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
@hookspec(firstresult=True)
def boardfarm_setup_env(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    plugin_manager: PluginManager,
    device_manager: DeviceManager,
) -> DeviceManager:
    """Boardfarm environment setup for all the devices.

    This hook is used to deploy boardfarm devices.

    :param config: boardfarm config
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param plugin_manager: plugin manager instance
    :type plugin_manager: PluginManager
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    :return: device manager with all devices in the environment
    :rtype: DeviceManager
    """

boardfarm_shutdown_device

boardfarm_shutdown_device() -> None

Shutdown boardfarm device after use.

This hook should be used by a device to perform a clean shutdown of a device after releasing all the resources (e.g. close all of the open ssh connections) before the shutdown of the framework.

Source code in boardfarm3/plugins/hookspecs/core.py
201
202
203
204
205
206
207
208
@hookspec
def boardfarm_shutdown_device() -> None:
    """Shutdown boardfarm device after use.

    This hook should be used by a device to perform a clean shutdown of a device
    after releasing all the resources (e.g. close all of the open ssh connections)
    before the shutdown of the framework.
    """

devices

Boardfarm device hook specifications.

A Boardfarm device should belong to one of the following categories:

1. server, i.e. DHCP, ACS...
2. device, i.e. a connectivity CPE
3. attached device, i.e. a LAN client

Every device should fulfill the following responsibilities at different stages of the deployment.

Hook responsibilities:

1. skip boot
    - device can be interacted with as it is without making
      any changes to it

2. boot
    - device is running with required software
    - device can be interacted with, e.g. via console
    - device has a management IP address or direct console access
      if the device has a console

3. configure
    - all of the points from boot
    - user driven configurations are applied to the device
    - device has a service IP address if applicable
        Eg: A CPE device has access network IP address,
            eRouter IP, except in disabled mode, eMTA IP
    - for Wi-Fi clients, no connection to the Wi-Fi network
      is made and no IP address on service interface is assigned

Functions:

Name Description
boardfarm_attached_device_boot

Boot boardfarm attached device.

boardfarm_attached_device_boot_async

Boot boardfarm attached device leveraging the asyncio library.

boardfarm_attached_device_configure

Configure boardfarm attached device.

boardfarm_attached_device_configure_async

Configure boardfarm attached device.

boardfarm_device_boot

Boot boardfarm device.

boardfarm_device_configure

Configure boardfarm device.

boardfarm_device_configure_async

Configure boardfarm device.

boardfarm_server_boot

Boot boardfarm server device.

boardfarm_server_configure

Configure boardfarm server device.

boardfarm_server_configure_async

Configure boardfarm server device leveraging the asyncio library.

boardfarm_skip_boot

Skips the booting for the device connected.

boardfarm_skip_boot_async

Skips the booting for the device connected.

contingency_check

Perform contingency check to make sure the device is working fine before use.

validate_device_requirements

Validate device requirements.

validate_device_requirements_async

Validate device requirements.

boardfarm_attached_device_boot

boardfarm_attached_device_boot(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Boot boardfarm attached device.

This hook should be used to boot a device which is attached to a device in the environment. E.g. LAN.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
@hookspec
def boardfarm_attached_device_boot(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Boot boardfarm attached device.

    This hook should be used to boot a device which is attached to a device
    in the environment. E.g. LAN.

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

boardfarm_attached_device_boot_async async

boardfarm_attached_device_boot_async(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Boot boardfarm attached device leveraging the asyncio library.

This hook should be used to boot a device which is attached to a device in the environment. E.g. LAN. To be used for the asynchronous implementation.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
@hookspec
async def boardfarm_attached_device_boot_async(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Boot boardfarm attached device leveraging the asyncio library.

    This hook should be used to boot a device which is attached to a device
    in the environment. E.g. LAN.
    To be used for the asynchronous implementation.

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

boardfarm_attached_device_configure

boardfarm_attached_device_configure(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Configure boardfarm attached device.

This hook should be used to configure a device, after having it booted, which is attached to a device in the environment. E.g. LAN.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
@hookspec
def boardfarm_attached_device_configure(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Configure boardfarm attached device.

    This hook should be used to configure a device, after having it booted,
    which is attached to a device in the environment. E.g. LAN.

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

boardfarm_attached_device_configure_async async

boardfarm_attached_device_configure_async(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Configure boardfarm attached device.

This hook should be used to configure a device, after having it booted, which is attached to a device in the environment. E.g. LAN.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
@hookspec
async def boardfarm_attached_device_configure_async(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Configure boardfarm attached device.

    This hook should be used to configure a device, after having it booted,
    which is attached to a device in the environment. E.g. LAN.
    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

boardfarm_device_boot

boardfarm_device_boot(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Boot boardfarm device.

This hook should be used to boot a device which is dependent on one or more servers in the environment. E.g. CPE.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
@hookspec
def boardfarm_device_boot(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Boot boardfarm device.

    This hook should be used to boot a device which is dependent on one or more
    servers in the environment. E.g. CPE.

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

boardfarm_device_configure

boardfarm_device_configure(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Configure boardfarm device.

This hook should be used to configure a device, after having it booted, which is dependent on one or more servers in the environment. E.g. CPE.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
@hookspec
def boardfarm_device_configure(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Configure boardfarm device.

    This hook should be used to configure a device, after having it booted,
    which is dependent on one or more servers in the environment. E.g. CPE.

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

boardfarm_device_configure_async async

boardfarm_device_configure_async(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Configure boardfarm device.

This hook should be used to configure a device, after having it booted, which is dependent on one or more servers in the environment. E.g. CPE.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
@hookspec
async def boardfarm_device_configure_async(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Configure boardfarm device.

    This hook should be used to configure a device, after having it booted,
    which is dependent on one or more servers in the environment. E.g. CPE.

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

boardfarm_server_boot

boardfarm_server_boot(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Boot boardfarm server device.

This hook should be used to boot a device which is not dependent on other devices in the environment. E.g. WAN and CMTS.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@hookspec
def boardfarm_server_boot(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Boot boardfarm server device.

    This hook should be used to boot a device which is not dependent on other
    devices in the environment. E.g. WAN and CMTS.

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

boardfarm_server_configure

boardfarm_server_configure(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Configure boardfarm server device.

This hook should be used to configure a device, after having it booted, which is not dependent on other devices in the environment. E.g. WAN and CMTS

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
@hookspec
def boardfarm_server_configure(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Configure boardfarm server device.

    This hook should be used to configure a device, after having it booted,
    which is not dependent on other devices in the environment. E.g. WAN and CMTS

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

boardfarm_server_configure_async

boardfarm_server_configure_async(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Configure boardfarm server device leveraging the asyncio library.

This hook should be used to configure a device, after having it booted, which is not dependent on other devices in the environment. E.g. WAN and CMTS To be used for the asynchronous implementation.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
@hookspec
def boardfarm_server_configure_async(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Configure boardfarm server device leveraging the asyncio library.

    This hook should be used to configure a device, after having it booted,
    which is not dependent on other devices in the environment. E.g. WAN and CMTS
    To be used for the asynchronous implementation.

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

boardfarm_skip_boot

boardfarm_skip_boot(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Skips the booting for the device connected.

This hook skip the booting process on those devices that implement the boot_device hook

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@hookspec
def boardfarm_skip_boot(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Skips the booting for the device connected.

    This hook skip the booting process on those
    devices that implement the boot_device hook

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

boardfarm_skip_boot_async async

boardfarm_skip_boot_async(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Skips the booting for the device connected.

This hook skip the booting process on those devices that implement the boot_device hook

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
@hookspec
async def boardfarm_skip_boot_async(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Skips the booting for the device connected.

    This hook skip the booting process on those
    devices that implement the boot_device hook

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

contingency_check

contingency_check(env_req: dict[str, Any], device_manager: DeviceManager) -> None

Perform contingency check to make sure the device is working fine before use.

This hook could be used by any device. It is used by the pytest-boardfarm plugin to make sure the device is in good condition before running each test.

Parameters:

Name Type Description Default

env_req

dict[str, Any]

environment request dictionary

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
286
287
288
289
290
291
292
293
294
295
296
297
298
@hookspec
def contingency_check(env_req: dict[str, Any], device_manager: DeviceManager) -> None:
    """Perform contingency check to make sure the device is working fine before use.

    This hook could be used by any device.
    It is used by the pytest-boardfarm plugin to make sure the device is in
    good condition before running each test.

    :param env_req: environment request dictionary
    :type env_req: dict[str, Any]
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

validate_device_requirements

validate_device_requirements(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Validate device requirements.

This hook is responsible to validate the requirements of a device before deploying devices to the environment. This allows us to fail the deployment early.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
@hookspec
def validate_device_requirements(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Validate device requirements.

    This hook is responsible to validate the requirements of a device before
    deploying devices to the environment.
    This allows us to fail the deployment early.

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """

validate_device_requirements_async async

validate_device_requirements_async(
    config: BoardfarmConfig, cmdline_args: Namespace, device_manager: DeviceManager
) -> None

Validate device requirements.

This hook is responsible to validate the requirements of a device before deploying devices to the environment. This allows us to fail the deployment early.

Parameters:

Name Type Description Default

config

BoardfarmConfig

boardfarm config instance

required

cmdline_args

Namespace

command line arguments

required

device_manager

DeviceManager

device manager instance

required
Source code in boardfarm3/plugins/hookspecs/devices.py
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
@hookspec
async def validate_device_requirements_async(
    config: BoardfarmConfig,
    cmdline_args: Namespace,
    device_manager: DeviceManager,
) -> None:
    """Validate device requirements.

    This hook is responsible to validate the requirements of a device before
    deploying devices to the environment.
    This allows us to fail the deployment early.

    :param config: boardfarm config instance
    :type config: BoardfarmConfig
    :param cmdline_args: command line arguments
    :type cmdline_args: Namespace
    :param device_manager: device manager instance
    :type device_manager: DeviceManager
    """