1. 02 2月, 2016 1 次提交
  2. 30 1月, 2016 20 次提交
  3. 29 1月, 2016 19 次提交
    • S
      test/py: dfu: allow boardenv to specify test sizes · 26db3a61
      Stephen Warren 提交于
      Allow the env__dfu_configs boardenv data to specify the set of DFU
      transfer sizes to test. Manually specifying test sizes is useful if you
      wish to test multiple DFU configurations (e.g. SD card ext4 filesystem, SD
      card whole raw partition, RAM, etc.), but don't want to test every
      single transfer size on each, to avoid bloating the overall time taken by
      testing. If the boardenv doesn't specify a set of sizes, the built-in list
      is used as a default, preserving backwards-compatibility.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      26db3a61
    • S
      test/py: fix a couple typos in comments · db261f00
      Stephen Warren 提交于
      s/updata/update/.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      db261f00
    • S
      test/py: run sandbox in source directory · d27f2fc1
      Stephen Warren 提交于
      Some unit tests expect the cwd of the sandbox process to be the root
      of the source tree. Ensure that requirement is met.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      d27f2fc1
    • S
      test/py: pass test DTB to sandbox · 77bcb22d
      Stephen Warren 提交于
      This is required for at least "ut dm" to operate correctly.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      77bcb22d
    • S
      test/py: correctly log xfail/xpass tests · 78b39cc3
      Stephen Warren 提交于
      Tests can complete in passed, skipped, xpass, xfailed, or failed, states.
      Currently the U-Boot log generation code doesn't handle the xfailed or
      xpass states since they aren't used. Add support for the remaining states.
      Without this, tests that xfail end up being reported as skipped.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      78b39cc3
    • S
      test/py: detect another "bad pattern" in console output · 9129d9f5
      Stephen Warren 提交于
      Many error situations in U-Boot print the message:
          ### ERROR ### Please RESET the board ###
      
      Add this to the list of bad patterns the test system detects. One
      practical advantage of this change is to detect the case where sandbox
      is told to use a particular DTB file, and the file cannot be opened.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      9129d9f5
    • S
      test/py: check for bad patterns everywhere we wait · 0c6189b5
      Stephen Warren 提交于
      Currently, bad patterns are only honored when executing a shell command.
      Other cases, such as the initial boot-up of U-Boot or when interacting
      with command output rather than gathering all output prior to the shell
      prompt, do not currently look for bad patterns in console output. This
      patch makes sure that bad patterns are honored everywhere.
      
      One benefit of this change is that if U-Boot sandbox fails to start up,
      the error message it emits can be caught immediately, rather than relying
      on a (long) timeout when waiting for the expected signon message and/or
      command prompt.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      0c6189b5
    • S
      test.py: calculate bad patterns on change only · e4119ebb
      Stephen Warren 提交于
      A future patch will use the bad_patterns array in multiple places. Rather
      than duplicating the code to calculate it, or even sharing it in a
      function and simply calling it redundantly when nothing has changed, only
      re-calculate the list when some change is made to it. This reduces work.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      e4119ebb
    • S
      test/py: fix spawn.expect multiple match handling · 44ac762b
      Stephen Warren 提交于
      Multiple patterns may be passed to spawn.expect(). The pattern which
      matches at the earliest position should be designated as the match. This
      aspect works correctly. When multiple patterns match at the same position,
      priority should be given the the earliest entry in the list of patterns.
      This aspect does not work correctly. This patch fixes it.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      44ac762b
    • S
      test/dm: clear unit test failure count each run · 26e1becc
      Stephen Warren 提交于
      The ut command prints a test failure count each time it is executed.
      This is stored in a global variable which is never reset. Consequently,
      the printed failure count accumulates across runs. Fix this by clearing
      the counter each time "ut" is invoked.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      26e1becc
    • S
      test/py: Provide custom IDs when parametrizing tests · d20e5e97
      Stephen Warren 提交于
      When pytest generates the name for parametrized tests, simple parameter
      values (ints, strings) get used directly, but more complex values such
      as dicts are not handled. This yields test names such as:
      
          dfu[env__usb_dev_port0-env__dfu_config0]
          dfu[env__usb_dev_port0-env__dfu_config1]
      
      Add some code to extract a custom fixture ID from the fixture values, so
      that we end up with meaningful names such as:
      
          dfu[micro_b-emmc]
          dfu[devport2-ram]
      
      If the boardenv file doesn't define custom names, the code falls back to
      the old algorithm.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      d20e5e97
    • S
      test/py: Quote consistency · a2ec5606
      Stephen Warren 提交于
      When converting test/py from " to ', I missed a few places (or added a
      few inconsistencies later). Fix these.
      
      Note that only quotes in code are converted; double-quotes in comments
      and HTML are left as-is, since English and HTML use " not '.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      a2ec5606
    • S
      test/py: use " for docstrings · e8debf39
      Stephen Warren 提交于
      Python's coding style docs indicate to use " not ' for docstrings.
      
      test/py has other violations of the coding style docs, since the docs
      specify a stranger style than I would expect, but nobody has complained
      about those yet:-)
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      e8debf39
    • S
      test/py: make net test aware of USB and PCI enumeration · 56382a81
      Stephen Warren 提交于
      The existing net test executes a list of commands supplied by boardenv
      variable env__net_pre_commands. The idea was that boardenv would know
      whether the Ethernet device was attached to USB, PCI, ... and hence was
      the best place to put any commands required to probe the device.
      
      However, this approach doesn't scale well when attempting to use a single
      boardenv across multiple branches of U-Boot, some of which require "pci
      enum" to enumerate PCI and others of which don't, or don't /yet/ simply
      because various upstream changes haven't been merged down.
      
      This patch updates the test to require that the boardenv state which HW
      features are required for Ethernet to work, and lets the test itself map
      that knowledge to the set of commands to execute. Since this mapping is
      part of the test script, which is part of the U-Boot code/branch, this
      approach is more scalable. It also feels cleaner, since again boardenv
      is only providing data, rather than test logic.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      56382a81
    • S
      distro bootcmd: enumerate PCI before network operations · 986691fb
      Stephen Warren 提交于
      The PCI bus must be enumerated before PCI devices, such as Ethernet
      devices, are known to U-Boot. Enhance the distro boot commands to perform
      PCI enumeration when needed.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      986691fb
    • S
      distro bootcmd: make net boot only optionally start USB · 3483b75d
      Stephen Warren 提交于
      Currently, the distro boot commands always enumerate USB devices before
      performing network operations. However, depending on the board and end-
      user configuration, network devices may not be attached to USB, and so
      enumerating USB may not be necessary. Enhance the scripts to make this
      step optional, so that the user can decrease boot time if they don't
      need USB.
      
      This change is performed by moving the "usb start" invocation into a
      standalone variable. If the user desires, they can replace that
      variable's value with some no-op command such as "true" instead.
      
      Booting from a USB storage device always needs to enumerate USB devices,
      so this action is still hard-coded.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      3483b75d
    • S
      Implement "pci enum" command for CONFIG_DM_PCI · e578b92c
      Stephen Warren 提交于
      With CONFIG_DM_PCI enabled, PCI buses are not enumerated at boot, as they
      are without that config option enabled. No command exists to enumerate the
      PCI buses. Hence, unless some board-specific code causes PCI enumeration,
      PCI-based Ethernet devices are not detected, and network access is not
      available.
      
      This patch implements "pci enum" in the CONFIG_DM_PCI case, thus giving a
      mechanism whereby PCI can be enumerated.
      
      do_pci()'s handling of case 'e' is moved into a single location before the
      dev variable is assigned, in order to skip calculation of dev. The enum
      sub-command doesn't need the dev value, and skipping its calculation
      avoids an irrelevant error being printed.
      
      Using a command to initialize PCI like this has a disadvantage relative to
      enumerating PCI at boot. In particular, Ethernet devices are not probed
      during PCI enumeration, but only when used. This defers setting variables
      such as ethact, ethaddr, etc. until the first network-related command is
      executed. Hopefully this will not cause further issues. Perhaps in the
      long term, we need a "net start/enum" command too?
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      e578b92c
    • S
      test/py: dfu: error out if USB device already exists · be1df826
      Stephen Warren 提交于
      The DFU test requests U-Boot configure its USB controller in device mode,
      then waits for the host machine to enumerate the USB device and create a
      device node for it. However, this wait can be fooled if the USB device
      node already exists before the test starts, e.g. if some previous software
      stack already configured the USB controller into device mode and never
      de-configured it. This "previous software stack" could even be another
      test/py test, if U-Boot's own USB teardown does not operate correctly. If
      this happens, dfu-util may be run before U-Boot is ready to serve DFU
      commands, which may cause false test failures.
      
      Enhance the dfu test to fail if the device node exists before it is
      expected to.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      be1df826
    • S
      ARM: tegra: shut down USB device controller at boot · dd8204de
      Stephen Warren 提交于
      When loading U-Boot into RAM over USB protocols using tools such as
      tegrarcm or L4T's exec-uboot.sh/tegraflash.py, Tegra's USB device
      mode controller is initialized and enumerated by the host PC running
      the tool. Unfortunately, these tools do not shut down the USB
      controller before executing the downloaded code, and so the host PC
      does not "de-enumerate" the USB device. This patch implements optional
      code to shut down the USB controller when U-Boot boots to avoid leaving
      a stale USB device present.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      dd8204de