Beispiel #1
0
    def __init__(self, host, domain_id, bus_id, devfun_id):
        super(Atwood, self).__init__(host, domain_id, bus_id, devfun_id)
        self.tp_path = "~"
        self.host = host

        # load port config
        portconf = PortConf(PORTCONF)
        portconf.load_ports_config(host.crb['IP'])
        pci_addr = ':'.join((domain_id, bus_id, devfun_id))
        if not portconf.check_port_available(pci_addr):
            raise PortConfigParseException("Atwood must configured")

        port_cfg = portconf.get_ports_config()[pci_addr]

        if 'tp_ip' not in port_cfg.keys():
            raise PortConfigParseException("Atwood must configure test point ip")
        if 'passwd' not in port_cfg.keys():
            raise PortConfigParseException("Atwood must configure host password")

        crb = {}
        crb['IP'] = port_cfg['tp_ip']
        crb['pass'] = port_cfg['passwd']

        if 'tp_path' in port_cfg.keys():
            self.tp_path = port_cfg['tp_path']

        # create addtional session
        self.ctrl_crb = CtrlCrb(crb)
Beispiel #2
0
 def load_portconf(self):
     """
     Load port config for this virtual machine
     """
     self.conf = PortConf()
     self.conf.load_ports_config(self.vm_name)
     self.ports_cfg = self.conf.get_ports_config()
Beispiel #3
0
    def __init__(self, host, domain_id, bus_id, devfun_id):
        super(BoulderRapid, self).__init__(host, domain_id, bus_id, devfun_id)

        self.tp_path = "~"
        self.sec_port = False
        self.host = host

        # load port config
        portconf = PortConf(PORTCONF)
        portconf.load_ports_config(host.crb['IP'])
        pci_addr = ':'.join((domain_id, bus_id, devfun_id))
        if not portconf.check_port_available(pci_addr):
            raise PortConfigParseException("BoulderRapid must configured")

        port_cfg = portconf.get_ports_config()[pci_addr]

        # secondary port do not need reinitialize
        if 'sec_port' in port_cfg.keys():
            print GREEN("Skip init second port test point session")
            if 'first_port' not in port_cfg.keys():
                raise PortConfigParseException(
                    "BoulderRapid second port must configure first port")
            # find net_device by pci_addr
            first_addr = port_cfg['first_port']
            port_info = self.host.get_port_info(first_addr)
            if port_info is None:
                raise PortConfigParseException(
                    "BoulderRapid first port not found")
            # get addtional session
            netdev = port_info['port']
            self.ctrl_crb = netdev.get_control()
            self.sec_port = True
            return

        if 'tp_ip' not in port_cfg.keys():
            raise PortConfigParseException(
                "BoulderRapid must configure test point ip")
        if 'passwd' not in port_cfg.keys():
            raise PortConfigParseException(
                "BoulderRapid must configure host password")

        crb = {}
        crb['IP'] = port_cfg['tp_ip']
        crb['pass'] = port_cfg['passwd']

        if 'tp_path' in port_cfg.keys():
            self.tp_path = port_cfg['tp_path']

        # create addtional session
        self.ctrl_crb = CtrlCrb(crb)
Beispiel #4
0
    def __init__(self, crb, serializer):
        self.NAME = 'dut' + LOG_NAME_SEP + '%s' % crb['My IP']
        super(Dut, self).__init__(crb, serializer, self.NAME)

        self.host_init_flag = False
        self.number_of_cores = 0
        self.tester = None
        self.cores = []
        self.architecture = None
        self.ports_info = []
        self.conf = PortConf()
        self.ports_map = []
        self.virt_pool = None
        # hypervisor pid list, used for cleanup
        self.virt_pids = []
Beispiel #5
0
    def __init__(self, crb, serializer, dut_id):

	print("********** MyDut python file first line")

        self.NAME = 'dut' + LOG_NAME_SEP + '%s' % crb['My IP']
        super(MyDut, self).__init__(crb, serializer, self.NAME, alt_session=True, dut_id=dut_id)
        self.host_init_flag = False
        self.number_of_cores = 0 # changed here
        self.tester = None
        self.cores = []
        self.architecture = None
        self.ports_info = []
        self.conf = PortConf()
        self.ports_map = []
        self.virt_pool = None
        # hypervisor pid list, used for cleanup
        self.virt_pids = []
        self.socket =0 # changed here