Skip to content

Commit 4fcf213

Browse files
committed
tests: add simple clush --topology test
1 parent 1fae9c5 commit 4fcf213

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/CLIClushTest.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,3 +880,28 @@ def test_301_fifo_stdin(self):
880880
s = "%s: ok\n" % HOSTNAME
881881
self._clush_t(["-w", HOSTNAME, "-v", "echo ok"], None,
882882
s.encode(), 0, b"")
883+
884+
885+
class CLIClushTest_E_Topology(unittest.TestCase):
886+
"""Unit test class for testing CLI/Clush.py with --topology"""
887+
888+
def setUp(self):
889+
self.topofile = make_temp_file(dedent("""
890+
[Main]
891+
%s: localhost
892+
localhost: remote-node"""% HOSTNAME).encode())
893+
894+
def tearDown(self):
895+
self.topofile = None
896+
897+
def _clush_t(self, args, stdin, expected_stdout, expected_rc=0,
898+
expected_stderr=None):
899+
CLI_main(self, main, ['clush'] + args, stdin, expected_stdout,
900+
expected_rc, expected_stderr)
901+
902+
@unittest.skipIf(HOSTNAME == 'localhost', "does not work with hostname set to 'localhost'")
903+
def test_300_topology(self):
904+
"""test clush --topology"""
905+
# GH#560: to detect set!=NodeSet for gwtargets
906+
self._clush_t(["--topology", self.topofile.name,
907+
"-w", "remote-node", "-b", "-v", "sleep 1; echo ok"], None, b"", 0, b"")

0 commit comments

Comments
 (0)