def verify_collector_redis_uve_master(self, collector, exp_redis_uve_master): vcl = VerificationCollector('127.0.0.1', collector.http_port) try: redis_uve_master = vcl.get_redis_uve_master()['RedisUveMasterInfo'] self.logger.info('redis uve master: ' + str(redis_uve_master)) self.logger.info('exp redis uve master: 127.0.0.1:%d' % (exp_redis_uve_master.port)) if int(redis_uve_master['port']) != exp_redis_uve_master.port: return False if redis_uve_master['status'] != 'Connected': return False except Exception as err: self.logger.error('Exception: %s' % err) return False return True
def verify_collector_gen(self): ''' See if the SandeshClient within vizd has been able to register with the collector within vizd ''' vcl = VerificationCollector('127.0.0.1', self.http_port) try: genlist = vcl.get_generators()['genlist'] src = genlist[0]['source'] except: return False self.logger.info("Src Name is %s" % src) if src == socket.gethostname(): return True else: return False
def verify_generator_list(self, collector, exp_genlist): vcl = VerificationCollector('127.0.0.1', collector.http_port) try: genlist = vcl.get_generators()['generators'] self.logger.info('generator list: ' + str(genlist)) self.logger.info('exp generator list: ' + str(exp_genlist)) if len(genlist) != len(exp_genlist): return False for mod in exp_genlist: gen_found = False for gen in genlist: if mod == gen['module_id']: gen_found = True if gen['state'] != 'Established': return False break if gen_found is not True: return False except Exception as err: self.logger.error('Exception: %s' % err) return False return True