Statistics
| Branch: | Tag: | Revision:

one / include / test / NebulaTest.h @ ae53d437

History | View | Annotate | Download (5.41 KB)

1
/* -------------------------------------------------------------------------- */
2
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org)             */
3
/*                                                                            */
4
/* Licensed under the Apache License, Version 2.0 (the "License"); you may    */
5
/* not use this file except in compliance with the License. You may obtain    */
6
/* a copy of the License at                                                   */
7
/*                                                                            */
8
/* http://www.apache.org/licenses/LICENSE-2.0                                 */
9
/*                                                                            */
10
/* Unless required by applicable law or agreed to in writing, software        */
11
/* distributed under the License is distributed on an "AS IS" BASIS,          */
12
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   */
13
/* See the License for the specific language governing permissions and        */
14
/* limitations under the License.                                             */
15
/* -------------------------------------------------------------------------- */
16

    
17
#ifndef NEBULA_TEST_H_
18
#define NEBULA_TEST_H_
19

    
20
#include "SqlDB.h"
21

    
22
#include "NebulaTemplate.h"
23

    
24
#include "VirtualMachinePool.h"
25
#include "VirtualNetworkPool.h"
26
#include "HostPool.h"
27
#include "UserPool.h"
28
#include "ClusterPool.h"
29
#include "VMTemplatePool.h"
30

    
31
#include "VirtualMachineManager.h"
32
#include "LifeCycleManager.h"
33
#include "InformationManager.h"
34
#include "TransferManager.h"
35
#include "DispatchManager.h"
36
#include "RequestManager.h"
37
#include "HookManager.h"
38
#include "AuthManager.h"
39
#include "ImageManager.h"
40

    
41
class NebulaTest
42
{
43
protected:
44

    
45
    NebulaTest():mysql(false), need_host_pool(false), need_vm_pool(false),
46
                need_vnet_pool(false), need_image_pool(false), 
47
                need_user_pool(false), need_cluster_pool(false),
48
                need_template_pool(false), need_group_pool(false),
49
                need_vmm(false),
50
                need_im(false), need_tm(false),
51
                need_lcm(false), need_dm(false),
52
                need_rm(false), need_hm(false),
53
                need_authm(false)
54
    {};
55

    
56
    virtual ~NebulaTest(){};
57

    
58
    static NebulaTest * the_tester; /*<< Pointer to the actual tester */
59

    
60
public:
61
    bool mysql;
62

    
63
    bool need_host_pool;
64
    bool need_vm_pool;
65
    bool need_vnet_pool;
66
    bool need_image_pool;
67
    bool need_user_pool;
68
    bool need_cluster_pool;
69
    bool need_template_pool;
70
    bool need_group_pool;
71

    
72
    bool need_vmm;
73
    bool need_im;
74
    bool need_tm;
75
    bool need_lcm;
76
    bool need_dm;
77
    bool need_rm;
78
    bool need_hm;
79
    bool need_authm;
80
    bool need_imagem;
81

    
82
    static NebulaTest * instance()
83
    {
84
        return the_tester;
85
    };
86

    
87
    // ------------------------------------------------------------------------
88
    // Pools
89
    // ------------------------------------------------------------------------
90

    
91
    virtual VirtualMachinePool* create_vmpool(SqlDB* db, string hook_location);
92

    
93
    virtual HostPool* create_hpool(SqlDB* db, string hook_location);
94

    
95
    virtual VirtualNetworkPool* create_vnpool(SqlDB* db,
96
                                               string mac_prefix, 
97
                                               int    size);
98

    
99
    virtual UserPool* create_upool(SqlDB* db);
100

    
101
    virtual ImagePool* create_ipool( SqlDB* db,
102
                                    string default_image_type,
103
                                    string default_device_prefix);
104

    
105
    virtual ClusterPool* create_cpool(SqlDB* db);
106

    
107
    virtual VMTemplatePool* create_tpool(SqlDB* db);
108

    
109
    virtual GroupPool* create_gpool(SqlDB* db);
110

    
111
    // ------------------------------------------------------------------------
112
    // Managers
113
    // ------------------------------------------------------------------------
114

    
115
    virtual VirtualMachineManager* create_vmm(VirtualMachinePool* vmpool,
116
                                             HostPool*           hpool,
117
                                             time_t              timer_period,
118
                                             time_t              poll_period);
119

    
120
    virtual LifeCycleManager* create_lcm(VirtualMachinePool* vmpool,
121
                                         HostPool* hpool);
122

    
123
    virtual InformationManager* create_im(HostPool*   hpool,
124
                                          time_t      timer_period,
125
                                          string      remotes_location);
126

    
127
    virtual TransferManager* create_tm(VirtualMachinePool* vmpool,
128
                                       HostPool*           hpool);
129

    
130
    virtual DispatchManager* create_dm(VirtualMachinePool* vmpool,
131
                                       HostPool*           hpool);
132

    
133
    virtual RequestManager* create_rm(
134
                    VirtualMachinePool *    vmpool,
135
                    HostPool *              hpool,
136
                    VirtualNetworkPool *    vnpool,
137
                    UserPool           *    upool,
138
                    ImagePool          *    ipool,
139
                    ClusterPool        *    cpool,
140
                    VMTemplatePool     *    tpool,
141
                    GroupPool          *    gpool,
142
                    string                  log_file);
143

    
144
    virtual HookManager* create_hm(VirtualMachinePool * vmpool);
145

    
146
    virtual AuthManager* create_authm(time_t timer_period);
147

    
148
    virtual ImageManager* create_imagem(ImagePool * ipool);
149
};
150

    
151
#endif /*NEBULA_TEST_H_*/