1. 25 Apr, 2016 1 commit
  2. 29 Jan, 2016 6 commits
    • Stephen Warren's avatar
      test/py: dfu: allow boardenv to specify test sizes · 26db3a61
      Stephen Warren authored
      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: 's avatarStephen Warren <swarren@nvidia.com>
      Acked-by: 's avatarSimon Glass <sjg@chromium.org>
      26db3a61
    • Stephen Warren's avatar
      test/py: Provide custom IDs when parametrizing tests · d20e5e97
      Stephen Warren authored
      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: 's avatarStephen Warren <swarren@nvidia.com>
      Reviewed-by: 's avatarSimon Glass <sjg@chromium.org>
      d20e5e97
    • Stephen Warren's avatar
      test/py: Quote consistency · a2ec5606
      Stephen Warren authored
      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: 's avatarStephen Warren <swarren@nvidia.com>
      Reviewed-by: 's avatarSimon Glass <sjg@chromium.org>
      a2ec5606
    • Stephen Warren's avatar
      test/py: use " for docstrings · e8debf39
      Stephen Warren authored
      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: 's avatarStephen Warren <swarren@nvidia.com>
      Reviewed-by: 's avatarSimon Glass <sjg@chromium.org>
      e8debf39
    • Stephen Warren's avatar
      test/py: dfu: error out if USB device already exists · be1df826
      Stephen Warren authored
      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: 's avatarStephen Warren <swarren@nvidia.com>
      Reviewed-by: 's avatarSimon Glass <sjg@chromium.org>
      be1df826
    • Stephen Warren's avatar
      test/py: add DFU test · f5d196d0
      Stephen Warren authored
      Add a test of DFU functionality to the Python test suite. The test
      starts DFU in U-Boot, waits for USB device enumeration on the host,
      executes dfu-util multiple times to test various transfer sizes, many
      of which trigger USB driver edge cases, and finally aborts the DFU
      command in U-Boot.
      
      This test mirrors the functionality previously available via the shell
      scripts in test/dfu, and hence those are removed too.
      Signed-off-by: 's avatarStephen Warren <swarren@nvidia.com>
      Acked-by: 's avatarLukasz Majewski <l.majewski@samsung.com>
      Acked-by: 's avatarSimon Glass <sjg@chromium.org>
      f5d196d0