40 m_dummy_add_md_failure(nullptr),
41 m_dummy_add_md_success(nullptr),
42 m_dummy_get_drr_failure(nullptr),
43 m_dummy_get_drr_success(nullptr),
44 m_dummy_misc(nullptr),
45 m_dummy_start_vmm_failure(nullptr),
46 m_dummy_start_vmm_success(nullptr),
47 m_dummy_stop_vmm_failure(nullptr),
48 m_dummy_stop_vmm_success(nullptr),
49 m_dummy_add_md_failure_length(0),
50 m_dummy_add_md_success_length(0),
51 m_dummy_get_drr_failure_length(0),
52 m_dummy_get_drr_success_length(0),
53 m_dummy_misc_length(0),
54 m_dummy_start_vmm_failure_length(0),
55 m_dummy_start_vmm_success_length(0),
56 m_dummy_stop_vmm_failure_length(0),
57 m_dummy_stop_vmm_success_length(0)
74 m_dummy_add_md_failure_length =
static_cast<uint64_t
>(dummy_add_md_failure_ifs.tellg());
75 m_dummy_add_md_success_length =
static_cast<uint64_t
>(dummy_add_md_success_ifs.tellg());
76 m_dummy_get_drr_failure_length =
static_cast<uint64_t
>(dummy_get_drr_failure_ifs.tellg());
77 m_dummy_get_drr_success_length =
static_cast<uint64_t
>(dummy_get_drr_success_ifs.tellg());
78 m_dummy_misc_length =
static_cast<uint64_t
>(dummy_misc_ifs.tellg());
79 m_dummy_start_vmm_failure_length =
static_cast<uint64_t
>(dummy_start_vmm_failure_ifs.tellg());
80 m_dummy_start_vmm_success_length =
static_cast<uint64_t
>(dummy_start_vmm_success_ifs.tellg());
81 m_dummy_stop_vmm_failure_length =
static_cast<uint64_t
>(dummy_stop_vmm_failure_ifs.tellg());
82 m_dummy_stop_vmm_success_length =
static_cast<uint64_t
>(dummy_stop_vmm_success_ifs.tellg());
84 m_dummy_add_md_failure = std::make_unique<char[]>(m_dummy_add_md_failure_length);
85 m_dummy_add_md_success = std::make_unique<char[]>(m_dummy_add_md_success_length);
86 m_dummy_get_drr_failure = std::make_unique<char[]>(m_dummy_get_drr_failure_length);
87 m_dummy_get_drr_success = std::make_unique<char[]>(m_dummy_get_drr_success_length);
88 m_dummy_misc = std::make_unique<char[]>(m_dummy_misc_length);
89 m_dummy_start_vmm_failure = std::make_unique<char[]>(m_dummy_start_vmm_failure_length);
90 m_dummy_start_vmm_success = std::make_unique<char[]>(m_dummy_start_vmm_success_length);
91 m_dummy_stop_vmm_failure = std::make_unique<char[]>(m_dummy_stop_vmm_failure_length);
92 m_dummy_stop_vmm_success = std::make_unique<char[]>(m_dummy_stop_vmm_success_length);
94 dummy_add_md_failure_ifs.seekg(0);
95 dummy_add_md_success_ifs.seekg(0);
96 dummy_get_drr_failure_ifs.seekg(0);
97 dummy_get_drr_success_ifs.seekg(0);
98 dummy_misc_ifs.seekg(0);
99 dummy_start_vmm_failure_ifs.seekg(0);
100 dummy_start_vmm_success_ifs.seekg(0);
101 dummy_stop_vmm_failure_ifs.seekg(0);
102 dummy_stop_vmm_success_ifs.seekg(0);
104 dummy_add_md_failure_ifs.read(m_dummy_add_md_failure.get(),
static_cast<int64_t
>(m_dummy_add_md_failure_length));
105 dummy_add_md_success_ifs.read(m_dummy_add_md_success.get(),
static_cast<int64_t
>(m_dummy_add_md_success_length));
106 dummy_get_drr_failure_ifs.read(m_dummy_get_drr_failure.get(),
static_cast<int64_t
>(m_dummy_get_drr_failure_length));
107 dummy_get_drr_success_ifs.read(m_dummy_get_drr_success.get(),
static_cast<int64_t
>(m_dummy_get_drr_success_length));
108 dummy_misc_ifs.read(m_dummy_misc.get(),
static_cast<int64_t
>(m_dummy_misc_length));
109 dummy_start_vmm_failure_ifs.read(m_dummy_start_vmm_failure.get(),
static_cast<int64_t
>(m_dummy_start_vmm_failure_length));
110 dummy_start_vmm_success_ifs.read(m_dummy_start_vmm_success.get(),
static_cast<int64_t
>(m_dummy_start_vmm_success_length));
111 dummy_stop_vmm_failure_ifs.read(m_dummy_stop_vmm_failure.get(),
static_cast<int64_t
>(m_dummy_stop_vmm_failure_length));
112 dummy_stop_vmm_success_ifs.read(m_dummy_stop_vmm_success.get(),
static_cast<int64_t
>(m_dummy_stop_vmm_success_length));
126 this->test_common_init();
128 this->test_common_fini_unloaded();
129 this->test_common_fini_successful_start();
130 this->test_common_fini_successful_load();
131 this->test_common_fini_successful_add_module();
132 this->test_common_fini_corrupted();
133 this->test_common_fini_failed_load();
134 this->test_common_fini_failed_start();
135 this->test_common_fini_unload_failed();
136 this->test_common_fini_stop_failed();
137 this->test_common_fini_reset_failed();
139 this->test_common_add_module_invalid_file();
140 this->test_common_add_module_invalid_file_size();
141 this->test_common_add_module_garbage_module();
142 this->test_common_add_module_add_when_already_loaded();
143 this->test_common_add_module_add_when_already_running();
144 this->test_common_add_module_add_when_corrupt();
145 this->test_common_add_module_add_too_many();
146 this->test_common_add_module_platform_alloc_fails();
147 this->test_common_add_module_load_elf_fails();
149 this->test_common_load_successful_load();
150 this->test_common_load_load_when_already_loaded();
151 this->test_common_load_load_when_already_running();
152 this->test_common_load_load_when_corrupt();
153 this->test_common_load_fail_due_to_relocation_error();
154 this->test_common_load_fail_due_to_no_modules_added();
155 this->test_common_load_add_md_failed();
156 this->test_common_load_add_md_tls_failed();
157 this->test_common_load_tls_platform_alloc_failed();
158 this->test_common_load_stack_platform_alloc_failed();
159 this->test_common_load_loader_add_failed();
160 this->test_common_load_resolve_symbol_failed();
161 this->test_common_load_execute_symbol_failed();
163 this->test_common_unload_unload_when_already_unloaded();
164 this->test_common_unload_unload_when_running();
165 this->test_common_unload_unload_when_corrupt();
166 this->test_common_unload_execute_symbol_failed();
168 this->test_common_start_start_when_unloaded();
169 this->test_common_start_start_when_already_running();
170 this->test_common_start_start_when_corrupt();
171 this->test_common_start_start_when_start_vmm_missing();
172 this->test_common_start_start_vmm_failure();
173 this->test_common_start_set_affinity_failed();
174 this->test_common_start_vmcall_failed();
176 this->test_common_stop_stop_when_unloaded();
177 this->test_common_stop_stop_when_not_running();
178 this->test_common_stop_stop_when_alread_stopped();
179 this->test_common_stop_stop_when_corrupt();
180 this->test_common_stop_stop_vmm_missing();
181 this->test_common_stop_stop_vmm_failure();
182 this->test_common_stop_set_affinity_failed();
183 this->test_common_stop_vmcall_failed();
185 this->test_common_dump_invalid_drr();
186 this->test_common_dump_invalid_vcpuid();
187 this->test_common_dump_dump_when_unloaded();
188 this->test_common_dump_dump_when_corrupt();
189 this->test_common_dump_dump_when_loaded();
190 this->test_common_dump_get_drr_missing();
191 this->test_common_dump_get_drr_failure();
193 this->test_common_vmcall_invalid_args();
194 this->test_common_vmcall_set_affinity_failure();
195 this->test_common_vmcall_success();
196 this->test_common_vmcall_success_event();
197 this->test_common_vmcall_vmcall_when_unloaded();
198 this->test_common_vmcall_vmcall_when_corrupt();
199 this->test_common_vmcall_vmcall_when_loaded();
201 this->test_helper_common_vmm_status();
202 this->test_helper_get_file_invalid_index();
203 this->test_helper_get_file_success();
204 this->test_helper_symbol_length_null_symbol();
205 this->test_helper_symbol_length_success();
206 this->test_helper_resolve_symbol_invalid_name();
207 this->test_helper_resolve_symbol_invalid_sym();
208 this->test_helper_resolve_symbol_no_loaded_modules();
209 this->test_helper_resolve_symbol_missing_symbol();
210 this->test_helper_execute_symbol_invalid_arg();
211 this->test_helper_execute_symbol_missing_symbol();
212 this->test_helper_execute_symbol_sym_failed();
213 this->test_helper_execute_symbol_sym_success();
214 this->test_helper_add_md_to_memory_manager_null_module();
215 this->test_helper_load_elf_file_null_module();
int main(int argc, char *argv[])
const auto c_dummy_stop_vmm_failure_filename
const auto c_dummy_stop_vmm_success_filename
const auto c_dummy_add_md_failure_filename
int verify_no_mem_leaks(void)
#define RUN_ALL_TESTS(ut)
const auto c_dummy_get_drr_success_filename
const auto c_dummy_start_vmm_success_filename
const auto c_dummy_add_md_success_filename
const auto c_dummy_start_vmm_failure_filename
const auto c_dummy_get_drr_failure_filename
const auto c_dummy_misc_filename