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:27:10 +0100 |
commit | 9b7cadf15c95ca3ff32cbdee26d071b67e06d8a1 (patch) | |
tree | 2cab687dd4cf88cc85f47ca31a3f27c094c506ce | |
parent | 9a197f7adba1992f154ede96dabf8bc2ca3b003c (diff) | |
download | zookeeper-branch-3.6.tar.gz |
[ZOOKEEPER-4674] TestReadOnlyClient.cc: Stop/start "normal" server in test setUp/tearDown (#1983)branch-3.6
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() { |