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. |
Constants | |
|---|---|
String |
EMULATOR_REMOTE_LOG_DIR
The directory where to find debug logs for an emulator instance. |
String |
NESTED_REMOTE_LOG_DIR
The directory where to find debug logs for a nested remote instance. |
String |
NETSIM_LOG_DIR
The directory where to find netsim logs from Oxygen service. |
String |
NETSIM_USER_LOG_DIR
|
String |
OXYGEN_CUTTLEFISH_FETCH_LOG
cvd fetch log |
String |
OXYGEN_CUTTLEFISH_LOG_DIR
The directory where to find Oxygen device logs. |
String |
OXYGEN_EMULATOR_LOG_DIR
The directory where to find emulator logs from Oxygen service. |
String |
OXYGEN_GOLDFISH_LOG_DIR
The directory where to find goldfish logs from Oxygen service. |
String |
OXYGEN_RUNTIME_LOG_DIR
The directory where to find Oxygen device runtime logs. |
String |
TOMBSTONES_ZIP_NAME
|
Fields | |
|---|---|
public
static
final
MultiMap<TestDeviceOptions.InstanceType, CommonLogRemoteFileUtil.KnownLogFileEntry> |
KNOWN_FILES_TO_FETCH
|
public
static
final
|
NETSIM_LOG_FILES
|
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 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
boolean
|
isRemoteGceReachableBySsh(GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil, String... command)
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 |
static
void
|
pullCommonCvdLogs(GceAvdInfo gceAvdInfo, HostOrchestratorUtil hoUtil, ITestLogger logger)
Pull CF logs via Host Orchestrator. |
static
void
|
pullCommonCvdLogs(GceAvdInfo gceAvdInfo, HostOrchestratorUtil hOUtil, ITestLogger logger, TestDeviceOptions options)
Pull CF logs via Host Orchestrator. |
Constants
EMULATOR_REMOTE_LOG_DIR
public static final String EMULATOR_REMOTE_LOG_DIR
The directory where to find debug logs for an emulator instance.
Constant Value: "/home/%s/log/"
NESTED_REMOTE_LOG_DIR
public static final String NESTED_REMOTE_LOG_DIR
The directory where to find debug logs for a nested remote instance.
Constant Value: "/home/%s/cuttlefish_runtime/"
NETSIM_LOG_DIR
public static final String NETSIM_LOG_DIR
The directory where to find netsim logs from Oxygen service.
Constant Value: "/tmp/android/netsimd/"
NETSIM_USER_LOG_DIR
public static final String NETSIM_USER_LOG_DIR
Constant Value: "/tmp/android-%s/netsimd/"
OXYGEN_CUTTLEFISH_FETCH_LOG
public static final String OXYGEN_CUTTLEFISH_FETCH_LOG
cvd fetch log
Constant Value: "/tmp/cfbase/3/fetch.log"
OXYGEN_CUTTLEFISH_LOG_DIR
public static final String OXYGEN_CUTTLEFISH_LOG_DIR
The directory where to find Oxygen device logs.
Constant Value: "/tmp/cfbase/3/cuttlefish/instances/cvd-1/logs/"
OXYGEN_EMULATOR_LOG_DIR
public static final String OXYGEN_EMULATOR_LOG_DIR
The directory where to find emulator logs from Oxygen service.
Constant Value: "/tmp/device_launcher/"
OXYGEN_GOLDFISH_LOG_DIR
public static final String OXYGEN_GOLDFISH_LOG_DIR
The directory where to find goldfish logs from Oxygen service.
Constant Value: "/tmp/android_platform_gf*/logs/"
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.
Constant Value: "/tmp/cfbase/3/cuttlefish_runtime/"
TOMBSTONES_ZIP_NAME
public static final String TOMBSTONES_ZIP_NAME
Constant Value: "tombstones-zip"
Fields
KNOWN_FILES_TO_FETCH
public static final MultiMap<TestDeviceOptions.InstanceType, CommonLogRemoteFileUtil.KnownLogFileEntry> KNOWN_FILES_TO_FETCH
NETSIM_LOG_FILES
public static finalNETSIM_LOG_FILES
OXYGEN_LOG_FILES
public static finalOXYGEN_LOG_FILES
OXYGEN_LOG_FILES_FALLBACK
public static finalOXYGEN_LOG_FILES_FALLBACK
For older version of cuttlefish, log files only exists in cuttlefish_runtime directory.
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. |
isRemoteGceReachableBySsh
public static boolean isRemoteGceReachableBySsh (GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil, String... command)
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. |
command |
String: The command to be executed. |
| 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 |
pullCommonCvdLogs
public static void pullCommonCvdLogs (GceAvdInfo gceAvdInfo, HostOrchestratorUtil hoUtil, ITestLogger logger)
Pull CF logs via Host Orchestrator.
| Parameters | |
|---|---|
gceAvdInfo |
GceAvdInfo: The descriptor of the remote instance. |
hoUtil |
HostOrchestratorUtil |
logger |
ITestLogger: The ITestLogger where to log the file. |
pullCommonCvdLogs
public static void pullCommonCvdLogs (GceAvdInfo gceAvdInfo, HostOrchestratorUtil hOUtil, ITestLogger logger, TestDeviceOptions options)
Pull CF logs via Host Orchestrator.
| Parameters | |
|---|---|
gceAvdInfo |
GceAvdInfo: The descriptor of the remote instance. |
hOUtil |
HostOrchestratorUtil: The HostOrchestratorUtil used to pull CF logs. |
logger |
ITestLogger: The ITestLogger where to log the file. |
options |
TestDeviceOptions: The TestDeviceOptions describing the device options |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-12-04 UTC.