Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change datastructures-fuzz-test to require no setup

  • Loading branch information...
commit 186d16c5e875f79cbc14a6e44540d5dcda701ae2 1 parent c87433a
Robert Escriva authored
2  client/python/hyperclient.pyx
View
@@ -317,7 +317,7 @@ cdef _obj_to_backing(v):
for x in sorted(v, key=__sort_key):
if isinstance(x, bytes):
innerxtype = HYPERDATATYPE_SET_STRING
- innerxbacking = struct.pack('<L', len(x)) + bytes(x)
+ innerxbacking = struct.pack('<L', len(bytes(x))) + bytes(x)
elif isinstance(x, int):
innerxtype = HYPERDATATYPE_SET_INT64
innerxbacking = struct.pack('<q', x)
2  datatypes/map.cc
View
@@ -71,7 +71,7 @@ validate_map(bool (*step_key)(const uint8_t** ptr, const uint8_t* end, e::slice*
if (has_old)
{
- if (compare_key(old, key) < 0)
+ if (compare_key(old, key) >= 0)
{
return false;
}
2  datatypes/set.cc
View
@@ -60,7 +60,7 @@ validate_set(bool (*step_elem)(const uint8_t** ptr, const uint8_t* end, e::slice
if (has_old)
{
- if (compare_elem(old, elem) < 0)
+ if (compare_elem(old, elem) >= 0)
{
return false;
}
45 hyperdex-datastructures-fuzz-test
View
@@ -27,22 +27,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-''' Construct the space shown below and fuzz test it.
-space kv
-dimensions
- k,
- s (string),
- i (int64),
- ls (list(string)),
- li (list(int64)),
- ss (set(string)),
- si (set(int64)),
- mss (map(string, string)),
- msi (map(string, int64)),
- mis (map(int64, string)),
- mii (map(int64, int64))
-key k auto 0 1
-'''
+'''Construct the space shown below and fuzz test it.'''
import collections
@@ -52,6 +37,7 @@ import pprint
import random
import string
import sys
+import time
import hyperclient
from hyperclient import *
@@ -278,6 +264,30 @@ class HyperDexClient(object):
def __init__(self, addr, port, space):
self._client = hyperclient.Client(addr, port)
+ try:
+ self._client.rm_space('fuzz')
+ except:
+ pass
+ try:
+ self._client.add_space('''
+ space fuzz
+ key string k
+ attributes
+ string s,
+ int i,
+ list(string) ls,
+ list(int) li,
+ set(string) ss,
+ set(int) si,
+ map(string, string) mss,
+ map(string, int) msi,
+ map(int, string) mis,
+ map(int, int) mii
+ create 1 partition
+ ''')
+ time.sleep(1)
+ except:
+ pass
self._space = space
@inlineexception
@@ -622,8 +632,9 @@ class HyperDexModel(object):
if __name__ == '__main__':
random.seed(0)
- hyperdex = HyperDexClient('127.0.0.1', 1234, 'kv')
+ hyperdex = HyperDexClient('127.0.0.1', 1982, 'fuzz')
model = HyperDexModel()
+
for op, args in random_generator():
#print op, args
m = getattr(model, 'op_' + op)(*args)
Please sign in to comment.
Something went wrong with that request. Please try again.