diff options
author | Enrico Olivelli <eolivelli@apache.org> | 2023-02-13 16:26:27 +0100 |
---|---|---|
committer | Enrico Olivelli <eolivelli@apache.org> | 2023-02-13 16:26:47 +0100 |
commit | 08599057673986555b77eca9d0a224b8c0e41bc7 (patch) | |
tree | 2a1a1787e97bc9cbf7249876f4b78fe4cb278446 | |
parent | e7fdb4bb72211c1cdae92eaaa6217334648093f8 (diff) | |
download | zookeeper-08599057673986555b77eca9d0a224b8c0e41bc7.tar.gz |
[ZOOKEEPER-4674] TestReadOnlyClient.cc: Stop/start "normal" server in test setUp/tearDown (#1983)
Co-authored-by: Damien Diederen <dd@crosstwine.com>
(cherry picked from commit 2d1bac7e077f49a7149d3fb878a2c73b9e627f6e)
-rw-r--r-- | zookeeper-client/zookeeper-client-c/tests/TestReadOnlyClient.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/zookeeper-client/zookeeper-client-c/tests/TestReadOnlyClient.cc b/zookeeper-client/zookeeper-client-c/tests/TestReadOnlyClient.cc index 0d4d579f4..e864ef266 100644 --- a/zookeeper-client/zookeeper-client-c/tests/TestReadOnlyClient.cc +++ b/zookeeper-client/zookeeper-client-c/tests/TestReadOnlyClient.cc @@ -71,6 +71,24 @@ public: void setUp() { zoo_set_log_stream(logfile); zoo_set_debug_level(ZOO_LOG_LEVEL_DEBUG); + stopServer(); + } + + void tearDown() + { + startServer(); + } + + void startServer() { + char cmd[1024]; + sprintf(cmd, "%s start %s", ZKSERVER_CMD, "127.0.0.1:22181"); + CPPUNIT_ASSERT(system(cmd) == 0); + } + + void stopServer() { + char cmd[1024]; + sprintf(cmd, "%s stop %s", ZKSERVER_CMD, "127.0.0.1:22181"); + CPPUNIT_ASSERT(system(cmd) == 0); } void startReadOnly() { |