You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by eo...@apache.org on 2023/02/13 15:27:19 UTC
[zookeeper] branch branch-3.6 updated: [ZOOKEEPER-4674] TestReadOnlyClient.cc: Stop/start "normal" server in test setUp/tearDown (#1983)
This is an automated email from the ASF dual-hosted git repository.
eolivelli pushed a commit to branch branch-3.6
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
The following commit(s) were added to refs/heads/branch-3.6 by this push:
new 9b7cadf15 [ZOOKEEPER-4674] TestReadOnlyClient.cc: Stop/start "normal" server in test setUp/tearDown (#1983)
9b7cadf15 is described below
commit 9b7cadf15c95ca3ff32cbdee26d071b67e06d8a1
Author: Enrico Olivelli <eo...@apache.org>
AuthorDate: Mon Feb 13 16:26:27 2023 +0100
[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)
---
.../zookeeper-client-c/tests/TestReadOnlyClient.cc | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
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() {