test.h
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 #ifndef TEST_H
23 #define TEST_H
24 
25 #include <unittest.h>
26 
27 class vmxon_ut : public unittest
28 {
29 public:
30 
31  vmxon_ut();
32  ~vmxon_ut() override = default;
33 
34 protected:
35 
36  bool init() override;
37  bool fini() override;
38  bool list() override;
39 
40 private:
41 
42  void test_start_success();
43  void test_start_start_twice();
44  void test_start_execute_vmxon_already_on_failure();
45  void test_start_execute_vmxon_failure();
46  void test_start_check_ia32_vmx_cr4_fixed0_msr_failure();
47  void test_start_check_ia32_vmx_cr4_fixed1_msr_failure();
48  void test_start_enable_vmx_operation_failure();
49  void test_start_v8086_disabled_failure();
50  void test_start_check_ia32_feature_control_msr_lock_bit_clear();
51  void test_start_check_ia32_feature_control_msr_lock_bit_set();
52  void test_start_check_ia32_vmx_cr0_fixed0_msr();
53  void test_start_check_ia32_vmx_cr0_fixed1_msr();
54  void test_start_check_vmx_capabilities_msr_memtype_failure();
55  void test_start_check_vmx_capabilities_msr_addr_width_failure();
56  void test_start_check_vmx_capabilities_true_based_controls_failure();
57  void test_start_check_cpuid_vmx_supported_failure();
58  void test_start_virt_to_phys_failure();
59  void test_stop_success();
60  void test_stop_stop_twice();
61  void test_stop_vmxoff_check_failure();
62  void test_stop_vmxoff_failure();
63 };
64 
65 #endif
bool init() override
Definition: test.cpp:30
Definition: test.h:27
bool fini() override
Definition: test.cpp:36
~vmxon_ut() override=default
vmxon_ut()
Definition: test.cpp:25
bool list() override
Definition: test.cpp:42