Motr  M0
spiel_ut_common.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-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 #pragma once
23 
24 #ifndef __MOTR_SPIEL_UT_SPIEL_UT_COMMON_H__
25 #define __MOTR_SPIEL_UT_SPIEL_UT_COMMON_H__
26 
27 #include "net/net.h" /* m0_net_domain */
28 #include "net/buffer_pool.h" /* m0_net_buffer_pool */
29 #include "reqh/reqh.h" /* m0_reqh */
30 #include "rpc/rpc_machine.h" /* m0_rpc_machine */
31 #include "rpc/rpclib.h" /* m0_rpc_server_ctx */
32 #include "rm/rm_service.h" /* m0_rms_type */
33 
34 #define SERVER_ENDPOINT_ADDR "0@lo:12345:34:1"
35 #define SERVER_ENDPOINT M0_NET_XPRT_PREFIX_DEFAULT":"SERVER_ENDPOINT_ADDR
36 #define CLIENT_ENDPOINT_ADDR "0@lo:12345:34:*"
37 
38 struct m0_spiel;
39 
40 extern const char *confd_addr[];
41 extern const char *rm_addr;
42 
51  struct m0_reqh sur_reqh;
54 };
55 
56 M0_INTERNAL int m0_spiel__ut_reqh_init(struct m0_spiel_ut_reqh *spl_reqh,
57  const char *ep_addr);
58 
59 M0_INTERNAL void m0_spiel__ut_reqh_fini(struct m0_spiel_ut_reqh *spl_reqh);
60 
61 M0_INTERNAL int m0_spiel__ut_rpc_server_start(struct m0_rpc_server_ctx *rpc_srv,
62  const char *confd_ep,
63  const char *confdb_path);
64 
65 M0_INTERNAL void m0_spiel__ut_rpc_server_stop(
66  struct m0_rpc_server_ctx *rpc_srv);
67 
68 M0_INTERNAL void m0_spiel__ut_init(struct m0_spiel *spiel,
69  const char *confd_path,
70  bool cmd_iface);
71 
72 M0_INTERNAL void m0_spiel__ut_fini(struct m0_spiel *spiel,
73  bool cmd_iface);
74 
75 #endif /* __MOTR_SPIEL_UT_SPIEL_UT_COMMON_H__ */
76 /*
77  * Local variables:
78  * c-indentation-style: "K&R"
79  * c-basic-offset: 8
80  * tab-width: 8
81  * fill-column: 80
82  * scroll-step: 1
83  * End:
84  */
static const char * ep_addr
Definition: rpc_machine.c:35
M0_INTERNAL void m0_spiel__ut_init(struct m0_spiel *spiel, const char *confd_path, bool cmd_iface)
struct m0_rpc_server_ctx sur_confd_srv
const char * rm_addr
M0_INTERNAL int m0_spiel__ut_rpc_server_start(struct m0_rpc_server_ctx *rpc_srv, const char *confd_ep, const char *confdb_path)
M0_INTERNAL void m0_spiel__ut_reqh_fini(struct m0_spiel_ut_reqh *spl_reqh)
M0_INTERNAL void m0_spiel__ut_fini(struct m0_spiel *spiel, bool cmd_iface)
struct m0_reqh sur_reqh
M0_INTERNAL int m0_spiel__ut_reqh_init(struct m0_spiel_ut_reqh *spl_reqh, const char *ep_addr)
struct m0_net_domain sur_net_dom
Definition: reqh.h:94
const char * confd_addr[]
static struct m0_spiel_ut_reqh * spl_reqh
Definition: spiel_ut.c:31
struct m0_rpc_machine sur_rmachine
struct m0_spiel spiel
Definition: spiel_conf_ut.c:42
M0_INTERNAL void m0_spiel__ut_rpc_server_stop(struct m0_rpc_server_ctx *rpc_srv)
struct m0_net_buffer_pool sur_buf_pool