def test_prod_ar(): conn = connection(rgws['prod-d42ar']) b = conn.get_bucket('my-new-bucket-1') k = b.get_key('obj_test_elb-d42-load-test-393698-213045230_13') # k.set_contents_from_string("0"*13471492) conn = connection(rgws['prod-d42ar']) b = conn.get_bucket('my-new-bucket-1') k = b.get_key('obj_test_elb-d42-load-test-393710-990783943_6') print len(k.get_contents_as_string())
def test_erasure_bug(): # l = 4718590 # ll = [102279605,1240092,52136070,29070602,4718580] ll = [1024] # l = 10*1024 #/my-new-bucket-1/obj_testflipmac.fkipl.flipkart.com-5921342152 b = 'bucket-test-sharath' cluster = rgws['prod-d42ar_rgw'] bucket = create(cluster, b) log.debug("finished creating bucket") for l in ll: log.debug("=========trying for length {} ============".format(l)) conn = connection(cluster) keyname = "bala1" # bucket = conn.get_bucket(b) key = bucket.new_key(keyname) input = "0"*l key.set_contents_from_string(input) log.debug("========finished putting the data=========") ret = bucket.get_key(keyname) ss = ret.get_contents_as_string() if input != ss: log.debug("input len {}, got len {} difference in len {}".format(l, len(ss), (l-len(ss)))) else: log.debug("input and output match! all ok.")
def test_all_rgws(appId): url = "http://10.33.65.0:8080/compute/v1/apps/{}/instances?view=summary".format(appId) r = urllib2.urlopen(url) s = json.load(r) # s = json.loads(data) for obj in s: ip = obj['primary_ip'] host = obj['hostname'] type = obj['instance_type'] if 'rgw' not in host: continue # l = 4718590 # ll = [102279605,1240092,52136070,29070602,4718580] ll = [1024] # l = 10*1024 b = 'bucket-test-sharath' cluster = rgws['stage-d42sa'] cluster['host'] = ip log.debug("==============trying for cluster: {}=========".format(ip)) bucket = create(cluster, b) log.debug("finished creating bucket") for l in ll: log.debug("=========trying for length {} ============".format(l)) conn = connection(cluster) keyname = "bala1" # bucket = conn.get_bucket(b) key = bucket.new_key(keyname) input = "0"*l key.set_contents_from_string(input) log.debug("========finished putting the data=========") ret = bucket.get_key(keyname) ss = ret.get_contents_as_string() if input != ss: log.debug("input len {}, got len {} difference in len {}".format(l, len(ss), (l-len(ss)))) else: log.debug("input and output match! all ok.")
def ravi_kotta(): l = 337064373 # ll = [102279605,1240092,52136070,29070602,4718580] ll = [l] # l = 10*1024 for l in ll: log.debug("=========trying for length {} ============".format(l)) cluster = rgws['prod-d42bk'] conn = connection(cluster) bucket = conn.get_bucket("ippvisitincoming") log.debug("bucket name is {}".format(bucket)) keyname = "bala1" key = bucket.new_key(keyname) key.set_contents_from_string("0"*1024*1024) ret = bucket.get_key("01-flipkart-mob-androidapp_20160413-180000.tsv.gz") log.debug("================size is {}".format(ret.size)) ss = ret.get_contents_as_string() log.debug("input len {}, got len {} difference in len {}".format(l, len(ss), (l-len(ss))))
def aws(cluster, count, bucket): x = uuid.uuid4() conn = connection(cluster) bucket = conn.get_bucket(bucket) key = bucket.new_key('aws_client-'+str(count)+"-"+str(x)) key.set_contents_from_string(obj)
def create(cluster, b): conn = connection(cluster) bucket = conn.create_bucket(b) log.debug(bucket) return bucket