test.cpp
Go to the documentation of this file.
1 //
2 // Bareflank Hypervisor
3 //
4 // Copyright (C) 2015 Assured Information Security, Inc.
5 // Author: Rian Quinn <quinnr@ainfosec.com>
6 // Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22 #include <test.h>
23 
25 {
26 }
27 
28 bool
30 {
31  return true;
32 }
33 
34 bool
36 {
37  return true;
38 }
39 
40 bool
42 {
43  this->test_entry_valid();
44  this->test_entry_throws_general_exception();
45  this->test_entry_throws_standard_exception();
46  this->test_entry_throws_any_exception();
47 
48  this->test_vm_exit_reason_unknown();
49  this->test_vm_exit_reason_cpuid();
50  this->test_vm_exit_reason_invd();
51  this->test_vm_exit_reason_vmcall_invalid_opcode();
52  this->test_vm_exit_reason_vmcall_invalid_magic();
53  this->test_vm_exit_reason_vmcall_protocol_version();
54  this->test_vm_exit_reason_vmcall_bareflank_version();
55  this->test_vm_exit_reason_vmcall_user_version();
56  this->test_vm_exit_reason_vmcall_unknown_version();
57  this->test_vm_exit_reason_vmcall_registers();
58  this->test_vm_exit_reason_vmcall_unittest();
59  this->test_vm_exit_reason_vmcall_event();
60  this->test_vm_exit_reason_vmcall_start();
61  this->test_vm_exit_reason_vmcall_stop();
62  this->test_vm_exit_reason_vmcall_data_unknown();
63  this->test_vm_exit_reason_vmcall_data_string_unformatted_input_nullptr();
64  this->test_vm_exit_reason_vmcall_data_string_unformatted_output_nullptr();
65  this->test_vm_exit_reason_vmcall_data_string_unformatted_input_size_0();
66  this->test_vm_exit_reason_vmcall_data_string_unformatted_output_size_0();
67  this->test_vm_exit_reason_vmcall_data_string_unformatted_output_size_too_small();
68  this->test_vm_exit_reason_vmcall_data_string_unformatted_input_size_too_big();
69  this->test_vm_exit_reason_vmcall_data_string_unformatted_output_size_too_big();
70  this->test_vm_exit_reason_vmcall_data_string_unformatted_map_fails();
71  this->test_vm_exit_reason_vmcall_data_string_unformatted_success();
72  this->test_vm_exit_reason_vmcall_data_string_json_input_nullptr();
73  this->test_vm_exit_reason_vmcall_data_string_json_output_nullptr();
74  this->test_vm_exit_reason_vmcall_data_string_json_input_size_0();
75  this->test_vm_exit_reason_vmcall_data_string_json_output_size_0();
76  this->test_vm_exit_reason_vmcall_data_string_json_output_size_too_small();
77  this->test_vm_exit_reason_vmcall_data_string_json_input_size_too_big();
78  this->test_vm_exit_reason_vmcall_data_string_json_output_size_too_big();
79  this->test_vm_exit_reason_vmcall_data_string_json_map_fails();
80  this->test_vm_exit_reason_vmcall_data_string_json_invalid();
81  this->test_vm_exit_reason_vmcall_data_string_json_success();
82  this->test_vm_exit_reason_vmcall_data_data_unformatted_input_nullptr();
83  this->test_vm_exit_reason_vmcall_data_data_unformatted_output_nullptr();
84  this->test_vm_exit_reason_vmcall_data_data_unformatted_input_size_0();
85  this->test_vm_exit_reason_vmcall_data_data_unformatted_output_size_0();
86  this->test_vm_exit_reason_vmcall_data_data_unformatted_output_size_too_small();
87  this->test_vm_exit_reason_vmcall_data_data_unformatted_input_size_too_big();
88  this->test_vm_exit_reason_vmcall_data_data_unformatted_output_size_too_big();
89  this->test_vm_exit_reason_vmcall_data_data_unformatted_map_fails();
90  this->test_vm_exit_reason_vmcall_data_data_unformatted_success();
91  this->test_vm_exit_reason_vmxoff();
92  this->test_vm_exit_reason_rdmsr_debug_ctl();
93  this->test_vm_exit_reason_rdmsr_pat();
94  this->test_vm_exit_reason_rdmsr_efer();
95  this->test_vm_exit_reason_rdmsr_perf();
96  this->test_vm_exit_reason_rdmsr_cs();
97  this->test_vm_exit_reason_rdmsr_esp();
98  this->test_vm_exit_reason_rdmsr_eip();
99  this->test_vm_exit_reason_rdmsr_fs_base();
100  this->test_vm_exit_reason_rdmsr_gs_base();
101  this->test_vm_exit_reason_rdmsr_default();
102  this->test_vm_exit_reason_rdmsr_ignore();
103  this->test_vm_exit_reason_wrmsr_debug_ctrl();
104  this->test_vm_exit_reason_wrmsr_pat();
105  this->test_vm_exit_reason_wrmsr_efer();
106  this->test_vm_exit_reason_wrmsr_perf();
107  this->test_vm_exit_reason_wrmsr_cs();
108  this->test_vm_exit_reason_wrmsr_esp();
109  this->test_vm_exit_reason_wrmsr_eip();
110  this->test_vm_exit_reason_wrmsr_fs_base();
111  this->test_vm_exit_reason_wrmsr_gs_base();
112  this->test_vm_exit_reason_wrmsr_default();
113  this->test_vm_exit_failure_check();
114  this->test_halt();
115 
116  return true;
117 }
118 
119 int
120 main(int argc, char *argv[])
121 {
123 }
int main(int argc, char *argv[])
Definition: test.cpp:221
bool init() override
Definition: test.cpp:29
#define RUN_ALL_TESTS(ut)
Definition: unittest.h:246
bool fini() override
Definition: test.cpp:35
bool list() override
Definition: test.cpp:41