コード例 #1
0
def verify_crm_nexthop_counter_not_increased(lower_tor_host):
    """
    A function level fixture to verify crm nexthop counter not increased
    """
    original_counter = get_crm_nexthop_counter(lower_tor_host)
    yield
    diff = get_crm_nexthop_counter(lower_tor_host) - original_counter
    py_assert(diff == 0,
              "crm nexthop counter is increased by {}.".format(diff))
コード例 #2
0
ファイル: conftest.py プロジェクト: vmorokhx/sonic-mgmt
def verify_crm_nexthop_counter_not_increased(rand_selected_dut,
                                             set_crm_polling_interval):
    """
    A function level fixture to verify crm nexthop counter not increased
    """
    original_counter = get_crm_nexthop_counter(rand_selected_dut)
    logging.info(
        "Before test: crm nexthop counter = {}".format(original_counter))
    yield
    time.sleep(CRM_POLL_INTERVAL)
    diff = get_crm_nexthop_counter(rand_selected_dut) - original_counter
    logging.info(
        "Before test: crm nexthop counter = {}".format(original_counter +
                                                       diff))
    py_assert(diff <= 0,
              "crm nexthop counter is increased by {}.".format(diff))