示例#1
0
def run_testing(dsr, msg, destinations):
    global RUN_TESTING
    while RUN_TESTING == True:
        for dst in destinations:
            dsr.send_message(
                hostname + "#Test Message to " + dst + " from " + str(node_id),
                dst)
            time.sleep(1)
示例#2
0
def run_testing(dsr, msg, destinations):
	global RUN_TESTING
	while RUN_TESTING == True:
		for dst in destinations:
			dsr.send_message(hostname + "#Test Message to " + dst + " from " + str(node_id), dst)
			time.sleep(1)
示例#3
0
		print_help()
	
	try:
		if input_tokens[0] == "run":
			if input_tokens[1] == "test":
				
				length = len(input_tokens)
				ids_to_send_to = []

				#ensure our input is good.
				try:
					#not the best, but allows me to check input before processing.
					for i in range (2, length):
						val = int(input_tokens[i])
					for k in range (2, length):
						dsr.send_message(hostname + "#Test Message to " + input_tokens[k], input_tokens[k])
						log_message("Send Test message to " + str(input_tokens[k]))
						ids_to_send_to.append(input_tokens[k])

					if RUN_TESTING == True:
						msg = hostname + "#Test Message to " + str(input_tokens[k])
						testing_thread = threading.Thread(target=run_testing, args=(dsr, msg, ids_to_send_to))
						testing_thread.daemon = True
						testing_thread.start()
						
				except ValueError:
					log_message("Input not a valid node ID")

			if input_tokens[1] == "send":
				
				quote_tokens = user_input.split('"')
示例#4
0
    try:
        if input_tokens[0] == "run":
            if input_tokens[1] == "test":

                length = len(input_tokens)
                ids_to_send_to = []

                #ensure our input is good.
                try:
                    #not the best, but allows me to check input before processing.
                    for i in range(2, length):
                        val = int(input_tokens[i])
                    for k in range(2, length):
                        dsr.send_message(
                            hostname + "#Test Message to " + input_tokens[k],
                            input_tokens[k])
                        log_message("Send Test message to " +
                                    str(input_tokens[k]))
                        ids_to_send_to.append(input_tokens[k])

                    if RUN_TESTING == True:
                        msg = hostname + "#Test Message to " + str(
                            input_tokens[k])
                        testing_thread = threading.Thread(
                            target=run_testing,
                            args=(dsr, msg, ids_to_send_to))
                        testing_thread.daemon = True
                        testing_thread.start()

                except ValueError: