MultiUserSetupUtil

public class MultiUserSetupUtil
extends Object

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


Utility to create another user in Cuttlefish VM. New user will allow to run a second device.

Summary

Public constructors

MultiUserSetupUtil()

Public methods

static CommandResult addExtraCvdUser(int userId, GceAvdInfo remoteInstance, TestDeviceOptions options, IRunUtil runUtil, long timeoutMs)

Create the 'cvd-XX' user on the remote device if missing.

static String getChownCommand(String username)

Gets the command for a user to own the main directory.

static String getUserNumber(int userId)

Returns the user id string version that follow the remote device notation.

static CommandResult prepareRemoteHomeDir(String mainRootUser, String username, GceAvdInfo remoteInstance, TestDeviceOptions options, IRunUtil runUtil, long timeoutMs)

Setup a new remote user on an existing Cuttlefish VM.

static CommandResult prepareRemoteUser(String username, GceAvdInfo remoteInstance, TestDeviceOptions options, IRunUtil runUtil, long timeoutMs)

Setup a new remote user on an existing Cuttlefish VM.

static CommandResult setupNetworkInterface(int userId, GceAvdInfo remoteInstance, TestDeviceOptions options, IRunUtil runUtil, long timeoutMs)

Setup the tuntap interface required to start the Android devices if they are missing.

Public constructors

MultiUserSetupUtil

public MultiUserSetupUtil ()

Public methods

addExtraCvdUser

public static CommandResult addExtraCvdUser (int userId, 
                GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeoutMs)

Create the 'cvd-XX' user on the remote device if missing.

Parameters
userId int

remoteInstance GceAvdInfo

options TestDeviceOptions

runUtil IRunUtil

timeoutMs long

Returns
CommandResult

getChownCommand

public static String getChownCommand (String username)

Gets the command for a user to own the main directory.

Parameters
username String

Returns
String

getUserNumber

public static String getUserNumber (int userId)

Returns the user id string version that follow the remote device notation.

Parameters
userId int

Returns
String

prepareRemoteHomeDir

public static CommandResult prepareRemoteHomeDir (String mainRootUser, 
                String username, 
                GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeoutMs)

Setup a new remote user on an existing Cuttlefish VM.

Parameters
mainRootUser String

username String

remoteInstance GceAvdInfo

options TestDeviceOptions

runUtil IRunUtil

timeoutMs long

Returns
CommandResult

prepareRemoteUser

public static CommandResult prepareRemoteUser (String username, 
                GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeoutMs)

Setup a new remote user on an existing Cuttlefish VM.

Parameters
username String

remoteInstance GceAvdInfo

options TestDeviceOptions

runUtil IRunUtil

timeoutMs long

Returns
CommandResult

setupNetworkInterface

public static CommandResult setupNetworkInterface (int userId, 
                GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeoutMs)

Setup the tuntap interface required to start the Android devices if they are missing.

Parameters
userId int

remoteInstance GceAvdInfo

options TestDeviceOptions

runUtil IRunUtil

timeoutMs long

Returns
CommandResult