TestDeviceOptions

public class TestDeviceOptions
extends Object

java.lang.Object
   ↳ com.android.tradefed.device.TestDeviceOptions


Container for ITestDevice Options

Summary

Constants

int DEFAULT_ADB_PORT

Fields

public static final String INSTANCE_TYPE_OPTION

public static final String REMOTE_TF_VERSION_OPTION

Public constructors

TestDeviceOptions()

Public methods

void addGceDriverParams(String param)

Add a param to the gce driver params.

boolean allowGceCmdTimeoutOverride()

Returns whether or not we should rely on the boot-timeout args from acloud if present.

long getAdbCommandTimeout()
int getAdbRecoveryTimeout()
long getAdbRootUnavailableTimeout()
long getAvailableTimeout()
File getAvdConfigFile()

Return the Gce Avd config file to start the instance.

File getAvdDriverBinary()

Return the path to the binary to start the Gce Avd instance.

String getBaseImage()

Returns the base image name to be used for the current instance

long getBugreportzTimeout()

Returns the timeout value to be applied to bugreportz capture.

String getConnCheckUrl()
static String getCreateCommandByInstanceType(TestDeviceOptions.InstanceType type)
String getCrosPassword()

Returns the password to log in to Chrome OS with.

String getCrosUser()

Returns the Chrome OS User to log in as.

Integer getCutoffBattery()
MultiMap<File, String> getExtraFiles()

Return the extra files need to upload to GCE during acloud create.

getExtraOxygenArgs()

Returns the extra arguments to lease an Oxygen device.

static getExtraParamsByInstanceType(TestDeviceOptions.InstanceType type, String baseImage)
File getFastbootBinary()

Returns a specified fastboot binary to be used.

int getFastbootTimeout()
String getGceAccount()

Return the gce email account to use with the driver

long getGceCmdTimeout()

Return the Gce Avd timeout for the instance to come online.

String getGceDriverBuildIdParam()

Return the GCE driver parameter that should be paired with the build id from build info

MultiMap<String, File> getGceDriverFileParams()

Return the additional file paths as GCE driver parameters provided via option.

Log.LogLevel getGceDriverLogLevel()

Return the log level of the Gce Avd driver.

getGceDriverParams()

Return the additional GCE driver parameters provided via option

int getGceMaxAttempt()

Return the max number of attempts to start a gce device

TestDeviceOptions.InstanceType getInstanceType()

Returns the instance type of virtual device that should be created

String getInstanceUser()

Returns the instance user of GCE virtual device that should be created

getInvocationAttributeToMetadata()
String getLogcatOptions()
long getMaxLogcatDataSize()

Get the approximate maximum size of a tmp logcat data to retain, in bytes.

long getMaxWifiConnectTime()
long getOnlineTimeout()
String getOxygenAccountingUser()

Returns the accounting user of the Oxygen device.

TestDeviceOptions.DeviceSize getOxygenDeviceSize()

Returns The size of the host which Oxygen virtual device will be running on.

long getOxygenLeaseLength()

Returns the length of leasing the Oxygen device in milliseconds.

String getOxygenServiceAddress()

Returns the service address of the Oxygen device.

String getOxygenTargetRegion()

Returns the target region of the Oxygen device.

getPostBootCommands()
int getRebootTimeout()
int getRemoteAdbPort()

Returns the remote port in instance that the adb server listens to

getRemoteFetchFilePattern()

Returns the list of pattern to attempt to fetch via scp.

File getRemoteTf()

The file pointing to the directory of the Tradefed version to be pushed to the remote.

File getServiceAccountJsonKeyFile()
File getSshPrivateKeyPath()

Return the path of the ssh key to use for operations with the Gce Avd instance.

int getUnencryptRebootTimeout()
boolean getUseFastbootErase()
int getWifiAttempts()
int getWifiRetryWaitTime()
String getWifiUtilAPKPath()
boolean isDisableKeyguard()

Check whether or not we should attempt to disable the keyguard once boot has completed

boolean isEnableAdbRoot()

Check whether adb root should be enabled on boot for this device

boolean isLogcatCaptureEnabled()
boolean isWifiExpoRetryEnabled()
void setAdbCommandTimeout(long adbCommandTimeout)

Sets the timeout to send a command in msecs.

void setAdbRecoveryTimeout(int adbRecoveryTimeout)
void setAdbRootUnavailableTimeout(long adbRootUnavailableTimeout)
void setAvdConfigFile(File avdConfigFile)

Set the Gce Avd config file to start the instance.

void setAvdDriverBinary(File avdDriverBinary)

Set the path to the binary to start the Gce Avd instance.

void setConnCheckUrl(String url)
void setCutoffBattery(int cutoffBattery)

set the minimum battery level to continue the invocation.

void setDisableKeyguard(boolean disableKeyguard)

Set whether or not we should attempt to disable the keyguard once boot has completed

void setExtraFiles(MultiMap<File, String> extraFiles)

Set the extra files need to upload to GCE during acloud create.

void setFastbootTimeout(int fastbootTimeout)
void setGceCmdTimeout(long gceCmdTimeout)

Set the Gce Avd timeout for the instance to come online.

void setGceDriverBuildIdParam(String gceDriverBuildIdParam)

Set the GCE driver parameter that should be paired with the build id from build info

void setGceDriverLogLevel(Log.LogLevel mGceDriverLogLevel)

Set the log level of the Gce Avd driver.

void setGceMaxAttempt(int gceMaxAttempt)

Set the max number of attempts to start a gce device

void setInstanceType(TestDeviceOptions.InstanceType type)

Sets the instance type of virtual device that should be created

void setInstanceUser(String instanceUser)

Set the instance user of GCE virtual device that should be created.

void setLogcatOptions(String logcatOptions)

Set the options to be passed down to logcat

void setMaxLogcatDataSize(long maxLogcatDataSize)

Set the approximate maximum size of a tmp logcat to retain, in bytes

void setOnlineTimeout(long onlineTimeout)
void setRebootTimeout(int rebootTimeout)
void setRemoteAdbPort(int remoteAdbPort)

Set the remote port in instance that the adb server listens to

void setServiceAccountJsonKeyFile(File jsonKeyFile)

Set the service account json key file.

void setSkipTearDown(boolean shouldSkipTearDown)

Returns true if GCE tear down should be skipped.

void setSshPrivateKeyPath(File sshPrivateKeyPath)

Set the path of the ssh key to use for operations with the Gce Avd instance.

void setUnencryptRebootTimeout(int unencryptRebootTimeout)
void setUseConnection(boolean useConnection)
void setUseFastbootErase(boolean useFastbootErase)
void setWifiAttempts(int wifiAttempts)
boolean shouldDisableReboot()
boolean shouldSkipTearDown()

Returns true if GCE tear down should be skipped.

boolean shouldUseConnection()

Return whether or not we should use the new connection feature.

boolean shouldUseContentProvider()

Returns whether or not the Tradefed content provider can be used to push/pull files.

boolean useCmdWifiCommands()

Returns whether or not to use cmd wifi commands instead of apk.

boolean useExitStatusWorkaround()

Returns whether to use a workaround to get shell exit status on older devices without shell v2.

boolean useOxygen()

Returns true if use Oxygen to create virtual devices.

boolean useOxygenProxy()

Returns true if we want TradeFed directly call Oxygen to lease a device.

boolean useUpdatedBootloaderStatus()

Returns whether or not to use the newer bootloader state status.

boolean waitForGceTearDown()

Returns true if we should block on GCE tear down completion before proceeding.

Constants

DEFAULT_ADB_PORT

public static final int DEFAULT_ADB_PORT

Constant Value: 5555 (0x000015b3)

Fields

INSTANCE_TYPE_OPTION

public static final String INSTANCE_TYPE_OPTION

REMOTE_TF_VERSION_OPTION

public static final String REMOTE_TF_VERSION_OPTION

Public constructors

TestDeviceOptions

public TestDeviceOptions ()

Public methods

addGceDriverParams

public void addGceDriverParams (String param)

Add a param to the gce driver params.

Parameters
param String

allowGceCmdTimeoutOverride

public boolean allowGceCmdTimeoutOverride ()

Returns whether or not we should rely on the boot-timeout args from acloud if present.

Returns
boolean

getAdbCommandTimeout

public long getAdbCommandTimeout ()

Returns
long the timeout to send a command in msecs.

getAdbRecoveryTimeout

public int getAdbRecoveryTimeout ()

Returns
int the timeout in msecs to boot into recovery mode.

getAdbRootUnavailableTimeout

public long getAdbRootUnavailableTimeout ()

Returns
long the time in ms to wait for a device to become unavailable after adb root.

getAvailableTimeout

public long getAvailableTimeout ()

Returns
long the default time in ms to to wait for a device to be available.

getAvdConfigFile

public File getAvdConfigFile ()

Return the Gce Avd config file to start the instance.

Returns
File

getAvdDriverBinary

public File getAvdDriverBinary ()

Return the path to the binary to start the Gce Avd instance.

Returns
File

getBaseImage

public String getBaseImage ()

Returns the base image name to be used for the current instance

Returns
String

getBugreportzTimeout

public long getBugreportzTimeout ()

Returns the timeout value to be applied to bugreportz capture.

Returns
long

getConnCheckUrl

public String getConnCheckUrl ()

Returns
String the default URL to be used for connectivity tests.

getCreateCommandByInstanceType

public static String getCreateCommandByInstanceType (TestDeviceOptions.InstanceType type)

Parameters
type TestDeviceOptions.InstanceType

Returns
String

getCrosPassword

public String getCrosPassword ()

Returns the password to log in to Chrome OS with.

Returns
String

getCrosUser

public String getCrosUser ()

Returns the Chrome OS User to log in as.

Returns
String

getCutoffBattery

public Integer getCutoffBattery ()

Returns
Integer the minimum battery level to continue the invocation.

getExtraFiles

public MultiMap<File, String> getExtraFiles ()

Return the extra files need to upload to GCE during acloud create.

Returns
MultiMap<File, String>

getExtraOxygenArgs

public  getExtraOxygenArgs ()

Returns the extra arguments to lease an Oxygen device.

Returns

getExtraParamsByInstanceType

public static  getExtraParamsByInstanceType (TestDeviceOptions.InstanceType type, 
                String baseImage)

Parameters
type TestDeviceOptions.InstanceType

baseImage String

Returns

getFastbootBinary

public File getFastbootBinary ()

Returns a specified fastboot binary to be used. if null, use the DeviceManager one.

Returns
File

getFastbootTimeout

public int getFastbootTimeout ()

Returns
int the timeout to boot into fastboot mode in msecs.

getGceAccount

public String getGceAccount ()

Return the gce email account to use with the driver

Returns
String

getGceCmdTimeout

public long getGceCmdTimeout ()

Return the Gce Avd timeout for the instance to come online.

Returns
long

getGceDriverBuildIdParam

public String getGceDriverBuildIdParam ()

Return the GCE driver parameter that should be paired with the build id from build info

Returns
String

getGceDriverFileParams

public MultiMap<String, File> getGceDriverFileParams ()

Return the additional file paths as GCE driver parameters provided via option.

Returns
MultiMap<String, File>

getGceDriverLogLevel

public Log.LogLevel getGceDriverLogLevel ()

Return the log level of the Gce Avd driver.

Returns
Log.LogLevel

getGceDriverParams

public  getGceDriverParams ()

Return the additional GCE driver parameters provided via option

Returns

getGceMaxAttempt

public int getGceMaxAttempt ()

Return the max number of attempts to start a gce device

Returns
int

getInstanceType

public TestDeviceOptions.InstanceType getInstanceType ()

Returns the instance type of virtual device that should be created

Returns
TestDeviceOptions.InstanceType

getInstanceUser

public String getInstanceUser ()

Returns the instance user of GCE virtual device that should be created

Returns
String

getInvocationAttributeToMetadata

public  getInvocationAttributeToMetadata ()

Returns

getLogcatOptions

public String getLogcatOptions ()

Returns
String the configured logcat options

getMaxLogcatDataSize

public long getMaxLogcatDataSize ()

Get the approximate maximum size of a tmp logcat data to retain, in bytes.

Returns
long

getMaxWifiConnectTime

public long getMaxWifiConnectTime ()

Returns
long the maximum time to attempt to connect to wifi.

getOnlineTimeout

public long getOnlineTimeout ()

Returns
long the default time in ms to to wait for a device to be online.

getOxygenAccountingUser

public String getOxygenAccountingUser ()

Returns the accounting user of the Oxygen device.

Returns
String

getOxygenDeviceSize

public TestDeviceOptions.DeviceSize getOxygenDeviceSize ()

Returns The size of the host which Oxygen virtual device will be running on.

Returns
TestDeviceOptions.DeviceSize

getOxygenLeaseLength

public long getOxygenLeaseLength ()

Returns the length of leasing the Oxygen device in milliseconds.

Returns
long

getOxygenServiceAddress

public String getOxygenServiceAddress ()

Returns the service address of the Oxygen device.

Returns
String

getOxygenTargetRegion

public String getOxygenTargetRegion ()

Returns the target region of the Oxygen device.

Returns
String

getPostBootCommands

public  getPostBootCommands ()

Returns
a list of shell commands to run after reboots.

getRebootTimeout

public int getRebootTimeout ()

Returns
int the timeout in msecs for the full system boot.

getRemoteAdbPort

public int getRemoteAdbPort ()

Returns the remote port in instance that the adb server listens to

Returns
int

getRemoteFetchFilePattern

public  getRemoteFetchFilePattern ()

Returns the list of pattern to attempt to fetch via scp.

Returns

getRemoteTf

public File getRemoteTf ()

The file pointing to the directory of the Tradefed version to be pushed to the remote.

Returns
File

getServiceAccountJsonKeyFile

public File getServiceAccountJsonKeyFile ()

Returns
File the service account json key file.

getSshPrivateKeyPath

public File getSshPrivateKeyPath ()

Return the path of the ssh key to use for operations with the Gce Avd instance.

Returns
File

getUnencryptRebootTimeout

public int getUnencryptRebootTimeout ()

Returns
int the timeout in msecs for the filesystem to be formatted and the device to reboot after unencryption.

getUseFastbootErase

public boolean getUseFastbootErase ()

Returns
boolean whether to use fastboot erase instead of fastboot format to wipe partitions.

getWifiAttempts

public int getWifiAttempts ()

Returns
int the default number of attempts to connect to wifi network.

getWifiRetryWaitTime

public int getWifiRetryWaitTime ()

Returns
int the base wait time between wifi connect retries.

getWifiUtilAPKPath

public String getWifiUtilAPKPath ()

Returns
String the wifiutil apk path

isDisableKeyguard

public boolean isDisableKeyguard ()

Check whether or not we should attempt to disable the keyguard once boot has completed

Returns
boolean

isEnableAdbRoot

public boolean isEnableAdbRoot ()

Check whether adb root should be enabled on boot for this device

Returns
boolean

isLogcatCaptureEnabled

public boolean isLogcatCaptureEnabled ()

Returns
boolean true if background logcat capture is enabled

isWifiExpoRetryEnabled

public boolean isWifiExpoRetryEnabled ()

Returns
boolean if the exponential retry strategy should be used.

setAdbCommandTimeout

public void setAdbCommandTimeout (long adbCommandTimeout)

Sets the timeout to send a command in msecs.

Parameters
adbCommandTimeout long

setAdbRecoveryTimeout

public void setAdbRecoveryTimeout (int adbRecoveryTimeout)

Parameters
adbRecoveryTimeout int: the timeout in msecs to boot into recovery mode.

setAdbRootUnavailableTimeout

public void setAdbRootUnavailableTimeout (long adbRootUnavailableTimeout)

Parameters
adbRootUnavailableTimeout long: time in ms to wait for a device to become unavailable after adb root.

setAvdConfigFile

public void setAvdConfigFile (File avdConfigFile)

Set the Gce Avd config file to start the instance.

Parameters
avdConfigFile File

setAvdDriverBinary

public void setAvdDriverBinary (File avdDriverBinary)

Set the path to the binary to start the Gce Avd instance.

Parameters
avdDriverBinary File

setConnCheckUrl

public void setConnCheckUrl (String url)

Parameters
url String

setCutoffBattery

public void setCutoffBattery (int cutoffBattery)

set the minimum battery level to continue the invocation.

Parameters
cutoffBattery int

setDisableKeyguard

public void setDisableKeyguard (boolean disableKeyguard)

Set whether or not we should attempt to disable the keyguard once boot has completed

Parameters
disableKeyguard boolean

setExtraFiles

public void setExtraFiles (MultiMap<File, String> extraFiles)

Set the extra files need to upload to GCE during acloud create.

Parameters
extraFiles MultiMap

setFastbootTimeout

public void setFastbootTimeout (int fastbootTimeout)

Parameters
fastbootTimeout int: the timout in msecs to boot into fastboot mode.

setGceCmdTimeout

public void setGceCmdTimeout (long gceCmdTimeout)

Set the Gce Avd timeout for the instance to come online.

Parameters
gceCmdTimeout long

setGceDriverBuildIdParam

public void setGceDriverBuildIdParam (String gceDriverBuildIdParam)

Set the GCE driver parameter that should be paired with the build id from build info

Parameters
gceDriverBuildIdParam String

setGceDriverLogLevel

public void setGceDriverLogLevel (Log.LogLevel mGceDriverLogLevel)

Set the log level of the Gce Avd driver.

Parameters
mGceDriverLogLevel Log.LogLevel

setGceMaxAttempt

public void setGceMaxAttempt (int gceMaxAttempt)

Set the max number of attempts to start a gce device

Parameters
gceMaxAttempt int

setInstanceType

public void setInstanceType (TestDeviceOptions.InstanceType type)

Sets the instance type of virtual device that should be created

Parameters
type TestDeviceOptions.InstanceType

setInstanceUser

public void setInstanceUser (String instanceUser)

Set the instance user of GCE virtual device that should be created.

Parameters
instanceUser String

setLogcatOptions

public void setLogcatOptions (String logcatOptions)

Set the options to be passed down to logcat

Parameters
logcatOptions String

setMaxLogcatDataSize

public void setMaxLogcatDataSize (long maxLogcatDataSize)

Set the approximate maximum size of a tmp logcat to retain, in bytes

Parameters
maxLogcatDataSize long

setOnlineTimeout

public void setOnlineTimeout (long onlineTimeout)

Parameters
onlineTimeout long

setRebootTimeout

public void setRebootTimeout (int rebootTimeout)

Parameters
rebootTimeout int: the timeout in msecs for the system to fully boot.

setRemoteAdbPort

public void setRemoteAdbPort (int remoteAdbPort)

Set the remote port in instance that the adb server listens to

Parameters
remoteAdbPort int

setServiceAccountJsonKeyFile

public void setServiceAccountJsonKeyFile (File jsonKeyFile)

Set the service account json key file.

Parameters
jsonKeyFile File: the key file.

setSkipTearDown

public void setSkipTearDown (boolean shouldSkipTearDown)

Returns true if GCE tear down should be skipped. False otherwise.

Parameters
shouldSkipTearDown boolean

setSshPrivateKeyPath

public void setSshPrivateKeyPath (File sshPrivateKeyPath)

Set the path of the ssh key to use for operations with the Gce Avd instance.

Parameters
sshPrivateKeyPath File

setUnencryptRebootTimeout

public void setUnencryptRebootTimeout (int unencryptRebootTimeout)

Parameters
unencryptRebootTimeout int: the timeout in msecs for the filesystem to be formatted and the device to reboot after unencryption.

setUseConnection

public void setUseConnection (boolean useConnection)

Parameters
useConnection boolean

setUseFastbootErase

public void setUseFastbootErase (boolean useFastbootErase)

Parameters
useFastbootErase boolean: whether to use fastboot erase instead of fastboot format to wipe partitions.

setWifiAttempts

public void setWifiAttempts (int wifiAttempts)

Parameters
wifiAttempts int

shouldDisableReboot

public boolean shouldDisableReboot ()

Returns
boolean if device reboot should be disabled

shouldSkipTearDown

public boolean shouldSkipTearDown ()

Returns true if GCE tear down should be skipped. False otherwise.

Returns
boolean

shouldUseConnection

public boolean shouldUseConnection ()

Return whether or not we should use the new connection feature.

Returns
boolean

shouldUseContentProvider

public boolean shouldUseContentProvider ()

Returns whether or not the Tradefed content provider can be used to push/pull files.

Returns
boolean

useCmdWifiCommands

public boolean useCmdWifiCommands ()

Returns whether or not to use cmd wifi commands instead of apk.

Returns
boolean

useExitStatusWorkaround

public boolean useExitStatusWorkaround ()

Returns whether to use a workaround to get shell exit status on older devices without shell v2.

Returns
boolean

useOxygen

public boolean useOxygen ()

Returns true if use Oxygen to create virtual devices. False otherwise.

Returns
boolean

useOxygenProxy

public boolean useOxygenProxy ()

Returns true if we want TradeFed directly call Oxygen to lease a device.

Returns
boolean

useUpdatedBootloaderStatus

public boolean useUpdatedBootloaderStatus ()

Returns whether or not to use the newer bootloader state status.

Returns
boolean

waitForGceTearDown

public boolean waitForGceTearDown ()

Returns true if we should block on GCE tear down completion before proceeding.

Returns
boolean