示例#1
0
    def test_fastboot(self, duthost, localhost, testbed):

        duthost.command('sudo config save -y')
        reboot(duthost, localhost, reboot_type='fast')
        assert wait_until(300, 20, duthost.critical_services_fully_started
                          ), "Not all critical services are fully started"
        self.basic_check_after_reboot(duthost, localhost, testbed)
示例#2
0
 def test_reboot(self, localhost, testbed_devices, testbed):
     duthost = testbed_devices["dut"]
     duthost.command('sudo config save -y')
     reboot(duthost, localhost)
     assert wait_until(300, 20, duthost.critical_services_fully_started
                       ), "Not all critical services are fully started"
     self.basic_check_after_reboot(duthost, localhost, testbed_devices,
                                   testbed)
示例#3
0
 def post_setup_hook(self, dut, localhost):
     """
     save configuration and execute reboot after rules are applied
     :param dut: dut host
     :param localhost: localhost object
     :return:
     """
     dut.command('config save -y')
     reboot(dut, localhost)
示例#4
0
    def testFastreboot(self, sflowbase_config, duthost, localhost, partial_ptf_runner, ptfhost):

        config_sflow(duthost,sflow_status='enable')
        verify_show_sflow(duthost,status='up',collector=['collector0','collector1'])
        duthost.command('sudo config save -y')
        reboot(duthost, localhost,reboot_type='fast')
        assert wait_until(300, 20, duthost.critical_services_fully_started), "Not all critical services are fully started"
        verify_show_sflow(duthost,status='up',collector=['collector0','collector1'])
        for intf in var['sflow_ports']:
            var['sflow_ports'][intf]['ifindex'] = get_ifindex(duthost,intf)
            verify_sflow_interfaces(duthost,intf,'up',512)
        var['portmap'] = json.dumps(var['sflow_ports'])
        ptfhost.copy(content=var['portmap'],dest="/tmp/sflow_ports.json")
        partial_ptf_runner(
              enabled_sflow_interfaces=var['sflow_ports'].keys(),
              active_collectors="['collector0','collector1']" )
示例#5
0
 def testRebootSflowDisable(self, sflowbase_config, duthost,
                            testbed_devices, localhost, partial_ptf_runner,
                            ptfhost):
     config_sflow(duthost, sflow_status='disable')
     verify_show_sflow(duthost, status='down')
     partial_ptf_runner(enabled_sflow_interfaces=var['sflow_ports'].keys(),
                        active_collectors="[]")
     duthost.command('sudo config save -y')
     reboot(duthost, localhost)
     assert wait_until(300, 20, duthost.critical_services_fully_started
                       ), "Not all critical services are fully started"
     verify_show_sflow(duthost, status='down')
     for intf in var['sflow_ports']:
         var['sflow_ports'][intf]['ifindex'] = get_ifindex(duthost, intf)
     var['portmap'] = json.dumps(var['sflow_ports'])
     ptfhost.copy(content=var['portmap'], dest="/tmp/sflow_ports.json")
     partial_ptf_runner(enabled_sflow_interfaces=var['sflow_ports'].keys(),
                        active_collectors="[]")
示例#6
0
 def testRebootSflowEnable(self, sflowbase_config, duthost, testbed_devices,
                           localhost, partial_ptf_runner, ptfhost):
     duthost = testbed_devices["dut"]
     duthost.command("config sflow polling-interval 80")
     verify_show_sflow(duthost, status='up', polling_int=80)
     duthost.command('sudo config save -y')
     reboot(duthost, localhost)
     assert wait_until(300, 20, duthost.critical_services_fully_started
                       ), "Not all critical services are fully started"
     verify_show_sflow(duthost,
                       status='up',
                       collector=['collector0', 'collector1'],
                       polling_int=80)
     for intf in var['sflow_ports']:
         var['sflow_ports'][intf]['ifindex'] = get_ifindex(duthost, intf)
         verify_sflow_interfaces(duthost, intf, 'up', 512)
     var['portmap'] = json.dumps(var['sflow_ports'])
     ptfhost.copy(content=var['portmap'], dest="/tmp/sflow_ports.json")
     partial_ptf_runner(enabled_sflow_interfaces=var['sflow_ports'].keys(),
                        active_collectors="['collector0','collector1']")
     # Test Polling
     partial_ptf_runner(polling_int=80,
                        active_collectors="['collector0','collector1']")
示例#7
0
def reboot_and_check(localhost,
                     dut,
                     interfaces,
                     reboot_type=REBOOT_TYPE_COLD,
                     reboot_helper=None,
                     reboot_kwargs=None):
    """
    Perform the specified type of reboot and check platform status.
    @param localhost: The Localhost object.
    @param dut: The AnsibleHost object of DUT.
    @param interfaces: DUT's interfaces defined by minigraph
    @param reboot_type: The reboot type, pre-defined const that has name convention of REBOOT_TYPE_XXX.
    @param reboot_helper: The helper function used only by power off reboot
    @param reboot_kwargs: The argument used by reboot_helper
    """
    logging.info("Run %s reboot on DUT" % reboot_type)

    reboot(dut,
           localhost,
           reboot_type=reboot_type,
           reboot_helper=reboot_helper,
           reboot_kwargs=reboot_kwargs)

    check_interfaces_and_services(dut, interfaces, reboot_type)