DESCRIPTION

sample testrunner script for "TAP DUMP"

it retrives the nodes that are part of the cluster and then it visits
each node and grab tap-dump from each node for a given vbucket
this script eventually will support options :
-p vbuckets=[0.1.100],output=tapdumpoutput.txt

Change-Id: I1cac28308dcbe8a6b4b69a92bc095256745adfdc


COMMENTS

author: Zackery Barr
date: 2011-07-12 20:18:54.192000000

Uploaded patch set 6.

-------------------------------------
author: Ayden Rivas
date: 2011-07-12 22:23:03.276000000

Patch Set 6:

In regards to the vbucket param format we could modify TestInput.py to be able to parse the -p parameter better.

I whipped up the following code that will allow comma separated values with multiple parameters. We also could separate items with semicolons (like ep-engine does.)

I also added a function that can parse out ranges like 1-100

So you could then run testrunner with the -p param like:
.. -p version=2.0,vbuckets=1-100,23,output=tapdumpoutput.txt



# takes in a string of the form "p1=v1,v2,p2=v3,p3=v4,v5,v6"
# returns a dictionary of the form {"p1":"v1,v2","p2":"v3","p3":"v4,v5,v6"}
def parse(params):
  params_parsed = [p.strip() for p in re.split("[,]?([^,=]+)=", params)[1:]]
  return dict(zip(params_parsed[::2],params_parsed[1::2]))

def test():
  ts=["param1=1,param2=1,2,3,param3=false","param1=bdf","param1=dfd,param2=fdkjg","param1 = foo, blah", "param1 = foo, blah, param2=blahblah", "param1=foo, blah,param2=something,something2"]
  for t in ts:
    print parse(t)
    for k,v in parse(t).iteritems():
      print k
      print [a.strip() for a in v.split(",")]

# takes in a string of the form "1-100,140,150-160"
# returns an array with all those values inclusive
def srange(v):
  vs=[]
  for r in v.split(","):
    rs = r.split("-")
    r1=int(rs[0])
    r2=int(rs[0])+1
    if len(rs) == 2:
      r2=int(rs[1])+1
    vs.extend(range(r1,r2))
  return vs

def test2():
  ts=["vbuckets=1-100", "vbuckets=1-100,140,150-160", "vbuckets=1", "vbuckets=2, 4, 8 - 10"]
  for t in ts:
    for k,v in parse(t).iteritems():
      print v
      print srange(v)

-------------------------------------
author: Zackery Barr
date: 2011-07-13 19:52:39.110000000

Patch Set 6:

thats really helpful.
then we can have "," for passing multiple values for each key.

do you think you can add and check in that code to TestInput so that I can rebase and make changes accordingly to tapdump.py ?

-------------------------------------
author: Ayden Rivas
date: 2011-07-13 20:06:18.779000000

Patch Set 6:

I'll get it in shortly

-------------------------------------
