CommonLogRemoteFileUtil

public class CommonLogRemoteFileUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.device.cloud.CommonLogRemoteFileUtil


This utility allows to avoid code duplication across the different remote device representation for the remote log fetching logic of common files.

Summary

Nested classes

class CommonLogRemoteFileUtil.KnownLogFileEntry

A representation of a known log entry for remote devices. 

Fields

public static final String EMULATOR_REMOTE_LOG_DIR

The directory where to find debug logs for an emulator instance.

public static final MultiMap<TestDeviceOptions.InstanceTypeCommonLogRemoteFileUtil.KnownLogFileEntry> KNOWN_FILES_TO_FETCH

public static final String NESTED_REMOTE_LOG_DIR

The directory where to find debug logs for a nested remote instance.

public static final String NETSIM_LOG_DIR

The directory where to find netsim logs from Oxygen service.

public static final NETSIM_LOG_FILES

public static final String NETSIM_USER_LOG_DIR

public static final String OXYGEN_CUTTLEFISH_LOG_DIR

The directory where to find Oxygen device logs.

public static final String OXYGEN_EMULATOR_LOG_DIR

The directory where to find emulator logs from Oxygen service.

public static final String OXYGEN_GOLDFISH_LOG_DIR

The directory where to find goldfish logs from Oxygen service.

public static final OXYGEN_LOG_FILES

public static final OXYGEN_LOG_FILES_FALLBACK

For older version of cuttlefish, log files only exists in cuttlefish_runtime directory.

public static final String OXYGEN_RUNTIME_LOG_DIR

The directory where to find Oxygen device runtime logs.

public static final String TOMBSTONES_ZIP_NAME

Public constructors

CommonLogRemoteFileUtil()

Public methods

static void fetchCommonFiles(ITestLogger testLogger, GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil)

Fetch and log the commonly known files from remote instances.

static void fetchTombstones(ITestLogger testLogger, GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil)

Fetch and log the tombstones from the remote instance.

static boolean isRemoteGceReachableBySsh(GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil)

Execute a command to validate the ssh connection to the remote GCE instance.

static void logRemoteCommandOutput(ITestLogger testLogger, GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil, String logName, String... remoteCommand)

Execute a command on remote instance and log its output

Fields

EMULATOR_REMOTE_LOG_DIR

public static final String EMULATOR_REMOTE_LOG_DIR

The directory where to find debug logs for an emulator instance.

KNOWN_FILES_TO_FETCH

public static final MultiMap<TestDeviceOptions.InstanceTypeCommonLogRemoteFileUtil.KnownLogFileEntry> KNOWN_FILES_TO_FETCH

NESTED_REMOTE_LOG_DIR

public static final String NESTED_REMOTE_LOG_DIR

The directory where to find debug logs for a nested remote instance.

NETSIM_LOG_DIR

public static final String NETSIM_LOG_DIR

The directory where to find netsim logs from Oxygen service.

NETSIM_LOG_FILES

public static final  NETSIM_LOG_FILES

NETSIM_USER_LOG_DIR

public static final String NETSIM_USER_LOG_DIR

OXYGEN_CUTTLEFISH_LOG_DIR

public static final String OXYGEN_CUTTLEFISH_LOG_DIR

The directory where to find Oxygen device logs.

OXYGEN_EMULATOR_LOG_DIR

public static final String OXYGEN_EMULATOR_LOG_DIR

The directory where to find emulator logs from Oxygen service.

OXYGEN_GOLDFISH_LOG_DIR

public static final String OXYGEN_GOLDFISH_LOG_DIR

The directory where to find goldfish logs from Oxygen service.

OXYGEN_LOG_FILES

public static final  OXYGEN_LOG_FILES

OXYGEN_LOG_FILES_FALLBACK

public static final  OXYGEN_LOG_FILES_FALLBACK

For older version of cuttlefish, log files only exists in cuttlefish_runtime directory.

OXYGEN_RUNTIME_LOG_DIR

public static final String OXYGEN_RUNTIME_LOG_DIR

The directory where to find Oxygen device runtime logs. Only use this if OXYGEN_CUTTLEFISH_LOG_DIR is not found.

TOMBSTONES_ZIP_NAME

public static final String TOMBSTONES_ZIP_NAME

Public constructors

CommonLogRemoteFileUtil

public CommonLogRemoteFileUtil ()

Public methods

fetchCommonFiles

public static void fetchCommonFiles (ITestLogger testLogger, 
                GceAvdInfo gceAvd, 
                TestDeviceOptions options, 
                IRunUtil runUtil)

Fetch and log the commonly known files from remote instances.

Parameters
testLogger ITestLogger: The ITestLogger where to log the files.

gceAvd GceAvdInfo: The descriptor of the remote instance.

options TestDeviceOptions: The TestDeviceOptions describing the device options

runUtil IRunUtil: A IRunUtil to execute commands.

fetchTombstones

public static void fetchTombstones (ITestLogger testLogger, 
                GceAvdInfo gceAvd, 
                TestDeviceOptions options, 
                IRunUtil runUtil)

Fetch and log the tombstones from the remote instance.

Parameters
testLogger ITestLogger: The ITestLogger where to log the files.

gceAvd GceAvdInfo: The descriptor of the remote instance.

options TestDeviceOptions: The TestDeviceOptions describing the device options

runUtil IRunUtil: A IRunUtil to execute commands.

isRemoteGceReachableBySsh

public static boolean isRemoteGceReachableBySsh (GceAvdInfo gceAvd, 
                TestDeviceOptions options, 
                IRunUtil runUtil)

Execute a command to validate the ssh connection to the remote GCE instance.

Parameters
gceAvd GceAvdInfo: The GceAvdInfo that describe the device.

options TestDeviceOptions: a TestDeviceOptions describing the device options to be used for the GCE device.

runUtil IRunUtil: a IRunUtil to execute commands.

Returns
boolean A boolean which indicate whether the remote GCE is reachable by ssh.

logRemoteCommandOutput

public static void logRemoteCommandOutput (ITestLogger testLogger, 
                GceAvdInfo gceAvd, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                String logName, 
                String... remoteCommand)

Execute a command on remote instance and log its output

Parameters
testLogger ITestLogger: The ITestLogger where to log the files.

gceAvd GceAvdInfo: The descriptor of the remote instance.

options TestDeviceOptions: The TestDeviceOptions describing the device options

runUtil IRunUtil: A IRunUtil to execute commands.

logName String: the log name to use when reporting to the ITestLogger

remoteCommand String: the command line to be executed on remote instance