示例#1
0
def send_a_version_request(context):
    """
    send a version request
    :param context:
    """
    global cb, resp, props_cb_env
    __logger__.debug("Sending a version request...")
    properties_class = Properties()
    props_cb_env = properties_class.read_properties()[CONTEXT_BROKER_ENV]
    cb = CB(protocol=props_cb_env["CB_PROTOCOL"], host=props_cb_env["CB_HOST"], port=props_cb_env["CB_PORT"])
    resp = cb.get_version_request()
    __logger__.info("..Sent a version request correctly")
示例#2
0
def send_a_version_request(context):
    """
    send a version request
    :param context:
    """
    global cb, resp, props_cb_env
    __logger__.debug("Sending a version request...")
    properties_class = Properties()
    props_cb_env = properties_class.read_properties()[CONTEXT_BROKER_ENV]
    cb = CB(protocol=props_cb_env["CB_PROTOCOL"],
            host=props_cb_env["CB_HOST"],
            port=props_cb_env["CB_PORT"])
    resp = cb.get_version_request()
    __logger__.info("..Sent a version request correctly")
示例#3
0
def verify_context_broker_is_installed_successfully(context):
    """
    verify contextBroker is installed successfully
    :param context:
    """
    global props_cb
    __logger__.debug(" >> verify if contextBroker is installed successfully")
    __logger__.debug("Sending a version request...")

    cb = CB(protocol=props_cb["CB_PROTOCOL"], host=props_cb["CB_HOST"], port=props_cb["CB_PORT"])
    resp = cb.get_version_request()
    if props_cb["CB_VERIFY_VERSION"].lower() == "true":
        resp_dict = convert_str_to_dict(str(resp.text), "JSON")
        assert resp_dict["orion"]["version"].find(
            props_cb["CB_VERSION"]) >= 0, " ERROR in context broker version  value, \n " \
                                          " expected: %s \n" \
                                          " installed: %s" % (props_cb["CB_VERSION"], resp_dict["orion"]["version"])
        __logger__.debug("-- version %s is correct in base request v2" % props_cb["CB_VERSION"])
    __logger__.info(" >> verified that contextBroker is installed successfully")