Skip to content

Commit

Permalink
CBQE-2328: Add test to repro MB-11698
Browse files Browse the repository at this point in the history
Change-Id: I556f2c789cc1ce6e7c678dcb1a27fc579ce8936f
Reviewed-on: http://review.couchbase.org/39441
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Ketaki Gangal <ketakigangal@gmail.com>
  • Loading branch information
IrynaMironava authored and Ketaki Gangal committed Jul 17, 2014
1 parent 42c3b0c commit 7535c6b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions conf/py-eviction.conf
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ eviction.evictionkv.EvictionKV:
test_eject_all_ops,dgm_run=True,eviction_policy=fullEviction test_eject_all_ops,dgm_run=True,eviction_policy=fullEviction
test_purge_ejected_docs,dgm_run=True,eviction_policy=fullEviction test_purge_ejected_docs,dgm_run=True,eviction_policy=fullEviction
test_update_ejected_expiry_time,dgm_run=True,eviction_policy=fullEviction test_update_ejected_expiry_time,dgm_run=True,eviction_policy=fullEviction
eviction.eviction_change_policy.EvictionChangePolicy:
test_reproducer_MB_11698,nodes_init=3,items=10000,eviction_policy=fullEviction


29 changes: 29 additions & 0 deletions pytests/eviction/eviction_change_policy.py
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,29 @@
import time
from couchbase.documentgenerator import BlobGenerator
from eviction.evictionbase import EvictionBase
from membase.helper.cluster_helper import ClusterOperationHelper
from remote.remote_util import RemoteMachineShellConnection

class EvictionChangePolicy(EvictionBase):

def test_reproducer_MB_11698(self):
gen_create = BlobGenerator('eviction', 'eviction-', self.value_size, end=self.num_items)
gen_create2 = BlobGenerator('eviction2', 'eviction2-', self.value_size, end=self.num_items)
self._load_all_buckets(self.master, gen_create, "create", 0)
self._wait_for_stats_all_buckets(self.servers[:self.nodes_init])
self._verify_stats_all_buckets(self.servers[:self.nodes_init])
remote = RemoteMachineShellConnection(self.master)
for bucket in self.buckets:
output, _ = remote.execute_couchbase_cli(cli_command='bucket-edit',
cluster_host="localhost",
user=self.master.rest_username,
password=self.master.rest_password,
options='--bucket=%s --bucket-eviction-policy=valueOnly' % bucket.name)
self.assertTrue(' '.join(output).find('SUCCESS') != -1, 'Eviction policy wasn\'t changed')
ClusterOperationHelper.wait_for_ns_servers_or_assert(
self.servers[:self.nodes_init], self,
wait_time=self.wait_timeout, wait_if_warmup=True)
self.sleep(10, 'Wait some time before next load')
self._load_all_buckets(self.master, gen_create2, "create", 0)
self._wait_for_stats_all_buckets(self.servers[:self.nodes_init], timeout=self.wait_timeout * 5)
self._verify_stats_all_buckets(self.servers[:self.nodes_init])

0 comments on commit 7535c6b

Please sign in to comment.