SHARE
TWEET

Untitled

a guest Feb 19th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Test(object):
  2.  
  3.     def __init__(self):
  4.         self.b1 = Board()
  5. #        network.get_ports(self.b1, "rgmii*")
  6. #        network.get_ports(self.b1, "sgmii*")
  7. #        self.b1.p1 = network.install_match_ports(self.b1, "sgmii*", max_match=1
  8.         self.b1.p1 = Port(speed="1G", option="MCCPORT")
  9.  
  10.         self.lan_server = TestWorkStation(self.cfg)
  11.         self.lan_server.p1 = TestWorkStationPort(None)
  12.         self.lan_server.map_cfg(self.cfg, "lan_server")
  13.  
  14.     def setup(self):
  15.         """ Operations required during setup.
  16.         Board is power cycled and uboot prompt is checked.
  17.         Uboot is configured and updated if necessary (uboot_startup).
  18.         Linux is booted from default source"""
  19.         power_on(self.b1)
  20.         uboot_startup(self.b1)
  21.         linux_startup(self.b1)
  22.  
  23.     def test(self):
  24.  
  25.         packet_size_list = [1, 64, 1500, 1800]
  26.  
  27.         network.add_ports(self.b1)
  28.  
  29.         log.info("Disconnect all connections from %s" % self.b1.cfg["name"])
  30.         connection.disconnect_all(self.b1.cfg["name"])
  31.  
  32. #        log.info("Open the ssh console of workstation %s" %
  33. #                           self.lan_server.cfg["server_ip"])
  34. #        ws_cli = self.lan_server.open_console()
  35.         ws_p1 = self.lan_server.p1
  36.  
  37.  
  38.         fail_flag = 0
  39.  
  40.         for port in self.b1.port_list:
  41.             log.info("Connect %s_%s to lan" % (self.b1.cfg["name"],
  42.                                            port.phy_name))
  43.             connection.connect_board_to_tws(self.b1, port,
  44.                          self.lan_server.p1, self.lan_server.cfg, "lan1g")
  45.             log.info("%s is connected, Lan ip: %s, Board ip: %s" %
  46.                     (self.lan_server.p1.type, self.lan_server.p1.ip_addr,
  47.                      port.ip_addr))
  48.  
  49.             log.info("Setup %s" % port.linux_name)
  50.             network.ifconfig_setup(self.b1.cli, port)
  51.  
  52.             log.info("Ping server from board")
  53.             for packet_size in packet_size_list:
  54.                 try:
  55.                     network.ping(self.b1.cli, ws_p1, packetsize=packet_size)
  56.                 except pexpect.TIMEOUT:
  57.                     fail_flag += 1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top