Options
All
  • Public
  • Public/Protected
  • All
Menu

Module 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.

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}`);

Index

Classes

Generated using TypeDoc