1. 25 7月, 2018 1 次提交
  2. 21 7月, 2018 1 次提交
    • C
      selftests/functional/test_basic.py: prevent unversioned Python · 9b2db940
      Cleber Rosa 提交于
      `examples/tests/simplewarning.sh` calls a generic avocado command,
      which gets added to the path by the test code. That generic avocado
      command is `scripts/avocado`, from the source repository, which
      contains the unversioned `/usr/bin/env python`.
      
      Under some environments, such as Fedora >= 29, there may be no
      unversioned Python binary.  Let's respect the UNITTEST_AVOCADO_CMD
      environment variable, and add the the directory containting that
      binary to the PATH.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      9b2db940
  3. 19 7月, 2018 3 次提交
  4. 17 7月, 2018 1 次提交
  5. 16 7月, 2018 1 次提交
    • C
      Asset Fetcher: avoid clashes by using namespace dirs · 111c2a80
      Cleber Rosa 提交于
      The current implementation fails to cache multiple files if their
      name is the same.  The filename *only* will be considered when
      looking at the cached directories, and if hashes are not given,
      users will end up with the wrong files, even when they give
      unique URLs to different files.
      
      To give a real example, suppose we have one test that needs a specific
      asset file (such as an specific kernel version):
      
         def test_x86_64(self):
            self.fetch_asset('https://avocado-project.org/data/linux/x86_64/vmlinuz',
                             asset_hash='0123456789abcdef...')
      
      While a second test wants the daily version of a given asset:
      
        def test_aarch64(self):
            self.fetch_asset('https://avocado-project.org/data/linux/aarch64/vmlinuz',
                             expire='1d')
      
      If test_x86_64() runs first, it will write to $CACHE_DIR/vmlinuz.  The
      second test, test_aarch64(), may end up having the completely wrong
      file.  Using `asset_cache` is not a possibility, given that it wants
      the daily kernel.
      
      These changes put asset files on a "cache relative directory".  If a
      hash is given, it's safe to put files in a directory indexed "by
      name".  If not, they're put in a directory named after the URL (minus
      the filename).
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      111c2a80
  6. 04 7月, 2018 2 次提交
  7. 29 6月, 2018 1 次提交
  8. 27 6月, 2018 1 次提交
    • C
      Test Loader: use enums from from Python 3.4 · 5e4c4d16
      Cleber Rosa 提交于
      This change reveleaed a couple of location in the symbolic names where
      not being used, but their special values were being evaluated.  Let's
      avoid using the special (and subtle) meaning of ALL (True) and
      DEFAULT/AVAILABLE (which evaluate to False).
      
      The enum library is part of the standard library, starting from 3.4
      (which is the mininum version we require for Avocado).  On Python 2.7,
      we can rely on the backport package.
      
      This is of course not necessary right now, but I feel that we can
      continue modernizing the code base, and not wait for 2020 and then be
      liberated to use newer constructs and libraries.
      
      Reference: https://trello.com/c/k90E1kdg/1357-loader-remove-compatibility-aliasesSigned-off-by: NCleber Rosa <crosa@redhat.com>
      5e4c4d16
  9. 26 6月, 2018 5 次提交
  10. 23 6月, 2018 1 次提交
  11. 20 6月, 2018 1 次提交
    • C
      selftests/checkall: check load failures · 580f6101
      Cleber Rosa 提交于
      During the parallel execution of unittests, only conditions for FAIL
      and ERROR are checked.  Under Python > 3.4, that's fine because load
      failures are treated as FAILures:
      
         $ python3.6
         Python 3.6.5 (default, Mar 29 2018, 18:20:46)
         [GCC 8.0.1 20180317 (Red Hat 8.0.1-0.19)] on linux
         Type "help", "copyright", "credits" or "license" for more information.
         >>> import unittest.loader
         >>> l = unittest.loader.TestLoader()
         >>> l.loadTestsFromName('selftests.unit.test_utils_cpu.Cpu.test_cpu_arch_ppc64_power8')
         <unittest.suite.TestSuite tests=[<unittest.loader._FailedTest testMethod=test_utils_cpu>]>
      
      But, under Python 3.4, no such treatment is done:
      
         $ python3.4
         Python 3.4.3 (default, Jan 13 2018, 13:06:46)
         [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux
         Type "help", "copyright", "credits" or "license" for more information.
         >>> import unittest.loader
         >>> l = unittest.loader.TestLoader()
         >>> l.loadTestsFromName('selftests.unit.test_utils_cpu.Cpu.test_cpu_arch_ppc64_power8')
         Traceback (most recent call last):
           File "<stdin>", line 1, in <module>
           File "/home/cleber/.local/lib/python3.4/unittest/loader.py", line 114, in loadTestsFromName
             parent, obj = obj, getattr(obj, part)
         AttributeError: 'module' object has no attribute 'test_utils_cpu'
      
      This implements a simple check for load failures, which is not
      perfect, but better than none.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      580f6101
  12. 19 6月, 2018 1 次提交
  13. 12 6月, 2018 8 次提交
  14. 11 6月, 2018 3 次提交
  15. 09 6月, 2018 3 次提交
  16. 08 6月, 2018 2 次提交
  17. 06 6月, 2018 1 次提交
  18. 30 5月, 2018 1 次提交
  19. 28 5月, 2018 1 次提交
  20. 24 5月, 2018 1 次提交
  21. 21 5月, 2018 1 次提交