Motr  M0
common_service.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2012-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
23 #pragma once
24 #ifndef __MOTR_CM_UT_COMMON_SERVICE_H__
25 #define __MOTR_CM_UT_COMMON_SERVICE_H__
26 
27 #include "cm/cm.h"
28 #include "cm/cp.h"
29 #include "cm/ag.h"
30 #include "lib/misc.h"
31 #include "lib/finject.h"
32 #include "lib/memory.h"
33 #include "ut/ut.h"
34 #include "lib/chan.h"
35 #include "reqh/reqh.h"
36 #include "reqh/reqh_service.h"
37 #include "motr/setup.h"
38 #include "ut/ut_rpc_machine.h"
39 
40 #define DUMMY_DBNAME "dummy-db"
41 #define DUMMY_COB_ID 20
42 #define DUMMY_SERVER_ADDR "0@lo:12345:34:10"
43 
44 extern struct m0_cm_cp cm_ut_cp;
45 extern struct m0_reqh_service *cm_ut_service;
47 
48 enum {
49  AG_ID_NR = 100,
52 };
53 
54 struct m0_ut_cm {
55  uint64_t ut_cm_id;
56  struct m0_cm ut_cm;
59 };
60 
61 extern struct m0_reqh cm_ut_reqh;
62 extern struct m0_cm_cp cm_ut_cp;
63 extern struct m0_ut_cm cm_ut[MAX_CM_NR];
65 extern struct m0_mutex cm_wait_mutex;
66 extern struct m0_chan cm_wait;
67 
68 extern struct m0_cm_type cm_ut_cmt;
69 extern const struct m0_cm_aggr_group_ops cm_ag_ut_ops;
70 extern uint64_t ut_cm_id;
71 extern bool test_ready_fop;
72 
75 
76 #endif
77 /*
78  * Local variables:
79  * c-indentation-style: "K&R"
80  * c-basic-offset: 8
81  * tab-width: 8
82  * fill-column: 80
83  * scroll-step: 1
84  * End:
85  */
bool test_ready_fop
struct m0_reqh_service * cm_ut_service
struct m0_chan cm_wait
const struct m0_cm_aggr_group_ops cm_ag_ut_ops
Definition: cp.h:160
struct m0_cm ut_cm
struct m0_chan ut_cm_wait
uint64_t ut_cm_id
struct m0_mutex ut_cm_wait_mutex
struct m0_ut_rpc_mach_ctx cmut_rmach_ctx
struct m0_reqh cm_ut_reqh
struct m0_cm_type cm_ut_cmt
struct m0_cm_cp cm_ut_cp
struct m0_ut_cm cm_ut[MAX_CM_NR]
Definition: reqh.h:94
Definition: chan.h:229
void cm_ut_service_alloc_init(struct m0_reqh *reqh)
void cm_ut_service_cleanup()
uint64_t ut_cm_id
struct m0_mutex cm_wait_mutex
Definition: cm.h:143
struct m0_reqh reqh
Definition: rm_foms.c:48
Definition: cm.h:166
Definition: mutex.h:47