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.KnownLogFileEntryA representation of a known log entry for remote devices. | 
| Fields | |
|---|---|
| 
    public
    static
    final
    String | EMULATOR_REMOTE_LOG_DIRThe directory where to find debug logs for an emulator instance. | 
| 
    public
    static
    final
    MultiMap<TestDeviceOptions.InstanceType, CommonLogRemoteFileUtil.KnownLogFileEntry> | KNOWN_FILES_TO_FETCH
 | 
| 
    public
    static
    final
    String | NESTED_REMOTE_LOG_DIRThe directory where to find debug logs for a nested remote instance. | 
| 
    public
    static
    final
    String | NETSIM_LOG_DIRThe 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_FETCH_LOGcvd fetch log | 
| 
    public
    static
    final
    String | OXYGEN_CUTTLEFISH_LOG_DIRThe directory where to find Oxygen device logs. | 
| 
    public
    static
    final
    String | OXYGEN_EMULATOR_LOG_DIRThe directory where to find emulator logs from Oxygen service. | 
| 
    public
    static
    final
    String | OXYGEN_GOLDFISH_LOG_DIRThe directory where to find goldfish logs from Oxygen service. | 
| 
    public
    static
    final
     | OXYGEN_LOG_FILES
 | 
| 
    public
    static
    final
     | OXYGEN_LOG_FILES_FALLBACKFor older version of cuttlefish, log files only exists in cuttlefish_runtime directory. | 
| 
    public
    static
    final
    String | OXYGEN_RUNTIME_LOG_DIRThe 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
        
        
        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. | 
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.InstanceType, CommonLogRemoteFileUtil.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 finalNETSIM_LOG_FILES 
NETSIM_USER_LOG_DIR
public static final String NETSIM_USER_LOG_DIR
OXYGEN_CUTTLEFISH_FETCH_LOG
public static final String OXYGEN_CUTTLEFISH_FETCH_LOG
cvd fetch log
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 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.
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: TheITestLoggerwhere to log the files. | 
| gceAvd | GceAvdInfo: The descriptor of the remote instance. | 
| options | TestDeviceOptions: TheTestDeviceOptionsdescribing the device options | 
| runUtil | IRunUtil: AIRunUtilto 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: TheITestLoggerwhere to log the files. | 
| gceAvd | GceAvdInfo: The descriptor of the remote instance. | 
| options | TestDeviceOptions: TheTestDeviceOptionsdescribing the device options | 
| runUtil | IRunUtil: AIRunUtilto 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: TheGceAvdInfothat describe the device. | 
| options | TestDeviceOptions: aTestDeviceOptionsdescribing the device options to be used for the
     GCE device. | 
| runUtil | IRunUtil: aIRunUtilto 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: TheGceAvdInfothat describe the device. | 
| options | TestDeviceOptions: aTestDeviceOptionsdescribing the device options to be used for the
     GCE device. | 
| runUtil | IRunUtil: aIRunUtilto 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: TheITestLoggerwhere to log the files. | 
| gceAvd | GceAvdInfo: The descriptor of the remote instance. | 
| options | TestDeviceOptions: TheTestDeviceOptionsdescribing the device options | 
| runUtil | IRunUtil: AIRunUtilto execute commands. | 
| logName | String: the log name to use when reporting to theITestLogger | 
| 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: TheITestLoggerwhere 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: TheHostOrchestratorUtilused to pull CF logs. | 
| logger | ITestLogger: TheITestLoggerwhere to log the file. | 
| options | TestDeviceOptions: TheTestDeviceOptionsdescribing 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-06-12 UTC.
