Android-cuttlefish cvd tool
|
#include <instance_database_helper.h>
Classes | |
struct | SetupError |
Protected Types | |
enum class | ErrorCode : std::int32_t { kOk , kFileError , kInstanceDabaseError } |
Protected Member Functions | |
CvdInstanceDatabaseTest () | |
~CvdInstanceDatabaseTest () | |
bool | SetUpOk () const |
const std::string & | Workspace () const |
const std::string & | HostArtifactsPath () const |
bool | AddGroup (const std::string &base_name, const std::vector< cvd::Instance > &instances) |
InstanceDatabase & | GetDb () |
const SetupError & | Error () const |
Private Member Functions | |
void | ClearWorkspace () |
bool | InitWorkspace () |
bool | InitMockAndroidHostOut () |
void | SetErrorCode (ErrorCode error_code, const std::string &msg) |
Private Attributes | |
std::string | android_artifacts_path_ |
std::string | workspace_dir_ |
SetupError | error_ |
std::string | db_backing_path_ |
int | db_backing_fd_ |
InstanceDatabase | db_ |
Creates n mock HOME directories, one per group. Also, creates 1 mock ANDROID_HOST_OUT with a mock launcher file.
The test suite is to assess InstanceDatabase APIs such as adding groups, adding instances to the groups, etc. The thing is that the InstanceDatabase APIs will check if HOME and/or ANDROID_HOST_OUT are directories. Also, for ANDROID_HOST_OUT, as a bare minimum validity check, it will see if there is a launcher file under the bin directory of it.
Thus, the mock environment should prepare an actual directories with a mock launcher file(s). In case the test runs/tests in the suite run in parallel, we give each test run a unique directory, and that's why all mock homes are under a temp directory created by mkdtemp()
|
strongprotected |
|
protected |
|
protected |
|
protected |
|
private |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
private |
|
private |
|
private |
|
inlineprotected |
|
inlineprotected |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |