AdbSshConnection

public class AdbSshConnection
extends AdbTcpConnection

java.lang.Object
   ↳ com.android.tradefed.device.connection.AbstractConnection
     ↳ com.android.tradefed.device.connection.DefaultConnection
       ↳ com.android.tradefed.device.connection.AdbTcpConnection
         ↳ com.android.tradefed.device.connection.AdbSshConnection


ssh ブリッジ経由の Adb 接続。

概要

パブリック コンストラクタ

AdbSshConnection(DefaultConnection.ConnectionBuilder builder)

パブリック メソッド

HostOrchestratorUtil createHostOrchestratorUtil(GceAvdInfo gceAvdInfo)

ホスト オーケストレーター ユーティリティを作成するヘルパー。

DeviceInspectionResult debugDeviceNotAvailable()

ホスト VM を検査し、DeviceInspectionResult で詳細を取得します。

CommandResult deleteSnapshotGce(String user, String snapshotId)

Cuttlefish インスタンスのスナップショットを削除しようとする

GceAvdInfo getAvdInfo()

作成されたリモート VM から GceAvdInfo を返します。

CuttlefishControl getCuttlefishControl()
AbstractTunnelMonitor getGceTunnelMonitor()

デバイスの AbstractTunnelMonitor を返します。

String getHOBaseURL()

ホスト オーケストレーターのベース URL を返すヘルパー

void getSshBugreport()

デバイスに直接 ssh 接続してリモート バグレポートをキャプチャします。

List<File> getTombstones()

Cuttlefish には、直接取得できるリモートホストに tombstone を取得する特別な機能があります。

void initializeConnection()

デバイスの接続を初期化します。

void notifyAdbRebootCalled()

doAdbReboot が呼び出されたときに通知します。

CommandResult powerwash()

GCE インスタンスのパワーウォッシュを試みる

CommandResult powerwashGce(String user, Integer offset)

GCE インスタンスのパワーウォッシュを試みる

void reconnect(String serial)

デバイスへの接続を再接続します。

void reconnectForRecovery(String serial)

復元ルーティン用にデバイスへの接続を再接続します。

CommandResult restoreSnapshotGce(String user, Integer offset, String snapshotId)

Cuttlefish インスタンスのスナップショットの復元を試みます。

CommandResult snapshotGce(String user, Integer offset, String snapshotId)

Cuttlefish インスタンスのスナップショットを作成しようとします。

void tearDownConnection()

接続をクリーンアップします。

保護されたメソッド

long getCurrentTime()

現在のシステム時刻を返します。

void launchGce(IBuildInfo buildInfo, MultiMap<String, String> attributes)

ビルド情報に基づいて実際の gce デバイスを起動します。

void waitForTunnelOnline(long waitTime)

トンネル モニターが実行されているかどうかを確認します。

パブリック コンストラクタ

AdbSshConnection

public AdbSshConnection (DefaultConnection.ConnectionBuilder builder)

パラメータ
builder DefaultConnection.ConnectionBuilder

パブリック メソッド

createHostOrchestratorUtil

public HostOrchestratorUtil createHostOrchestratorUtil (GceAvdInfo gceAvdInfo)

ホスト オーケストレーター ユーティリティを作成するヘルパー。

パラメータ
gceAvdInfo GceAvdInfo

戻り値
HostOrchestratorUtil

debugDeviceNotAvailable

public DeviceInspectionResult debugDeviceNotAvailable ()

ホスト VM を検査し、DeviceInspectionResult で詳細を取得します。

戻り値
DeviceInspectionResult DeviceInspectionResult

deleteSnapshotGce

public CommandResult deleteSnapshotGce (String user, 
                String snapshotId)

Cuttlefish インスタンスのスナップショットを削除しようとする

パラメータ
user String: AVD のホスト実行ユーザー。該当しない場合は null

snapshotId String

戻り値
CommandResult スナップショットの削除試行の CommandResult を返します

例外
com.android.tradefed.targetprep.TargetSetupError
TargetSetupError

getAvdInfo

public GceAvdInfo getAvdInfo ()

作成されたリモート VM から GceAvdInfo を返します。ステータスに関係なく返されるため、情報を検査できます。

戻り値
GceAvdInfo

getCuttlefishControl

public CuttlefishControl getCuttlefishControl ()

戻り値
CuttlefishControl

getGceTunnelMonitor

public AbstractTunnelMonitor getGceTunnelMonitor ()

デバイスの AbstractTunnelMonitor を返します。

戻り値
AbstractTunnelMonitor

getHOBaseURL

public String getHOBaseURL ()

ホスト オーケストレーターのベース URL を返すヘルパー

戻り値
String

getSshBugreport

public void getSshBugreport ()

デバイスに直接 SSH 接続してリモート バグレポートをキャプチャします。

getTombstones

public List<File> getTombstones ()

Cuttlefish には、直接取得できるリモートホストに tombstone を取得する特別な機能があります。

戻り値
List<File>

initializeConnection

public void initializeConnection ()

デバイスの接続を初期化します。

例外
DeviceNotAvailableException
TargetSetupError

notifyAdbRebootCalled

public void notifyAdbRebootCalled ()

doAdbReboot が呼び出されたときに通知する。

出荷時設定にリセット(する)

public CommandResult powerwash ()

GCE インスタンスのパワーウォッシュを試みる

戻り値
CommandResult powerwash の試行の CommandResult を返します

例外
com.android.tradefed.targetprep.TargetSetupError
TargetSetupError

powerwashGce

public CommandResult powerwashGce (String user, 
                Integer offset)

GCE インスタンスのパワーウォッシュを試みる

パラメータ
user String: AVD のホスト実行ユーザー。該当しない場合は null

offset Integer: ホスト内の AVD のデバイス番号オフセット。該当しない場合は null

戻り値
CommandResult powerwash の試行の CommandResult を返します

例外
com.android.tradefed.targetprep.TargetSetupError
TargetSetupError

reconnect

public void reconnect (String serial)

デバイスへの接続を再接続します。

パラメータ
serial String: デバイスのシリアル番号。

例外
DeviceNotAvailableException

reconnectForRecovery

public void reconnectForRecovery (String serial)

復元ルーティン用にデバイスへの接続を再接続します。

パラメータ
serial String: デバイスのシリアル番号。

例外
DeviceNotAvailableException

restoreSnapshotGce

public CommandResult restoreSnapshotGce (String user, 
                Integer offset, 
                String snapshotId)

Cuttlefish インスタンスのスナップショットの復元を試みる

パラメータ
user String: AVD のホスト実行ユーザー。該当しない場合は null

offset Integer: ホスト内の AVD のデバイス番号オフセット。該当しない場合は null

snapshotId String: スナップショット ID

戻り値
CommandResult 復元スナップショットの試行の CommandResult を返します

例外
com.android.tradefed.targetprep.TargetSetupError
TargetSetupError

snapshotGce

public CommandResult snapshotGce (String user, 
                Integer offset, 
                String snapshotId)

Cuttlefish インスタンスのスナップショットを作成しようとする

パラメータ
user String: AVD のホスト実行ユーザー。該当しない場合は null

offset Integer: ホスト内の AVD のデバイス番号オフセット。該当しない場合は null

snapshotId String

戻り値
CommandResult スナップショットの試行の CommandResult を返します

例外
com.android.tradefed.targetprep.TargetSetupError
TargetSetupError

tearDownConnection

public void tearDownConnection ()

接続をクリーンアップします。

保護されたメソッド

getCurrentTime

protected long getCurrentTime ()

現在のシステム時刻を返します。テスト用に公開されています。

戻り値
long

launchGce

protected void launchGce (IBuildInfo buildInfo, 
                MultiMap<String, String> attributes)

ビルド情報に基づいて実際の gce デバイスを起動します。

パラメータ
buildInfo IBuildInfo

attributes MultiMap

例外
TargetSetupError

waitForTunnelOnline

protected void waitForTunnelOnline (long waitTime)

トンネル モニターが実行されているかどうかを確認します。

パラメータ
waitTime long

例外
DeviceNotAvailableException