1 // : vi ts=4 sw=4 noet :
3 ==================================================================================
4 Copyright (c) 2019 Nokia
5 Copyright (c) 2018-2019 AT&T Intellectual Property.
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ==================================================================================
23 Mnemonic: tools_testh.c
24 Abstract: Unit tests for the RMr tools module.
25 Author: E. Scott Daniels
39 #include <semaphore.h>
42 #include "rmr_agnostic.h"
43 #include "test_support.c" // our private library of test tools
45 // ===== dummy context for tools testing so we don't have to pull in all of the nano/nng specific stuff =====
47 char* my_name; // dns name of this host to set in sender field of a message
48 int shutdown; // thread notification if we need to tell them to stop
49 int max_mlen; // max message length payload+header
50 int max_plen; // max payload length
51 int flags; // CTXFL_ constants
52 int nrtele; // number of elements in the routing table
53 int send_retries; // number of retries send_msg() should attempt if eagain/timeout indicated by nng
54 //nng_socket nn_sock; // our general listen socket
55 route_table_t* rtable; // the active route table
56 route_table_t* old_rtable; // the previously used rt, sits here to allow for draining
57 route_table_t* new_rtable; // route table under construction
58 if_addrs_t* ip_list; // list manager of the IP addresses that are on our known interfaces
59 void* mring; // ring where msgs are queued while waiting for a call response msg
61 char* rtg_addr; // addr/port of the route table generation publisher
62 int rtg_port; // the port that the rtg listens on
64 wh_mgt_t* wormholes; // management of user opened wormholes
65 //epoll_stuff_t* eps; // epoll information needed for the rcv with timeout call
67 //pthread_t rtc_th; // thread info for the rtc listener
71 #include "tools_static.c"
73 #include "tools_static_test.c"
76 fprintf( stderr, ">>>> starting tools_test\n" );
77 return tools_test() > 0;