def test_2ndLevel_prdcr_updtr_cmd(self, logger, cfg, obj): ctrl = ldmsdInetConfig(obj['agg_2ndLevel_host'], cfg.AGG2_INET_CTRL_PORT, obj['secretword']) result = ctrl.prdcr_add(name='1st_agg', host=obj['agg_1stLevel_host'], type="active", xprt=cfg.AGG_XPRT, port=cfg.AGG_PORT, interval=cfg.LDMSD_RECONNECT_INTERVAL) result = result.rstrip() assert (result == "0") result = ctrl.prdcr_start(name='1st_agg') result = result.rstrip() assert (result == "0") result = ctrl.updtr_add(name="all", interval=cfg.LDMSD_UPDATE_INTERVAL) result = result.rstrip() assert (result == "0") result = ctrl.updtr_prdcr_add(name="all", regex=".*") result = result.rstrip() assert (result == "0") result = ctrl.updtr_start(name="all") result = result.rstrip() assert (result == "0") ctrl.close()
def test_2ndLevel_store_cmd(self, logger, cfg, obj): ctrl = ldmsdInetConfig(obj['agg_2ndLevel_host'], cfg.AGG2_INET_CTRL_PORT, obj['secretword']) logger.info("store: {0}".format(obj['store_pi'])) result = ctrl.load(name=obj['store_pi']) assert (result == "0") logger.debug("config ....") result = ctrl.config(name=obj['store_pi'], path=cfg.STORE_PATH) assert (result == "0") logger.debug("strgp_add ....") result = ctrl.strgp_add(name="all", plugin=obj['store_pi'], container=obj['container'], schema=obj['schema']) result = result.rstrip() assert (result == "0") logger.debug("strgp_prdcr_add ....") result = ctrl.strgp_prdcr_add(name="all", regex=".*") result = result.rstrip() assert (result == "0") logger.debug("strgp_start ....") result = ctrl.strgp_start(name="all") result = result.rstrip() assert (result == "0") ctrl.close()
def test_agg_store_cmd(self, logger, obj, cfg): ctrl = ldmsdInetConfig(obj['agg_host'], cfg.AGG_INET_CTRL_PORT, obj['secretword']) result = ctrl.store(store_pi=obj['store_pi'], policy="all", container="test_set", schema="test_set") ctrl.close() assert (result == "0")
def test_add_host_1stLevel_after_revived(self, logger, cfg, obj): ctrl = ldmsdInetConfig(obj['agg_1stLevel_host'], cfg.AGG_INET_CTRL_PORT, obj['secretword']) result = ctrl.add(host = obj['samplerd_host'], host_type = "active", xprt = cfg.SAMPLERD_XPRT, port = cfg.SAMPLERD_PORT, sets = obj['instance'], interval = cfg.LDMSD_UPDATE_INTERVAL) ctrl.close() assert(result == "0")
def test_2ndLevel_agg_add_1stLevel_agg(self, logger, cfg, obj, agg_2ndLevel_conn): ctrl = ldmsdInetConfig(obj['agg_2ndLevel_host'], cfg.AGG2_INET_CTRL_PORT, obj['secretword']) result = ctrl.add(host = obj['agg_1stLevel_host'], host_type = "active", xprt = cfg.AGG_XPRT, port = cfg.AGG_PORT, sets = obj['instance'], interval = cfg.LDMSD_UPDATE_INTERVAL) ctrl.close() assert(result == "0")
def test_1stLevel_updtr_add_start_cmd_after_revived(self, cfg, obj): ctrl = ldmsdInetConfig(obj['agg_1stLevel_host'], cfg.AGG_INET_CTRL_PORT, obj['secretword']) result = ctrl.updtr_add(name="all", interval=cfg.LDMSD_UPDATE_INTERVAL) result = result.rstrip() assert (result == "0") result = ctrl.updtr_prdcr_add(name="all", regex=".*") result = result.rstrip() assert (result == "0") result = ctrl.updtr_start(name="all") result = result.rstrip() assert (result == "0") ctrl.close()
def test_1stLevel_prdcr_add_start_cmd_after_revived(self, cfg, obj): ctrl = ldmsdInetConfig(obj['agg_1stLevel_host'], cfg.AGG_INET_CTRL_PORT, obj['secretword']) result = ctrl.prdcr_add(name='samplerd', host=obj['samplerd_host'], type="active", xprt=cfg.SAMPLERD_XPRT, port=cfg.SAMPLERD_PORT, interval=cfg.LDMSD_RECONNECT_INTERVAL) result = result.rstrip() assert (result == "0") result = ctrl.prdcr_start(name='samplerd') result = result.rstrip() assert (result == "0") ctrl.close()
def __init__(self, host=None, port=None, secretPath=None, infile=None): try: self.secretword = None if secretPath is not None: try: from ovis_lib import ovis_auth except ImportError: raise ImportError( "No module ovis_lib. Please make sure that ovis" "is built with --enable-swig") self.secretword = ovis_auth.ovis_auth_get_secretword( secretPath, None) self.ctrl = ldmsd_config.ldmsdInetConfig( host=host, port=int(port), secretword=self.secretword) self.prompt = "{0}:{1}> ".format(host, port) if infile: cmd.Cmd.__init__(self, stdin=infile) else: cmd.Cmd.__init__(self) except: raise
def test_agg_store_config_cmd(self, logger, obj, cfg): ctrl = ldmsdInetConfig(obj['agg_host'], cfg.AGG_INET_CTRL_PORT, obj['secretword']) result = ctrl.config(obj['store_pi'], path=cfg.STORE_PATH) ctrl.close() assert (result == "0")
def test_agg_load_store_cmd(self, logger, obj, cfg): ctrl = ldmsdInetConfig(obj['agg_host'], cfg.AGG_INET_CTRL_PORT, obj['secretword']) result = ctrl.load(name=obj['store_pi']) ctrl.close() assert (result == "0")