The BalenaOS helper class can be used to configure and unpack the OS image that you will use in the test. This allows you to inject config options and network credentials into your image.
BalenaOS
const network_conf = { ssid: SSID, psk: PASSWORD, nat: true, } const os = new BalenaOS( { deviceType: DEVICE_TYPE_SLUG, network: network_conf, configJson: { uuid: UUID, persistentLogging: true } }, this.getLogger() ); await os.fetch() await os.configure()
Alternatively, you can use the CLI to perform these functions - the CLI is imported in the testing environment:
await exec(`balena login --token ${API_KEY}`) await exec(`balena os configure ${PATH_TO_IMAGE} --config-network wifi --config-wifi-key ${PASSWORD} --config-wifi-ssid ${SSID}`);
Generated using TypeDoc
balenaOS helpers
The
BalenaOS
helper class can be used to configure and unpack the OS image that you will use in the test. This allows you to inject config options and network credentials into your image.Alternatively, you can use the CLI to perform these functions - the CLI is imported in the testing environment: