Starting March 27, 2025, we recommend using android-latest-release instead of aosp-main to build and contribute to AOSP. For more information, see Changes to AOSP.
         
       
     
  
  
  
  
  
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
  
  
    
    
  
  
TradefedSandbox
  public
  
  
  
  class
  TradefedSandbox
  
    extends Object
  
  
  
  
  
      implements
      
        ISandbox
      
  
  
  
    
    | java.lang.Object | 
  
  
    
      | ↳ | com.android.tradefed.sandbox.TradefedSandbox | 
  
  
    
  Sandbox container that can run a Trade Federation invocation. TODO: Allow Options to be passed to
 the sandbox.
Summary
| Public methods | 
|---|
  
  
  
    | 
        
        
        
        
        
        String | 
      createClasspath(File workingDir)
      Create a classpath based on the environment and the working directory returned by ISandbox.getTradefedSandboxEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, String[]). | 
  
  
  
  
    | 
        
        
        
        
        
        IConfiguration | 
      createThinLauncherConfig(String[] args, IKeyStoreClient keyStoreClient, IRunUtil runUtil, File globalConfig)
      Special mode disconnected from main run: When a configuration does not appear to exists in
 the parent, we fallback to thin launcher where we attempt to setup the sandbox with currently
 known informations and fill up the working directory to create the config fully in the
 versioned dir.
        
    
 | 
  
  
  
  
    | 
        
        
        
        
        
        File | 
      getTradefedSandboxEnvironment(IInvocationContext context, IConfiguration nonVersionedConfig, ITestLogger logger, String[] args)
       | 
  
  
  
  
    | 
        
        
        static
        
        
         | 
      matchSandboxExtraBuildTargetByConfigName(String configName)
      Given the test config name, match the extra build targets from Sandbox's extra build targets.
        
    
 | 
  
  
  
  
    | 
        
        
        
        
        
        Exception | 
      prepareEnvironment(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)
      Prepare the environment for the sandbox to run properly.
        
    
 | 
  
  
  
  
    | 
        
        
        
        
        
        CommandResult | 
      run(TestInformation info, IConfiguration config, ITestLogger logger)
      Run the sandbox with the environment that was set.
        
    
 | 
  
  
  
  
    | 
        
        
        
        
        
        void | 
      tearDown()
      Clean up any states, files or environment that may have been changed.
        
    
 | 
  
Fields
    
    
      
  
      
  
    
public static final String EXTRA_TARGET_LAB
    
    
    
  
    
 
    GENERAL_TESTS_ZIP
    
      
  
      
  
    
public static final String GENERAL_TESTS_ZIP
    
    
    
  
    
 
    SANDBOX_ENABLED
    
      
  
      
  
    
public static final String SANDBOX_ENABLED
    
    
    
  
    
 
Public constructors
    TradefedSandbox
    
public TradefedSandbox ()
    
    
    
  
 
Public methods
    createThinLauncherConfig
    
public IConfiguration createThinLauncherConfig (String[] args, 
                IKeyStoreClient keyStoreClient, 
                IRunUtil runUtil, 
                File globalConfig)
    
    
    
  Special mode disconnected from main run: When a configuration does not appear to exists in
 the parent, we fallback to thin launcher where we attempt to setup the sandbox with currently
 known informations and fill up the working directory to create the config fully in the
 versioned dir.
    
    | Parameters | 
|---|
      
        | args | String: The original command line args. | 
      
        | keyStoreClient | IKeyStoreClient: the current keystore client to use to create configurations. | 
      
        | runUtil | IRunUtil: the currentIRunUtilto run host commands. | 
      
        | globalConfig | File: The global configuration to use to run subprocesses of TF. | 
    
    
      | Returns | 
|---|
      
        | IConfiguration | a File pointing to the configuration XML of TF for NON_VERSIONED objects. Returns
     null if no thin launcher config could be created. | 
    
 
    getTradefedSandboxEnvironment
    
public File getTradefedSandboxEnvironment (IInvocationContext context, 
                IConfiguration nonVersionedConfig, 
                ITestLogger logger, 
                String[] args)
    
    
    
  
    
    | Parameters | 
|---|
      
        | context | IInvocationContext | 
      
        | nonVersionedConfig | IConfiguration | 
      
        | logger | ITestLogger | 
      
        | args | String | 
    
    
 
    matchSandboxExtraBuildTargetByConfigName
    
public static  matchSandboxExtraBuildTargetByConfigName (String configName)
    
    
    
  Given the test config name, match the extra build targets from Sandbox's extra build targets.
    
    | Parameters | 
|---|
      
        | configName | String | 
    
    
 
    tearDown
    
public void tearDown ()
    
    
    
  Clean up any states, files or environment that may have been changed.
 
Protected methods
    dumpGlobalConfig
    
protected File dumpGlobalConfig (IConfiguration config, 
                 exclusionPatterns)
    
    
    
  Dump the global configuration filtered from some objects.
    
    | Parameters | 
|---|
      
        | config | IConfiguration | 
      
        | exclusionPatterns |  | 
    
    
      
  
 
    getJava
    
protected String getJava ()
    
    
    
  
    
 
 
 
  
  
 
  
    
    
      
    
    
  
       
    
    
  
  
  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 2024-12-09 UTC.
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-09 UTC."],[],[]]