Exemplo n.º 1
0
def main():
	for i in range(CONF.MAIN.cycle):
		msg="SCAN ALL THE NODES IN CYCLE: {0:d}".format(i)
		logger.info(msg)
		get_node=GET_NODE(host,CONF.REST.client_app_ver,CONF.REST.bind_port)
		get_node.scan_node()
		new_url=get_node.url_list

		if i!=0:
			if last_url!=new_url:
				compare_url(last_url,new_url)
		last_url=new_url

		if CONF.CLI.time_to_stop:
			if datetime.now()>datetime.strptime(CONF.CLI.time_to_stop,\
				 '%Y-%m-%d %H:%M:%S'):
				break
		#input("Press Enter to continue...")
	msg='Stop test on {0}, cycle {1}'.format(datetime.now(),(i+1))
	logger.info(msg)
Exemplo n.º 2
0
class TestStringMethods(unittest.TestCase):
	def setUp(self):
		#self.tgen_url = get_nodes.GEN_URL("192.168.0.1")
		self.tgen_url = GEN_URL("192.168.0.1")
		self.tget_node = GET_NODE("192.168.0.1")
		self.tget_req = URL_REQUEST("http://10.204.29.221:8888/redfish/v1")
	def tearDown(self):
		pass

	#def test_geturl(self):
	#	self.assertEqual(self.tgen_url.get_url(), "http://192.168.0.1:8888/redfish/v1")

	#def test_getpath(self):
	#	self.assertEqual(self.tgen_url.get_path("http://192.168.0.1:8888/redfish/v1"), "/redfish/v1")

	def test_getreq(self):
		success_send = mock.Mock(return_value=url_dict)
		URL_REQUEST.get_req = success_send
		print(self.tget_node.get_sub_node("redfish"))
Exemplo n.º 3
0
	def setUp(self):
		#self.tgen_url = get_nodes.GEN_URL("192.168.0.1")
		self.tgen_url = GEN_URL("192.168.0.1")
		self.tget_node = GET_NODE("192.168.0.1")
		self.tget_req = URL_REQUEST("http://10.204.29.221:8888/redfish/v1")