def test_ft_logging_verify_logs_after_system_reboot():
    """
    Author: Anil Kumar Kacharla <*****@*****.**>
    Referrence Topology :   Test bed ID:4 D1--Mgmt network
    Verify that  logs get generated upon system reboot.
    """
    st.log("Ensuring minimum topology")
    vars = st.ensure_min_topology("D1")
    data.count = '0'
    st.log("configuring syslog server in config_db file")
    slog_obj.config_syslog_server(vars.D1, [data.syslog_server])
    st.log("checking logging count")
    slog_obj.get_logging_count(vars.D1)
    count = slog_obj.get_logging_count(vars.D1)
    st.log("logging count:{}".format(count))
    st.log("performing system reboot")
    st.reboot(vars.D1, 'fast')
    st.log("checking logs after  system reboot ")
    count = slog_obj.get_logging_count(vars.D1)
    if slog_obj.get_logging_count(vars.D1) == data.count:
        st.report_fail("logs_are_not_getting_generated_after_reboot")
    else:
        st.log("Logs are generated after reboot")
        st.log("logs count after reboot:{}".format(count))
    output = bsapi.generate_tech_support(vars.D1)
    if "Tar append operation failed" in output:
        st.report_fail("Tech_support_operation_failed")
    st.report_pass("test_case_passed")
示例#2
0
def test_ft_vlan_syslog_verify():
    """
    Author:Anil Kumar Kacharla <*****@*****.**>
    Referrence Topology :   Test bed ID:4 D1--Mgmt network
    verify VLAN syslog functionality.
    """
    vars = st.ensure_min_topology("D1")
    sc_data.vlan_test = str(random_vlan_list(1, [int(sc_data.vlan)])[0])
    result = 1
    st.log("checking vlan count before vlan addition or deletion")
    count_before_add = slog.get_logging_count(vars.D1, severity="NOTICE", filter_list=["addVlan"])
    count_before_delete = slog.get_logging_count(vars.D1, severity="NOTICE", filter_list=["removeVlan"])
    st.log("vlan count before  adding vlan:{}".format(count_before_add))
    st.log("vlan count before  deleting vlan:{}".format(count_before_delete))
    vlan.create_vlan(vars.D1, sc_data.vlan_test)
    vlan.delete_vlan(vars.D1, sc_data.vlan_test)
    st.log("checking vlan count after adding vlan")
    count_after_add = slog.get_logging_count(vars.D1, severity="NOTICE", filter_list=["addVlan"])
    st.log("vlan count after  adding vlan:{}".format(count_after_add))
    count_after_delete = slog.get_logging_count(vars.D1, severity="NOTICE", filter_list=["removeVlan"])
    st.log("vlan count after  deleting vlan:{}".format(count_after_delete))
    if not count_after_add > count_before_add:
        st.error("vlan log count increamented after adding vlan:{}".format(count_after_add))
        result = 0
    if not count_after_delete > count_before_delete:
        st.error("vlan log count increamented after deleting vlan:{}".format(count_after_delete))
        result = 0
    if not result:
        st.report_fail("test_case_fail")
    st.log(" vlan count after adding or deleting vlan is incremented")
    st.report_pass("test_case_passed")
示例#3
0
def test_ft_bootup_build_all():
    '''
    Author: Jagadish <*****@*****.**>
    Topology: DUT--- Service Port
    Test Description: Verify that SONiC installer new image download,
                      set_next_boot, list, update, set_default and
                      remove operations are successful.
    '''
    vars = st.get_testbed_vars()
    st.log("Removing additional builds")
    for build in data.build_details_list['Available']:
        if not build == data.initial_build:
            if not bootup_obj.sonic_installer_remove(vars.D1, build):
                st.report_fail("build_remove_fail", build)
    st.log("Loading build")
    build = "http://" + data.http_ip + data.build_path + "/" + data.build_name
    bootup_obj.sonic_installer_install(vars.D1, build)
    st.log("Verifying whether build is loaded or not")
    build_details_list = bootup_obj.sonic_installer_list(vars.D1)
    if not len(build_details_list['Available']) == 2:
        st.report_fail("build_load_unsuccessful")
    new_image = bootup_obj.sonic_installer_list(vars.D1)['Next'][0]
    if new_image == data.initial_build:
        st.report_fail('verify_next_active_build_as_new_build_fail')
    st.reboot(vars.D1, 'fast')
    err_count = logging_obj.get_logging_count(
        vars.D1,
        filter_list=['SIGABRT', 'Runtime error', 'SAI_STATUS_FAILURE'])
    if err_count:
        st.report_fail("error_string_found", 'string', 'show logging')
    if not bootup_obj.sonic_installer_list(vars.D1)['Current'][0] == new_image:
        st.report_fail('verify_active_build_as_new_build_fail')
    st.log("Configuring old build as next build")
    if not bootup_obj.sonic_installer_set_next_boot(vars.D1,
                                                    data.initial_build):
        st.report_fail("set_next_active_build_as_old_fail")
    st.log("Verifying next active build")
    if not bootup_obj.sonic_installer_list(
            vars.D1)['Next'][0] == data.initial_build:
        st.report_fail("verify_next_active_build_as_old_build_fail")
    st.log("Configuring new build as default build")
    if not bootup_obj.sonic_installer_set_default(vars.D1, new_image):
        st.report_fail("set_old_build_as_default_fail")
    st.log('Verify whether new build is set to next active or not')
    if not bootup_obj.sonic_installer_list(vars.D1)['Next'][0] == new_image:
        st.report_fail("verify_next_active_build_as_new_build_fail")
    st.log("Removing the old build")
    if not bootup_obj.sonic_installer_remove(vars.D1, data.initial_build):
        st.report_fail("remove_old_build_fail")
    st.log("Verifyig whether old build is deleted or not")
    if data.initial_build in bootup_obj.sonic_installer_list(
            vars.D1)['Available']:
        st.report_fail("verify_remove_old_build_fail")
    st.report_pass("test_case_passed")
示例#4
0
def crm_clear_syslog(dut, maxretries=5, severity_type='WARNING', filters=[]):
    delay = 2
    for retry in range(0, maxretries):
        slog_obj.clear_logging(dut)
        st.log(
            'crminfo: Waiting {} secs for syslog to be cleared.. retry {}\n'.
            format(delay, retry + 1))
        st.wait(delay)
        if not slog_obj.get_logging_count(
                dut, severity=severity_type, filter_list=filters):
            return True
    return False
示例#5
0
def test_ft_sys_hard_reboot_multiple_iter():
    """
    Author : Sreenivasula Reddy <*****@*****.**>
    """
    st.log("Hard rebooting device for multiple iterations")
    for each_iter in range(1, data.iter_count + 1):
        st.log("Hard Reboot iteration number {}".format(each_iter))
        st.log("About to power off power to switch")
        st.do_rps(vars.D1, "Off")
        st.log("About to Power ON switch")
        st.do_rps(vars.D1, "On")
        intf_obj.poll_for_interfaces(vars.D1, iteration_count=180, delay=1)
    st.log("After hard reboot about to check 'show reboot-cause' reason")
    if not reboot_obj.get_reboot_cause(vars.D1):
        st.report_fail("verify_hard_reboot_show_reboot_cause_fail", vars.D1)
    intf_obj.poll_for_interfaces(vars.D1, iteration_count=180, delay=1)
    if not log.get_logging_count(vars.D1):
        st.report_fail("logs_are_not_getting_generated_after_reboot")
    st.report_pass('test_case_passed')