Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • export=

Index

Properties

deviceType

deviceType: any

directConnect

directConnect: any

dutSshKey

dutSshKey: string

logger

logger: { info: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void }; log: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void }; status: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void } }

Type declaration

  • info: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void }
      • (...data: any[]): void
      • (message?: any, ...optionalParams: any[]): void
      • Parameters

        • Rest ...data: any[]

        Returns void

      • Prints to stdout with newline.

        Parameters

        • Optional message: any
        • Rest ...optionalParams: any[]

        Returns void

  • log: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void }
      • (...data: any[]): void
      • (message?: any, ...optionalParams: any[]): void
      • Parameters

        • Rest ...data: any[]

        Returns void

      • Prints to stdout with newline.

        Parameters

        • Optional message: any
        • Rest ...optionalParams: any[]

        Returns void

  • status: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void }
      • (...data: any[]): void
      • (message?: any, ...optionalParams: any[]): void
      • Parameters

        • Rest ...data: any[]

        Returns void

      • Prints to stdout with newline.

        Parameters

        • Optional message: any
        • Rest ...optionalParams: any[]

        Returns void

sshKey

sshKey: any

sshPrefix

sshPrefix: string

url

url: any

username

username: any

uuid

uuid: any

workerHost

workerHost: any

workerPort

workerPort: any

workerUser

workerUser: any

helper Methods

archiveLogs

  • archiveLogs(title: string, target: string, command?: string): Promise<void>
  • Helper to archive the output of a HostOS command stored inside a file.

    remark

    the default command that runs is journalctl --no-pager --no-hostname -a -b all

    Parameters

    • title: string

      The name of the directory in which logs will be archived. Usuallly this value is the name of the test suite (Available in the test using this.id)

    • target: string

      local UUID of the DUT, example:${UUID}.local

    • command: string = "journalctl --no-pager --no-hostname --list-boots | awk '{print $1}' | xargs -I{} sh -c 'set -x; journalctl --no-pager --no-hostname -a -b {} || true;'"

      The command you need to run and store output for.

    Returns Promise<void>

executeCommandInContainer

  • executeCommandInContainer(command: string | any[], containerName: string, target: any): string
  • Executes the command in the targeted container of a device

    Parameters

    • command: string | any[]

      The command to be executed, arrays are joined by spaces

    • containerName: string

      The name of the service/container to run the command in

    • target: any

      The <UUID.local> of the target device

    Returns string

    output of the command that is executed on the targetted container of the device

executeCommandInHostOS

  • executeCommandInHostOS(command: string | any[], target: string, retryOptions?: {}): string
  • Executes command-line operations in the host OS of the DUT. Assuming the DUT is connected to the access point broadcasted by the testbot:

    example
    const Worker = this.require('common/worker');
    const worker = new Worker(DEVICE_TYPE_SLUG, this.getLogger())
    await worker.executeCommandInHostOS('cat /etc/hostname', `${UUID}.local`);
    await worker.executeCommandInHostOS(
      ['jq', `'.hostname=${newHostname}'`, '/mnt/boot/config.json'], `${UUID}.local`
    );
    

    Parameters

    • command: string | any[]

      command to be executed on the DUT, arrays are joined by spaces

    • target: string

      local UUID of the DUT, example:${UUID}.local

    • retryOptions: {} = {}

    Returns string

    Output of the command that was exected on hostOS of the DUT

flash

  • flash(imagePath: string): Promise<void>
  • Flash the provided OS image onto the connected DUT

    Parameters

    • imagePath: string

      path of the image to be flashed onto the DUT

    Returns Promise<void>

getOSVersion

  • getOSVersion(target: string): string
  • Fetches OS version available on the DUT's /etc/os-release file

    remark

    This method works entirely on the device though.

    Parameters

    • target: string

    Returns string

    returns OS version

off

  • off(): Promise<void>

on

  • on(): Promise<void>

pushContainerToDUT

  • pushContainerToDUT(target: string, source: string, containerName: string): string
  • Pushes a release to an application from a given directory for unmanaged devices

    Parameters

    • target: string

      the for the target device

    • source: string

      The path to the directory containing the docker-compose/Dockerfile for the containers

    • containerName: string

      The name of the container to verify is push has succeeded.

    Returns string

    returns state of the device

rebootDut

  • rebootDut(target: string): Promise<void>
  • Triggers a reboot on the target device and waits until the device comes back online

    Parameters

    • target: string

    Returns Promise<void>

Other Methods

addSSHKey

  • addSSHKey(keyPath: any): Promise<void>

capture

  • capture(action: any): Promise<any>

createSSHTunnels

  • createSSHTunnels(target: any): Promise<void>

createTunneltoDUT

  • createTunneltoDUT(target: any, dutPort: any, workerPort: any): Promise<void>

diagnostics

  • diagnostics(): Promise<any>

executeCommandInWorker

  • executeCommandInWorker(command: any, retryOptions?: {}): Promise<any>

executeCommandInWorkerHost

  • executeCommandInWorkerHost(command: any, retryOptions?: {}): Promise<any>

executeCommandOverSerial

  • executeCommandOverSerial(command: any): Promise<any>

fetchSerial

  • fetchSerial(): Promise<string>

getContract

  • getContract(): Promise<any>

getDutIp

  • getDutIp(target: any, tries?: number): Promise<any>

ip

  • ip(target: any): Promise<any>

network

  • network(network: any): Promise<void>

proxy

  • proxy(proxy: any): Promise<any>

sendFile

  • sendFile(filePath: any, destination: any, target: any): Promise<void>

teardown

  • teardown(): Promise<void>

Generated using TypeDoc