Properties

deviceType: any
directConnect: any
dutSshKey: string
localConnect: boolean
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): void
      • Parameters

        • Rest...data: any[]

        Returns void

      • (message?, ...optionalParams): void
      • Prints to stdout with newline.

        Parameters

        • Optionalmessage: any
        • Rest...optionalParams: any[]

        Returns void

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

        • Rest...data: any[]

        Returns void

      • (message?, ...optionalParams): void
      • Prints to stdout with newline.

        Parameters

        • Optionalmessage: any
        • Rest...optionalParams: any[]

        Returns void

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

        • Rest...data: any[]

        Returns void

      • (message?, ...optionalParams): void
      • Prints to stdout with newline.

        Parameters

        • Optionalmessage: any
        • Rest...optionalParams: any[]

        Returns void

proxySshConfig: {
    host: any;
    port: any;
}
sshKey: any
sshPrefix: string
url: any
username: any
uuid: any
workerHost: any
workerPort: any
workerTunnelPort: number
workerUser: any

Methods - helper

  • Helper to archive the output of a HostOS command stored inside a file.

    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>

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

  • 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

  • Executes command-line operations in the host OS of the DUT. Assuming the DUT is connected to the access point broadcasted by the testbot:

    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: {
          interval: number;
          tries: number;
      } = {}

      object containing details of how many times the command needs to be retried and the intervals between each command execution

      • interval: number
      • tries: number

    Returns string

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

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

  • Fetches OS version available on the DUT's /etc/os-release file

    Parameters

    • target: string

    Returns string

    returns OS version

    This method works entirely on the device though.

  • 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

  • Triggers a reboot on the target device and waits until the device comes back online

    Parameters

    • target: string

    Returns Promise<void>

Methods - Other

  • Parameters

    • target: any
    • dutPort: any
    • workerPort: any

    Returns Promise<void>

  • Parameters

    • command: any
    • retryOptions: {} = {}

      Returns Promise<any>

    • Parameters

      • command: any
      • retryOptions: {} = {}

        Returns Promise<any>

      • Parameters

        • command: any

        Returns Promise<any>

      • Parameters

        • target: any
        • tries: number = 50

        Returns Promise<any>

      • Parameters

        • filePath: any
        • destination: any
        • target: any

        Returns Promise<void>