Skip to content

Commit

Permalink
fixes for vdns to use mgmt ip and use cfgm db for connectivity check
Browse files Browse the repository at this point in the history
Change-Id: I4e5e73a78de7b4f4540a415f9e54a4a4985c5c43
Closes-Bug: 1736580
  • Loading branch information
Senthilnathan Murugappan committed Dec 6, 2017
1 parent d09556d commit c27ce49
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 61 deletions.
1 change: 1 addition & 0 deletions common/vdns/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ def verify_ns_lookup_data(self, vm_fix, cmd, expectd_data,
def verify_vm_dns_data(self, vm_dns_exp_data, dns_server_ip):
result = True
dns_data_list = []
dns_server_ip = self.inputs.host_data[dns_server_ip]['host_ip']
for bgp_ip in self.inputs.bgp_ips:
dnsinspect_h = self.dnsagent_inspect[dns_server_ip]
dns_data_list.append(dnsinspect_h.get_dnsa_config())
Expand Down
6 changes: 3 additions & 3 deletions scripts/analytics/test_analytics_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_verify_object_logs(self):
st=self.analytics_obj.ops_inspect[self.inputs.collector_ips[0]
].send_trace_to_database(
node=self.inputs.collector_names[0],
module='QueryEngine',
module='contrail-query-engine',
trace_buffer_name='QeTraceBuf')
self.logger.debug("Status: %s"%(st))
assert res2, "Verification of %s failed"%msg
Expand All @@ -81,7 +81,7 @@ def test_verify_object_logs(self):
st=self.analytics_obj.ops_inspect[self.inputs.collector_ips[0]
].send_trace_to_database(
node=self.inputs.collector_names[0],
module='QueryEngine',
module='contrail-query-engine',
trace_buffer_name='QeTraceBuf')
self.logger.debug("status: %s"%(st))
assert res1, "Verification of %s failed"%msg
Expand All @@ -106,7 +106,7 @@ def test_verify_object_logs(self):
st=self.analytics_obj.ops_inspect[self.inputs.collector_ips[0]
].send_trace_to_database(
node=self.inputs.collector_names[0],
module='QueryEngine',
module='contrail-query-engine',
trace_buffer_name='QeTraceBuf')
self.logger.debug("Status: %s"%(st))
assert res1, "Verification of %s failed"%msg
Expand Down
93 changes: 35 additions & 58 deletions tcutils/collector/analytics_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3209,16 +3209,14 @@ def check_for_duplicate_alarms(self, alarms):
def get_cfgm_process_details(self, opserver, cfgm_name, process=None, instanceid='0'):

res = None
try:
#WA for #1718856 vcenter sanity: Broken by other commits
if process == 'contrail-api' and self.inputs.get_build_sku() in ['kilo', 'liberty', 'mitaka']:
process = '%s:%s' % (process, instanceid)
except Exception as e:
process = '%s:%s' % (process, instanceid)

process_name = '%s:%s' % (process, instanceid)\
if process == 'contrail-api' else process
try:
obj = self.ops_inspect[opserver].get_ops_config(config=cfgm_name)
res = obj.get_attr('Node', 'process_info',
match=('process_name', process_name))
if not res:
res = obj.get_attr('Node', 'process_info',
match=('process_name', process))
except Exception as e:
self.logger.debug('Got exception as %s' % (e))
Expand Down Expand Up @@ -4235,18 +4233,14 @@ def verify_process_and_connection_infos_config(self):
server,node = cfgm)
assert result
result = False
if container_based:
for ip in self.inputs.cfgm_control_ips:
for ip in self.inputs.cfgm_control_ips:
if container_based:
server = "%s:%s"%(ip,port_dict['cfgm_cassandra'])
result = result or self.verify_connection_infos(ops_inspect,\
'contrail-api',\
server,node = cfgm)
else:
for ip in self.inputs.database_control_ips:
else:
server = "%s:%s"%(ip,port_dict['cassandra'])
result = result or self.verify_connection_infos(ops_inspect,\
'contrail-api',\
server,node = cfgm)
result = result or self.verify_connection_infos(ops_inspect,\
'contrail-api',\
server,node = cfgm)
assert result
result = False
for ip in self.inputs.config_amqp_ips:
Expand Down Expand Up @@ -4282,19 +4276,14 @@ def verify_process_and_connection_infos_config(self):
'contrail-device-manager',\
server,node = cfgm)
assert result
result = False
if container_based:
for ip in self.inputs.cfgm_control_ips:
for ip in self.inputs.cfgm_control_ips:
if container_based:
server = "%s:%s"%(ip,port_dict['cfgm_cassandra'])
result_cassandra = result_cassandra or self.verify_connection_infos(ops_inspect,\
'contrail-device-manager',\
server,node = cfgm)
else:
for ip in self.inputs.database_control_ips:
else:
server = "%s:%s"%(ip,port_dict['cassandra'])
result = result or self.verify_connection_infos(ops_inspect,\
'contrail-device-manager',\
server,node = cfgm)
result_cassandra = result_cassandra or self.verify_connection_infos(ops_inspect,\
'contrail-device-manager',\
server,node = cfgm)
result = False
for ip in self.inputs.config_amqp_ips:
server = "%s:%s"%(ip,port_dict['rmq'])
Expand Down Expand Up @@ -4331,18 +4320,14 @@ def verify_process_and_connection_infos_config(self):
server,node = cfgm)
assert result
result = False
if container_based:
for ip in self.inputs.cfgm_control_ips:
for ip in self.inputs.cfgm_control_ips:
if container_based:
server = "%s:%s"%(ip,port_dict['cfgm_cassandra'])
result_cassandra = result_cassandra or self.verify_connection_infos(ops_inspect,\
'contrail-schema',\
server,node = cfgm)
else:
for ip in self.inputs.database_control_ips:
else:
server = "%s:%s"%(ip,port_dict['cassandra'])
result = result or self.verify_connection_infos(ops_inspect,\
'contrail-schema',\
server,node = cfgm)
result_cassandra = result_cassandra or self.verify_connection_infos(ops_inspect,\
'contrail-schema',\
server,node = cfgm)
assert result_cassandra,'contrail-schema module connection to cfgm_cassandra server not up'
result_cassandra = False
for cfgm in self.inputs.cfgm_names:
Expand Down Expand Up @@ -4373,17 +4358,13 @@ def verify_process_and_connection_infos_config(self):
assert result
result = False
if container_based:
for ip in self.inputs.cfgm_control_ips:
server = "%s:%s"%(ip,port_dict['cfgm_cassandra'])
result_cassandra = result_cassandra or self.verify_connection_infos(ops_inspect,\
'contrail-svc-monitor',\
server,node = cfgm)
server = "%s:%s"%(ip,port_dict['cfgm_cassandra'])
else:
for ip in self.inputs.database_control_ips:
server = "%s:%s"%(ip,port_dict['cassandra'])
result = result or self.verify_connection_infos(ops_inspect,\
'contrail-svc-monitor',\
server,node = cfgm)
server = "%s:%s"%(ip,port_dict['cassandra'])
for ip in self.inputs.cfgm_control_ips:
result_cassandra = result_cassandra or self.verify_connection_infos(ops_inspect,\
'contrail-svc-monitor',\
server,node = cfgm)
assert result_cassandra,'contrail-svc-monitor module connection to cfgm_cassandra server not up'
return True
# end verify_process_and_connection_infos_config
Expand All @@ -4409,18 +4390,14 @@ def verify_process_and_connection_infos_control_node(self):
'contrail-control')
result = False

if container_based:
for ip in self.inputs.cfgm_control_ips:
for ip in self.inputs.cfgm_control_ips:
if container_based:
server = "%s:%s"%(ip,port_dict['cntl_cassandra'])
result = result or self.verify_connection_infos(ops_inspect,\
'contrail-control',\
server,node = bgp)
else:
for ip in self.inputs.database_control_ips:
else:
server = "%s:%s"%(ip,port_dict['cassandra'])
result = result or self.verify_connection_infos(ops_inspect,\
'contrail-control',\
server,node = bgp)
result = result or self.verify_connection_infos(ops_inspect,\
'contrail-control',\
server,node = bgp)
assert result, 'Control node %s not connected to any cassandra' % (
bgp)

Expand Down

0 comments on commit c27ce49

Please sign in to comment.