1. 07 1月, 2016 2 次提交
    • C
      selftests/functional/test_basic.py: remove references to old Plugin · c4180e95
      Cleber Rosa 提交于
      There are a few leftover references to the old Plugin classes in
      the functional tests. Let's remove them.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      c4180e95
    • L
      avocado.core.loader: Append test directory to sys.path · 62ae0d60
      Lucas Meneghel Rodrigues 提交于
      If a test has local imports (a fairly common use case),
      we have to append the base test dir to sys.path. Otherwise,
      we end up having a horrible traceback as a result:
      
      Exception loading test
      Traceback (most recent call last):
        File "/home/lmr/Code/avocado.lmr/avocado/core/runner.py", line 200, in _run_test
          instance = loader.load_test(test_factory)
        File "/home/lmr/Code/avocado.lmr/avocado/core/loader.py", line 262, in load_test
          test_module = imp.load_module(module_name, f, p, d)
        File "scylla_longevity.py", line 5, in <module>
          from sdcm.tester import ScyllaClusterTester
      ImportError: No module named sdcm.tester
      
      Which is clearly not wanted. We had this problem before
      and now we have a regression. It's time for a functional
      test to make sure we don't regress again.
      Signed-off-by: NLucas Meneghel Rodrigues <lookkas@gmail.com>
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      62ae0d60
  2. 04 1月, 2016 1 次提交
  3. 28 12月, 2015 1 次提交
    • C
      Pseudo terminals: add utility module · 003bfaed
      Cleber Rosa 提交于
      Based on previous experiences (GDB terminal redirection attempts),
      it's common for applications that need to allocate a pseudo to have
      the name of the allocated file. This is, unfortunately, something that
      the Python standard library doesn't give for free.
      
      This simple utility module wraps and extends the Python standard
      library `pty` module, providing a `openpty` function that, besides
      allocating the pseudo terminal, also returns its name.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      003bfaed
  4. 18 12月, 2015 16 次提交
  5. 16 12月, 2015 1 次提交
  6. 15 12月, 2015 1 次提交
    • C
      selftests/functional/test_output.py: skip test on absence of PIL library · 5f7bafd0
      Cleber Rosa 提交于
      The `test_gendata` test of `OutputTest` runs the example test
      `gendata.py`, but the `gendata.py` itself has a conditional in one of
      the tests that make use of the PIL (aka Pillow package) library and
      does nothing if it's missing.
      
      PIL (Pillow) is highly dependent on C compilers and libraries to be
      able to build itself. This makes systems it harder to run the full
      Avocado self tests on more diverse (usually minimalist) systems.
      
      So, let's make that functional test optional, if the libraries are not
      present.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      5f7bafd0
  7. 11 12月, 2015 1 次提交
    • C
      Human output: functional test fixes · cb4b6d97
      Cleber Rosa 提交于
      There are a couple of functional unittests that assume that a given
      output was produced by the regular UI, that is, the Human output
      format.
      
      That is fine, since they're functional tests. But, some situations
      lead to test errors, instead of pointing failures. Let's turn those
      into explicit checks and fail properly instead of producing errors.
      
      Note: These errors were visible when the human output was disabled, in
      the plugin overhaul work, but the fixes still make sense independently
      of that work.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      cb4b6d97
  8. 07 12月, 2015 1 次提交
    • C
      virtualenv: allow tests to run properly on them · 63aa6df6
      Cleber Rosa 提交于
      While going through the dependency list (requirements*.txt files) and
      performing our self tests out of virtual environments, I noticed that
      some tests are run outside the virtual environments.
      
      The reason is that, even though the virtual environment is activated
      for the test session (and say, `which python` gives `/venv/bin/python`),
      we have hard coded `/usr/bin/python` in most places.
      
      According to the some discussions on the virtualenv project itself[1],
      a quick solution is to revert to the also common `/usr/bin/env python`
      way of pointing to the Python interpreter.
      
      [1] - https://github.com/pypa/virtualenv/issues/124Signed-off-by: NCleber Rosa <crosa@redhat.com>
      63aa6df6
  9. 03 12月, 2015 3 次提交
  10. 28 11月, 2015 2 次提交
  11. 03 11月, 2015 1 次提交
  12. 30 10月, 2015 3 次提交
    • C
      Exit codes: use symbolic names in functional self tests · 49fcd32c
      Cleber Rosa 提交于
      Since we define the meaning of each exit code, we should be using that
      ourselves.
      
      Functional tests have been coded using literal values, and there may
      be a good reason for that: proving that the API stands.  But there's a
      big issue: we have not declared those codes as some kind of an
      external API and guarantee stability. Also the subsequent changes in
      this series actually change the meaning and values of those.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      49fcd32c
    • L
      avocado: Add support for --dry-run · 069e3784
      Lukáš Doktor 提交于
      It's prone to mistakes maintain two separate ways to query for tests
      (running them and displaying available ones).
      
      This patch implements --dry-run, which follows the full "run" process,
      only instead of running the test it skips them.
      
      Additionally the --dry-run uses some tweaks to tell them apart from
      normal executions, namely:
      
          1. No sysinfo gathering
          2. Unique id is 0000000000000000000000000000000000000000
          3. Unless user provides custom log location, fresh tmpdir is used
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      069e3784
    • L
      avocado.core.multiplex: Implement proper AvocadoParams.iteritems() · fa882b98
      Lukáš Doktor 提交于
      Improve the `AvocadoParams.iteritems()` to return unique items only
      in the same fashion `multiplexer` does it.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      fa882b98
  13. 28 10月, 2015 1 次提交
    • C
      Plugins: remove external plugin support · 7b969527
      Cleber Rosa 提交于
      In preparation for the large plugin refactor, let's simplify the code ASAP
      and drop related (custom) functionality that is going to be replaced.
      
      Standard setuptools entrypoints is going to provide better capability then
      our custom code that supports external 'avocado_*.py'module loading.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      7b969527
  14. 15 10月, 2015 1 次提交
  15. 08 10月, 2015 1 次提交
    • L
      avocado: Mass import cleanups · f4e82a6e
      Lucas Meneghel Rodrigues 提交于
      This is an automated mass import cleanup across all
      avocado source files:
      
      1) Imports follow the order:
       * Standard library imports
       * Non standard library external imports
       * Internal imports
       All separated by a single line
      2) One line between imports and the rest of the code
      3) Remove unused imports in the process
      Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
      f4e82a6e
  16. 07 10月, 2015 4 次提交
    • C
      Test Loader: support for enable/disable docstring tags · 1eb065e5
      Cleber Rosa 提交于
      Since the test loader now attempts to find Avocado instrumented tests
      by using a parser and doesn't really load/execute test files, it can't
      tell if a given class inherits from avocado.Test.
      
      For those cases, a developer may signal, using a docstring tag, that
      either:
      
       * A test class that doesn't look like an Avocado test class is indeed
         one ("🥑 enable")
       * A test class that looks like an Avocado test class should not be
         treated as such ("🥑 disable")
      
      Also included is a a simple optimization by breaking earlier from the
      parser loop.
      
      Changes from v1:
         * Added two more tests and suggestions by Lukáš Doktor
      
      Changes from v0:
         * Added fix reported by Lukáš Doktor
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      CC: Lukáš Doktor <ldoktor@redhat.com>
      1eb065e5
    • C
      Test Loader: add the concept of test tags · ca6675bd
      Cleber Rosa 提交于
      Inside test classes there may docstrings which may contain tags that
      give special meaning. The tags are defined by "🥑 <value>" in a
      single line. For now the only two "official" Avocado tags values
      exist:
      
       * enable: the class is an Avocado INSTRUMENTED test, even if it
         doesn't "look like" one.
       * disable: the class is *NOT* an Avocado INSTRUMENTED test, even if
         looks like one.
      
      Changes from v0:
       * Use unittest2 on Python 2.6
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      ca6675bd
    • C
      Doc test: check condition for building the docs with Sphinx · 52c8f93b
      Cleber Rosa 提交于
      Sphinx will attempt to fetch the Python objects inventory during the build
      process. If for some reason, this test is being run on a machine that can
      not access that address simply because of network restrictions (or the
      developer may simply be on a plane) then it's better to SKIP the test than
      to give a false positive.
      
      Changes from v0:
       * Use unittest2 on Python 2.6
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      52c8f93b
    • L
      Rename inner_runner to external_runner · 6274e641
      Lukáš Doktor 提交于
      This patch doesn't change any functionality, it only renames the
      inner_runner to external_runner (the plugin is called simply external)
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      6274e641