1. 08 3月, 2018 2 次提交
  2. 26 2月, 2018 1 次提交
    • C
      avocado/utils/process.py: make CmdResult.std{out,err}_text smarter · 72bdab0f
      Cleber Rosa 提交于
      In situations where a user of the CmdResult class manually sets the
      stdout/stderr attributes to a string, instead of the recommended and
      documented content of type "bytes", it won't be possible to "decode"
      the bytes into a string of a given encoding, and we'll end up with
      a crash.
      
      Since the goal of std{out,err}_text is to return a text version
      of stdout, if itself already is of such a type, let's just return
      it.
      
      Additionally, if the data cannot be "decode()d", let's raise an
      explicit TypeError on this location, rather than later in the code
      when its value is attempted to be used.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      72bdab0f
  3. 23 2月, 2018 1 次提交
    • C
      selftests/unit/test_runner_queue.py: use absolute path for module · 1e4fdaa8
      Cleber Rosa 提交于
      Looks like the Python 3 module import code behaves differently than
      Python 2 with regards to where it looks modules by name:
      
         File "/home/cleber/src/avocado/avocado/avocado/core/test.py", line 932, in _run_avocado
            raise test_exception
         File "/home/cleber/src/avocado/avocado/avocado/core/test.py", line 819, in _run_avocado
            testMethod()
         File "/home/cleber/src/avocado/avocado/avocado/core/test.py", line 1371, in test
            self.error(self.exception)
         File "/home/cleber/src/avocado/avocado/avocado/core/test.py", line 1041, in error
            raise exceptions.TestError(message)\navocado.core.exceptions.TestError: Traceback (most recent call last):
         File "/usr/lib64/python3.6/imp.py", line 297, in find_module
            raise ImportError(_ERR_MSG.format(name), name=name)
         ImportError: No module named \'whiteboard\'\n\n'
      
      Effectively, this means when running this test, on Python 3, on the
      parallel mode, the change of directory implemented there
      (on selftests/checkall) will make Python 3 fail to find this module,
      and the test will fail.
      
      This makes the reference to the module path absolute, so no matter
      where this test is run from, it should be able to find the module.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      1e4fdaa8
  4. 16 2月, 2018 1 次提交
    • C
      avocado.utils.iso9660: always deal with bytes · 01c84866
      Cleber Rosa 提交于
      The avocado.utils.process module has been changed so that the content
      of stdout and stderr are now bytes.  The content generated by the
      iso9660 backend implementations should also operate on bytes, given
      that it makes little sense for the library to assume a given content
      type of a file (inside an iso9660 archive).
      
      To make the data returned by the various backend `read()`
      implementations always return bytes on both Python 2 and 3, an
      explicit conversion is done from strings to bytes (which affects only
      Python 2, since Python 3 already operates with bytes on files opened
      in binary mode).
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      01c84866
  5. 15 2月, 2018 1 次提交
  6. 12 2月, 2018 2 次提交
  7. 04 2月, 2018 1 次提交
  8. 20 1月, 2018 1 次提交
  9. 19 1月, 2018 1 次提交
    • C
      selftests/unit/test_safeloader.py: do not rely on assertRegex* methods · 70d525f1
      Cleber Rosa 提交于
      The prevailing coding style of Avocado (unittest.TestCase) tests is to
      use the specialized assert methods, such as assertNotRegexpMatches.
      
      Unfortunately, the regular expression related assertion methods have
      been through a messy renaming.  In theory, assertNotRegexpMatches and
      assertRegexpMatches should be available in Python 3.0 and 3.1, but not
      in Python >= 3.2, where it got renamed to assertRegex and
      assertNotRegex.
      
      In practice, in my system with Python 3.6.3, I see:
      
      >>> unittest.TestCase.assertNotRegexpMatches
      <function TestCase._deprecate.<locals>.deprecated_func at 0x7f3b85b709d8>
      
      But in Travis, with Python 3.4, it's not available:
      
      ERROR: test_directives_regex (selftests.unit.test_safeloader.DocstringDirectives)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/home/travis/build/avocado-framework/avocado/selftests/unit/test_safeloader.py", line 135, in test_directives_regex
          self.assertNotRegexpMatches(directive, safeloader.DOCSTRING_DIRECTIVE_RE)
      AttributeError: 'DocstringDirectives' object has no attribute 'assertNotRegexpMatches'
      
      Let's simplify things and just use a regex match and check for its
      result.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      70d525f1
  10. 04 1月, 2018 3 次提交
  11. 24 12月, 2017 1 次提交
  12. 22 12月, 2017 3 次提交
  13. 21 12月, 2017 2 次提交
  14. 20 12月, 2017 1 次提交
  15. 16 12月, 2017 2 次提交
  16. 15 12月, 2017 1 次提交
    • C
      Tree: add unittests · b97d040f
      Cleber Rosa 提交于
      The `avocado.core.tree.TreeNode` is the foundation of the current
      Parameter System (`avocado.core.parameters.AvocadoParams`), but it
      lacks unittests that only deal with itself.
      
      Some tests that exercise the Multiplexer version of the `TreeNodes`
      (`MuxTreeNodes`) exist, but again, that's not what the core Parameter
      System is based on.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      b97d040f
  17. 14 12月, 2017 2 次提交
  18. 06 12月, 2017 1 次提交
  19. 01 12月, 2017 3 次提交
  20. 30 11月, 2017 2 次提交
  21. 29 11月, 2017 3 次提交
    • C
      Move mux module to the variater plugin · b3812995
      Cleber Rosa 提交于
      There was once an idea that the "mux" would be an interface that would
      be reused by other implementations (say, json_to_mux, foo_to_mux,
      etc).  Now, it seems much more important to make the Avocado varianter
      design and interfaces better, and advocate its use instead.
      
      Additionally, there has always been a gray line between the
      Multiplexer and the Avocado params.  Moving the mux outside of the
      Avocado core will help to draw clearer lines.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      b3812995
    • C
      Remove 36.0 (LTS) to 51.0 (pre 52.0 LTS) jobdata support · bc59f850
      Cleber Rosa 提交于
      And include jobdata results and a test for 52.0 (LTS).
      
      The 52.0 release, an LTS release, was meant to allow transitions from
      the previous LTS version (36.0lts) and it did so including the ability
      to replay jobs created with the older version.
      
      Now, we're 6+ months into the 52.0 release, and as promised, we'll
      stop maintaining 36.0lts.  To keep to code clean, let's remove all
      this compatibility with versions before 52.0.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      bc59f850
    • C
      FDDrainer: flush the file based handlers before filling results · 41dfb4b9
      Cleber Rosa 提交于
      The FDDrainer reads from the PIPEs and writes to both the internal
      StringIO instances and to stream logging handlers.  There are no
      guarantees that the logging handlers will flush the content before the
      FDDrainer finishes.
      
      Let's explicitly close all the handlers (which should really be
      FileHandlers) associated with the stream loggers, which should flush
      and sync the content on the files themselves.
      
      Additionally, the combined drainer was being missed from the flush
      process, and was causing some output in that mode to be unavailable on
      generated output.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      41dfb4b9
  22. 18 11月, 2017 2 次提交
  23. 16 10月, 2017 1 次提交
  24. 14 10月, 2017 1 次提交
  25. 13 10月, 2017 1 次提交