Ejemplo n.º 1
0
 def setup(self, cimc_util_obj, config, con_obj):
     '''
     Setup method for all possible boot devices
     '''
     self.boot_order_obj = BootOrder(cimc_util_obj, config)
     self.host_handle = self.boot_order_obj.host_handle
     self.host_serial_handle = cimc_util_obj.telnet_handle
     self.host_util_obj = HostUtils(cimc_util_obj, config)
     bios_obj = cimc_util_obj.bios_util_obj
     self.config_obj = config.boot_device_detail
     log.info(self.config_obj)
     self.host_ip = common_utils.get_host_mgmt_ip(config)
     log.info('Display all boot order details:')
     for key in self.config_obj.keys():
         log.info(self.config_obj[key])
     boot_mode = con_obj.get('BootDeviceDetail', 'boot_mode')
     log.info('Testbed is configured in: ' + boot_mode)
     mode = self.boot_order_obj.get_boot_mode()
     log.info('Current configured boot mode: ' + mode)
     if mode != boot_mode:
         self.boot_order_obj.configure_boot_mode(boot_mode)
         cimc_util_obj.verify_host_up(self.host_ip)
     # Disable SOL
     if bios_obj.enable_disable_sol(value='no') is False:
         log.warning('Failed to set console redirect default values')
     if bios_obj.console_redirect_defaults() is False:
         log.warning('Failed to set console redirect default values')
     aetest.loop.mark(
         self.verify_boot_order,
         boot_device=self.config_obj.keys())
Ejemplo n.º 2
0
    def inital_setup(self, cimc_util_obj, config):
        global system_capture_object
        system_capture_object = SystemDetailsCapture(cimc_util_obj, config)

        global classparam
        classparam['boot_order_obj'] = BootOrder(cimc_util_obj)
        classparam['host_util_obj'] = HostUtils(cimc_util_obj, config)
        classparam['storage_util_obj'] = StorageUtils(cimc_util_obj, config)
Ejemplo n.º 3
0
 def initial_setup(self, cimc_util_obj):
     '''
     Initial Setups
     '''
     global classparam
     classparam['bios_obj'] = cimc_util_obj.bios_util_obj
     classparam['procc_obj'] = ProcessorUtils(classparam['bios_obj'])
     classparam['cpu_info'] = classparam['procc_obj'].get_cpu_info()
     classparam['host_utils'] = HostUtils()
Ejemplo n.º 4
0
    def cdn_enable_test(self, cimc_util_obj, config):
        '''
        Logical ID: RACK-BIOS-DN-CDN-VIC-003
        Test Case: To Check CDN is Enabled from CIMC
        '''
        vic_list = config.inventory_detail
        logger.info('VIC list are: ' + str(vic_list))
        bios_obj = cimc_util_obj.bios_util_obj

        host_util = HostUtils()
        boot_order_obj = BootOrder(cimc_util_obj)
        status = host_util.check_host_up(cimc_util_obj, boot_order_obj, config)
        if status is False:
            logger.warning(
                'Host OS is not pinging after setting the boot order to HDD ')

        bios_token = 'cdnEnable'
        token_new_value = 'Enabled'
        logger.info('Power on the host')
        if cimc_util_obj.set_host_power('on') is False:
            self.failed('Failed to power on host', goto=['cleanup'])
        host_ip = get_host_mgmt_ip(config)
        token_val = bios_obj.get_bios_token_value(bios_token)
        if token_val == token_new_value:
            logger.info('CDN is already enabled on CIMC')
        else:
            logger.info('Set the cdnEnable token Enable and Reboot the host')
            res = bios_obj.set_bios_token_value(bios_token, token_new_value)
            if res is False:
                logger.error('Failed to set bios token value')
                self.failed('Failed to set bios token value', goto=['cleanup'])
            '''Wait for host to reboot'''
            res = cimc_util_obj.verify_host_up(host_ip,
                                               wait_for_ping_fail=False,
                                               wait_time=400)
            if res is False:
                logger.warning('Failed to ping the host after host reboot')
                self.failed('Failed to ping host', goto=['cleanup'])
            scope = 'advanced'
            token_val = bios_obj.get_bios_token_value(bios_token)
            if token_val == token_new_value:
                self.passed(
                    'Successfully verified that CDN token can be enabled from CIMC'
                )
            else:
                self.failed('Failed to verify that CDN token,\
                    Expected is:' + token_new_value + ' But got as: ' +
                            token_val)
Ejemplo n.º 5
0
    def initial_setup(self, cimc_util_obj, config):
        '''
        Initial Setups
        '''
        global classparam
        classparam['bios_obj'] = cimc_util_obj.bios_util_obj
        classparam['host_utils'] = HostUtils()
        classparam['boot_order_obj'] = BootOrder(cimc_util_obj, config)
        classparam['host_ip'] = get_host_mgmt_ip(config)

        # Disable SOL
        if cimc_util_obj.bios_util_obj.enable_disable_sol(value='no') is False:
            log.warning('Failed to set console redirect default values')
        if cimc_util_obj.bios_util_obj.console_redirect_defaults() is False:
            log.warning('Failed to set console redirect default values')

################# Common setup Ends ##############################################
        '''
Ejemplo n.º 6
0
 def setup(self, cimc_util_obj, config, con_obj):
     '''
     Setup method for all possible basic boot devices
     '''
     self.boot_order_obj = BootOrder(cimc_util_obj, config)
     self.host_handle = self.boot_order_obj.host_handle
     self.host_serial_handle = cimc_util_obj.telnet_handle
     self.host_util_obj = HostUtils(cimc_util_obj, config)
     self.config_obj = config.basic_boot_device_detail
     self.host_ip = common_utils.get_host_mgmt_ip(config)
     bios_obj = cimc_util_obj.bios_util_obj
     log.info('Display all basic boot order details:')
     for key in self.config_obj.keys():
         log.info(self.config_obj[key])
     # Disable SOL
     if bios_obj.enable_disable_sol(value='no') is False:
         log.warning('Failed to set console redirect default values')
     if bios_obj.console_redirect_defaults() is False:
         log.warning('Failed to set console redirect default values')
     aetest.loop.mark(
         self.verify_basic_boot_order,
         boot_device=self.config_obj.keys())
Ejemplo n.º 7
0
 def setup(self, mem_mode_array, cimc_util_obj, config):
     '''
     Loops through testcase for all the memory mode config passed from job file
     and loads host related details
     '''
     host_detail_config = config.host_info[0].nw_intf_list[0]
     host_info_config = config.host_info[0].host_detail
     logger.info("IP : " + host_detail_config.ip_address + "\n user : "******"\n pass : "******"Host OS is pinging  ...")
     else:
         output = self.boot_order_obj.set_boot_order_HDD()
         if output == True:
             host_ping_status = cimc_util_obj.verify_host_up(
                 hostname=self.host_ip,
                 wait_for_ping_fail=False,
                 wait_time=600)
             if host_ping_status is True:
                 logger.info("Host OS is pinging  ...")
             else:
                 logger.error("ERROR :Host OS is not pinging \
                             ,after setting the boot order to HDD and retrying ..."
                              )
                 logger.error(
                     "Testcase failed .... since Unabke to boot to OS")
     aetest.loop.mark(self.validate_memory_config_in_cimc_and_host,
                      mem_mode=mem_mode_array)
Ejemplo n.º 8
0
 def get_host_by_name(self, name):
     host_details = self.client.factory.create("EnumHostDetailLevel")
     response = self.client.service.hostRetrieveByName(name,
                                                       sID=self.session_id)
     return HostUtils(self.config).create_host(response)