Пример #1
0
    def check_ports_available(self, pci_bus, pci_id):
        """
        Check that whether auto scanned ports ready to use
        """
        pci_addr = "%s:%s" % (pci_bus, pci_id)
        if self.nic == 'any':
            return True
        elif self.nic == 'cfg':
            if self.conf.check_port_available(pci_bus) is True:
                return True
        elif self.nic not in NICS.keys():
            self.logger.warning("NOT SUPPORTED NIC TYPE: %s" % self.nic)
        else:
            codename = NICS[self.nic]
            if pci_id == codename:
                return True

        return False
Пример #2
0
    def check_ports_available(self, pci_bus, pci_id):
        """
        Check that whether auto scanned ports ready to use
        """
        pci_addr = "%s:%s" % (pci_bus, pci_id)
        if self.nic == 'any':
            return True
        elif self.nic == 'cfg':
            if self.conf.check_port_available(pci_bus) is True:
                return True
        elif self.nic not in NICS.keys():
            self.logger.warning("NOT SUPPORTED NIC TYPE: %s" % self.nic)
        else:
            codename = NICS[self.nic]
            if pci_id == codename:
                return True

        return False
Пример #3
0
def config_execution():
    global driver_name
    global suites
    global target
    global nic_type

    print('============================================================')
    print "Setting execution plan"
    if not dut_ip:
        print RED("Need to configure 'DUT&Tester crb' first!!!")
        return False
    # default execution
    driver_name = 'igb_uio'
    target = 'x86_64-native-linuxapp-gcc'
    targets = [
        'x86_64-native-linuxapp-gcc', 'x86_64-native-linuxapp-icc',
        'i686-native-linuxapp-gcc', 'i686-native-linuxapp-icc',
        'x86_64-native-bsdapp-gcc', 'x86_64-native-bsdapp-clang',
        'arm64-armv8a-linuxapp-gcc', 'arm64-dpaa2-linuxapp-gcc',
        'arm64-thunderx-linuxapp-gcc', 'arm64-xgene1-linuxapp-gcc'
    ]
    nic_type = 'cfg'

    exec_option = {
        'prompt': 'Choose default or manually',
        'type': 'choice',
        'help':
        'Gernerate execution file base on default or ' + 'manually configured',
        'options':
        ['default execution file', 'manually configure execution file'],
        'default': '0'
    }
    opt = Option(**exec_option)
    opt.parse_input()
    index = opt.choice
    if index == 0:
        autoexec_option = {
            'prompt': 'Choose one of them',
            'type': 'choice',
            'help': 'Choose one of below reference ' + 'configuration file',
            'options': executions,
            'default': '3'
        }
        opt = Option(**autoexec_option)
        auto_execution = opt.parse_input()
        load_execution('executions/' + auto_execution)
    else:
        suites_option = {
            'prompt': 'Choose suites to run',
            'type': 'multichoice',
            'help': 'Suites in DTS',
            'options': suites,
            'default': 'all'
        }
        opt = Option(**suites_option)
        suites = opt.parse_input()

    nics = ['cfg']
    nics += NICS.keys()
    nic_option = {
        'prompt': 'Choose one of nics',
        'type': 'choice',
        'help': 'Choose one of dpdk support NIC',
        'options': nics,
        'default': '0'
    }
    opt = Option(**nic_option)
    nic_type = opt.parse_input()

    target_option = {
        'prompt': 'Choose target for execution',
        'type': 'choice',
        'help': 'Choose one of dpdk targets',
        'options': targets,
        'default': '0'
    }
    opt = Option(**target_option)
    target = opt.parse_input()

    driver_option = {
        'prompt': 'Choose one of them',
        'type': 'choice',
        'help': 'Choose one of dpdk support driver',
        'options': ['igb_uio', 'vfio-pci'],
        'default': '0'
    }
    opt = Option(**driver_option)
    driver_name = opt.parse_input()

    return True