Skip to content

Commit

Permalink
CBQE-2304 fix case that adds 1 more node to rebalance
Browse files Browse the repository at this point in the history
so total node more than nodes_init and we could collect more nodes than initial nodes

Change-Id: I30586dc4dd4c8a2aa8684e998dfcc9e6729a00d8
Reviewed-on: http://review.couchbase.org/39332
Reviewed-by: Thuan Nguyen <soccon@gmail.com>
Tested-by: Thuan Nguyen <soccon@gmail.com>
  • Loading branch information
saigon committed Jul 12, 2014
1 parent 4d39515 commit aa1aa4e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pytests/cwc/cwctests.py
@@ -1,12 +1,11 @@
import json
import time import time
import unittest import unittest
import random import random
import testconstants import testconstants
from TestInput import TestInputSingleton from TestInput import TestInputSingleton


from cwc.cwc_base import CWCBaseTest from cwc.cwc_base import CWCBaseTest
from membase.api.rest_client import RestConnection, Bucket from membase.api.rest_client import RestConnection
from remote.remote_util import RemoteMachineShellConnection from remote.remote_util import RemoteMachineShellConnection




Expand All @@ -28,8 +27,7 @@ def tearDown(self):
def test_start_collect_log_without_upload(self): def test_start_collect_log_without_upload(self):
rest = RestConnection(self.master) rest = RestConnection(self.master)
shell = RemoteMachineShellConnection(self.master) shell = RemoteMachineShellConnection(self.master)
if "*" not in str(self.collect_nodes) and self.nodes_init > 1 and \ if "*" not in str(self.collect_nodes) and self.nodes_init > 1:
self.collect_nodes <= self.nodes_init:
self.collect_nodes = self._generate_random_collecting_node(rest) self.collect_nodes = self._generate_random_collecting_node(rest)
status, content = rest.start_cluster_logs_collection(nodes=self.collect_nodes) status, content = rest.start_cluster_logs_collection(nodes=self.collect_nodes)
if status: if status:
Expand Down Expand Up @@ -65,7 +63,8 @@ def _verify_log_file(self, rest):
node_failed_to_collect = [] node_failed_to_collect = []
for node in perNode: for node in perNode:
for server in self.servers[:self.nodes_init]: for server in self.servers[:self.nodes_init]:
if server.ip in node: if server.ip in node or (self.nodes_init == 1 \
and "127.0.0.1" in node):
shell = RemoteMachineShellConnection(server) shell = RemoteMachineShellConnection(server)
file_name = perNode[node]["path"].replace(self.log_path, "") file_name = perNode[node]["path"].replace(self.log_path, "")
collected = False collected = False
Expand Down

0 comments on commit aa1aa4e

Please sign in to comment.