GceManager
public
class
GceManager
extends Object
java.lang.Object | |
↳ | com.android.tradefed.device.cloud.GceManager. |
Outil d'aide qui gère les appels GCE pour démarrer/arrêter et collecter des journaux à partir de GCE.
Résumé
Champs | |
---|---|
public
static
final
String |
GCE_HOSTNAME_KEY
|
public
static
final
String |
GCE_INSTANCE_CLEANED_KEY
|
public
static
final
String |
GCE_INSTANCE_NAME_KEY
|
Constructeurs publics | |
---|---|
GceManager(DeviceDescriptor deviceDesc, TestDeviceOptions deviceOptions, IBuildInfo buildInfo)
Directeur |
|
GceManager(DeviceDescriptor deviceDesc, TestDeviceOptions deviceOptions, IBuildInfo buildInfo,
<ph type="x-smartling-placeholder"></ph> Ce constructeur est obsolète. Utiliser d'autres constructeurs (nous les conservons temporairement pour assurer la rétrocompatibilité) |
|
GceManager(DeviceDescriptor deviceDesc, TestDeviceOptions deviceOptions, IBuildInfo buildInfo, String gceInstanceName, String gceHost)
Ctor, variante permettant de fournir le nom de l'instance GCE à utiliser directement. |
Méthodes publiques | |
---|---|
static
boolean
|
AcloudShutdown(TestDeviceOptions options, IRunUtil runUtil, String instanceName, String hostname)
Exécution Acloud réelle pour arrêter l'appareil virtuel. |
void
|
cleanUp()
|
static
File
|
getBugreportzWithSsh(GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil)
Obtenez un rapport de bug de l'appareil en SSH pour éviter tout problème potentiel de connexion adb. |
static
String
|
getInstanceSerialLog(GceAvdInfo infos, File avdConfigFile, File jsonKeyFile, IRunUtil runUtil)
Lit le contenu actuel du journal série de l'instance Gce Avd. |
static
File
|
getNestedDeviceSshBugreportz(GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil)
Obtenez un rapport de bug via SSH pour une instance imbriquée. |
static
void
|
logNestedRemoteFile(ITestLogger logger, GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil, String remoteFilePath, LogDataType type)
Récupérez un fichier distant à partir d'une instance imbriquée et consignez-le. |
static
void
|
logNestedRemoteFile(ITestLogger logger, GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil, String remoteFilePath, LogDataType type, String baseName)
Récupérez un fichier distant à partir d'une instance imbriquée et consignez-le. |
void
|
logSerialOutput(GceAvdInfo infos, ITestLogger logger)
Consigner la sortie série d'un appareil décrit par |
static
CommandResult
|
remoteSshCommandExecution(GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil, long timeoutMs, String... command)
Exécutez la commande distante via SSH sur une instance. |
boolean
|
shutdownGce()
Arrêtez l'instance Gce associée à |
GceAvdInfo
|
startGce()
|
GceAvdInfo
|
startGce(String ipDevice, MultiMap<String, String> attributes)
Essayer de démarrer une instance gce |
Méthodes protégées | |
---|---|
|
buildGceCmd(File reportFile, IBuildInfo b, String ipDevice, MultiMap<String, String> attributes)
Créez et renvoyez la commande pour lancer GCE. |
String
|
extractInstanceName(String bootupLogs)
Récupérez le nom de l'instance à partir des journaux de démarrage gce. |
Champs
Clé_NOM_HÔTE_GCE
public static final String GCE_HOSTNAME_KEY
GCE_INSTANCE_CLEANED_KEY
public static final String GCE_INSTANCE_CLEANED_KEY
GCE_INSTANCE_NAME_KEY
public static final String GCE_INSTANCE_NAME_KEY
Constructeurs publics
GceManager
public GceManager (DeviceDescriptor deviceDesc, TestDeviceOptions deviceOptions, IBuildInfo buildInfo)
Directeur
Paramètres | |
---|---|
deviceDesc |
DeviceDescriptor : DeviceDescriptor associé à l'appareil GCE. |
deviceOptions |
TestDeviceOptions : TestDeviceOptions associé à l'appareil. |
buildInfo |
IBuildInfo : IBuildInfo décrivant la compilation gce à démarrer.
|
GceManager
public GceManager (DeviceDescriptor deviceDesc, TestDeviceOptions deviceOptions, IBuildInfo buildInfo,testResourceBuildInfos)
<ph type="x-smartling-placeholder"></ph>
Ce constructeur est obsolète.
Utiliser d'autres constructeurs (nous les conservons temporairement pour assurer la rétrocompatibilité)
Paramètres | |
---|---|
deviceDesc |
DeviceDescriptor |
deviceOptions |
TestDeviceOptions |
buildInfo |
IBuildInfo |
testResourceBuildInfos |
|
GceManager
public GceManager (DeviceDescriptor deviceDesc, TestDeviceOptions deviceOptions, IBuildInfo buildInfo, String gceInstanceName, String gceHost)
Ctor, variante permettant de fournir le nom de l'instance GCE à utiliser directement.
Paramètres | |
---|---|
deviceDesc |
DeviceDescriptor : DeviceDescriptor associé à l'appareil GCE. |
deviceOptions |
TestDeviceOptions : TestDeviceOptions associé à l'appareil |
buildInfo |
IBuildInfo : IBuildInfo décrivant la compilation gce à démarrer. |
gceInstanceName |
String : nom de l'instance à utiliser. |
gceHost |
String : nom d'hôte ou adresse IP de l'instance à utiliser.
|
Méthodes publiques
Arrêt cloud
public static boolean AcloudShutdown (TestDeviceOptions options, IRunUtil runUtil, String instanceName, String hostname)
Exécution Acloud réelle pour arrêter l'appareil virtuel.
Paramètres | |
---|---|
options |
TestDeviceOptions : TestDeviceOptions des options Acloud |
runUtil |
IRunUtil : IRunUtil pour exécuter Acloud |
instanceName |
String : instance à arrêter |
hostname |
String : nom d'hôte de l'instance, uniquement utilisé pour la seiche à l'oxygène. |
Renvoie | |
---|---|
boolean |
"True" en cas de réussite |
nettoyage
public void cleanUp ()
getBugreportzWithSsh
public static File getBugreportzWithSsh (GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil)
Obtenez un rapport de bug de l'appareil en SSH pour éviter tout problème potentiel de connexion adb.
Paramètres | |
---|---|
gceAvd |
GceAvdInfo : GceAvdInfo décrivant l'appareil. |
options |
TestDeviceOptions : un TestDeviceOptions décrivant les options de l'appareil à utiliser pour
Appareil GCE. |
runUtil |
IRunUtil : IRunUtil permettant d'exécuter des commandes. |
Renvoie | |
---|---|
File |
Fichier pointant vers le rapport de bug zip, ou valeur null si un problème est survenu. |
getInstanceSerialLog
public static String getInstanceSerialLog (GceAvdInfo infos, File avdConfigFile, File jsonKeyFile, IRunUtil runUtil)
Lit le contenu actuel du journal série de l'instance Gce Avd.
Paramètres | |
---|---|
infos |
GceAvdInfo : GceAvdInfo décrivant l'instance. |
avdConfigFile |
File : fichier de configuration avd |
jsonKeyFile |
File : fichier de clé JSON du compte de service. |
runUtil |
IRunUtil : IRunUtil permettant d'exécuter des commandes. |
Renvoie | |
---|---|
String |
Sortie du journal série ou valeur "null" en cas de problème. |
getNestedDeviceSshBugreportz
public static File getNestedDeviceSshBugreportz (GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil)
Obtenez un rapport de bug via SSH pour une instance imbriquée. Cela nécessite de demander l'adb dans le une instance virtuelle.
Paramètres | |
---|---|
gceAvd |
GceAvdInfo : GceAvdInfo décrivant l'appareil. |
options |
TestDeviceOptions : un TestDeviceOptions décrivant les options de l'appareil à utiliser pour
Appareil GCE. |
runUtil |
IRunUtil : IRunUtil permettant d'exécuter des commandes. |
Renvoie | |
---|---|
File |
Fichier pointant vers le rapport de bug zip, ou valeur null si un problème est survenu. |
logNestedRemoteFile
public static void logNestedRemoteFile (ITestLogger logger, GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil, String remoteFilePath, LogDataType type)
Récupérez un fichier distant à partir d'une instance imbriquée et consignez-le.
Paramètres | |
---|---|
logger |
ITestLogger : ITestLogger où enregistrer le fichier. |
gceAvd |
GceAvdInfo : GceAvdInfo décrivant l'appareil. |
options |
TestDeviceOptions : un TestDeviceOptions décrivant les options de l'appareil à utiliser pour
Appareil GCE. |
runUtil |
IRunUtil : IRunUtil permettant d'exécuter des commandes. |
remoteFilePath |
String : chemin d'accès distant où trouver le fichier |
type |
LogDataType : LogDataType du fichier journalisé.
|
logNestedRemoteFile
public static void logNestedRemoteFile (ITestLogger logger, GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil, String remoteFilePath, LogDataType type, String baseName)
Récupérez un fichier distant à partir d'une instance imbriquée et consignez-le.
Paramètres | |
---|---|
logger |
ITestLogger : ITestLogger où enregistrer le fichier. |
gceAvd |
GceAvdInfo : GceAvdInfo décrivant l'appareil. |
options |
TestDeviceOptions : un TestDeviceOptions décrivant les options de l'appareil à utiliser pour
Appareil GCE. |
runUtil |
IRunUtil : IRunUtil permettant d'exécuter des commandes. |
remoteFilePath |
String : chemin d'accès distant où trouver le fichier |
type |
LogDataType : LogDataType du fichier journalisé. |
baseName |
String : nom de base à utiliser pour journaliser le fichier. Si la valeur est nulle, le nom de fichier réel sera
utilisé.
|
logSerialOutput
public void logSerialOutput (GceAvdInfo infos, ITestLogger logger)
Consigner la sortie série d'un appareil décrit par GceAvdInfo
.
Paramètres | |
---|---|
infos |
GceAvdInfo : GceAvdInfo décrivant l'instance. |
logger |
ITestLogger : ITestLogger où consigner le journal série.
|
RemoteSshCommandExecution
public static CommandResult remoteSshCommandExecution (GceAvdInfo gceAvd, TestDeviceOptions options, IRunUtil runUtil, long timeoutMs, String... command)
Exécutez la commande distante via SSH sur une instance.
Paramètres | |
---|---|
gceAvd |
GceAvdInfo : GceAvdInfo décrivant l'appareil. |
options |
TestDeviceOptions : un TestDeviceOptions décrivant les options de l'appareil à utiliser pour
Appareil GCE. |
runUtil |
IRunUtil : IRunUtil permettant d'exécuter des commandes. |
timeoutMs |
long : délai avant expiration de la commande en millisecondes. 0 signifie qu'il n'y a pas de délai d'inactivité. |
command |
String : commande distante à exécuter. |
Renvoie | |
---|---|
CommandResult |
CommandResult contenant le résultat de l'exécution.
|
shutdownGce
public boolean shutdownGce ()
Arrêtez l'instance Gce associée à startGce()
.
Renvoie | |
---|---|
boolean |
Renvoie "true" si l'arrêt de gce a été demandé comme non bloquant. |
démarrageGce
public GceAvdInfo startGce (String ipDevice, MultiMap<String, String> attributes)
Essayer de démarrer une instance gce
Paramètres | |
---|---|
ipDevice |
String : adresse IP initiale de l'instance GCE dans laquelle exécuter l'AVD, null si ce n'est pas le cas
applicables |
attributes |
MultiMap : attributs associés à l'appel en cours, utilisés pour transmettre des données
informations jusqu'à l'instance GCE pour être ajoutées en tant que métadonnées de VM |
Renvoie | |
---|---|
GceAvdInfo |
un GceAvdInfo décrivant l'instance GCE ; Il peut s'agir d'une instance BOOT_FAIL. |
Génère | |
---|---|
TargetSetupError |
Méthodes protégées
buildGceCmd
protectedbuildGceCmd (File reportFile, IBuildInfo b, String ipDevice, MultiMap<String, String> attributes)
Créez et renvoyez la commande pour lancer GCE. Exposée à des fins de test.
Paramètres | |
---|---|
reportFile |
File |
b |
IBuildInfo |
ipDevice |
String |
attributes |
MultiMap |
Renvoie | |
---|---|
|
nomInstanced'extraction
protected String extractInstanceName (String bootupLogs)
Récupérez le nom de l'instance à partir des journaux de démarrage gce. Recherchez "name" : "gce-
Paramètres | |
---|---|
bootupLogs |
String |
Renvoie | |
---|---|
String |