Ejemplo n.º 1
0
def createUser():
    username = helper_functions.randomString(10)
    username += "@"
    username += helper_functions.randomString(5)
    username += "."
    username += helper_functions.randomString(3)
    password = helper_functions.randomString(10)
    return username, password
Ejemplo n.º 2
0
def createUser():
  username = helper_functions.randomString(10) 
  username += "@"
  username += helper_functions.randomString(5)
  username += "."
  username += helper_functions.randomString(3)
  password = helper_functions.randomString(10)
  return username, password
Ejemplo n.º 3
0
def createRandomList(number_of_columns, column_name_len):
    columns = []
    for ii in range(0, number_of_columns):
        columns += [hf.randomString(column_name_len)]
    return columns
#Initialize SerialTransport
transport = SerialRadioTransport(serial_port, chr(4), 'a', 2, 19)

#Initialize ReliableMessenger
messenger = ReliableMessenger(transport)
messenger.set_retry(5)
messenger.set_ack_timeout(test_ack_timeout)

#Send message

resend_count = 0
success_count = 0
tries = 100
for i in range(tries):
    #Send Message
    msg = Message('b', 'a', fx.randomString(test_string_length))
    result = messenger.send_message(msg)
    #Counting if send is a success
    if (result >= 0):
        resend_count += result
        success_count += 1
    #print (i,end='\r')
    print("Loop " + str(i) + ", Sending message : " + str(msg.body) +
          " retrys: " + str(result) + "      ",
          end='\r')
    # #Receive Reply
    # correct_reply = False
    # time_out = datetime.utcnow() + timedelta(seconds=1)

    # while (datetime.utcnow() < time_out):
    #     if (correct_reply): break
Ejemplo n.º 5
0
def createApp():
    name = helper_functions.randomString(10)
    tar = helper_functions.randomString(1000)
    return name, tar
Ejemplo n.º 6
0
#######################################
# Retrieve the user's data with no apps
#######################################
ret = server.get_user_data(user[0], super_secret)
if user[0] not in ret or user[1] not in ret:
    err(helper_functions.lineno(), ret)
#################
# Get empty token
#################
ret = server.get_token(user[0], super_secret)
if "token:notSet" not in ret:
    err(helper_functions.lineno(), ret)
#################
# Change password
#################
newpw = helper_functions.randomString(10)
ret = server.change_password(user[0], newpw, super_secret)
if ret != "true":
    err(helper_functions.lineno(), ret)
#######################################
# Retrieve the user's data with new pw
#######################################
ret = server.get_user_data(user[0], super_secret)
if user[0] not in ret or newpw not in ret:
    err(helper_functions.lineno(), ret)
######################
# Change password back
######################
ret = server.change_password(user[0], user[1], super_secret)
if ret != "true":
    err(helper_functions.lineno(), ret)
Ejemplo n.º 7
0
def createRandomList(number_of_columns, column_name_len):
  columns = [] 
  for ii in range(0, number_of_columns):
    columns += [hf.randomString(column_name_len)]
  return columns
Ejemplo n.º 8
0
def createApp():
  name = helper_functions.randomString(10)
  tar = helper_functions.randomString(1000)
  return name, tar
Ejemplo n.º 9
0
#######################################
# Retrieve the user's data with no apps
#######################################
ret = server.get_user_data(user[0], super_secret)
if user[0] not in ret or user[1] not in ret:
  err(helper_functions.lineno(), ret)
#################
# Get empty token
#################
ret = server.get_token(user[0], super_secret)
if "token:notSet" not in ret:
  err(helper_functions.lineno(), ret)
#################
# Change password
#################
newpw = helper_functions.randomString(10)
ret = server.change_password(user[0], newpw, super_secret)
if ret != "true":
  err(helper_functions.lineno(), ret)
#######################################
# Retrieve the user's data with new pw 
#######################################
ret = server.get_user_data(user[0], super_secret)
if user[0] not in ret or newpw not in ret:
  err(helper_functions.lineno(), ret)
######################
# Change password back
######################
ret = server.change_password(user[0], user[1], super_secret)
if ret != "true":
  err(helper_functions.lineno(), ret)