1. 13 4月, 2016 1 次提交
  2. 11 4月, 2016 3 次提交
  3. 07 4月, 2016 1 次提交
    • A
      avocado.code.job fix job return code on timed out jobs · 41177f0a
      Amador Pahim 提交于
      When a job is timed out during a test execution, we fail the test
      and put status ERROR in the test. The job then exits with the rc
      AVOCADO_TESTS_FAIL. This patch fixes this, making the test status
      INTERRUPTED and the job to exit with AVOCADO_JOB_INTERRUPTED.
      
      Also, when a job is timed out before a test, the test is skipped
      and the job exits with rc AVOCADO_ALL_OK. For that case, this patch
      makes the job to exit with AVOCADO_JOB_INTERRUPTED instead, keeping
      the test status as SKIP.
      
      Given this change, now we have the following combinations of test status
      and job return code:
      
      Case1:
          - Test1: PASS
          - Test2: SKIP (TestTimeoutSkip)
      
          Job RC: AVOCADO_JOB_INTERRUPTED
      
      Case2:
          - Test1: PASS
          - Test2: INTERRUPTED (TestTimeoutInterrupted)
          - Test3: SKIP (TestTimeoutSkip)
      
          Job RC: AVOCADO_JOB_INTERRUPTED
      
      Case3:
          - Test1: PASS
          - Test2: FAIL
          - Test3: INTERRUPTED (TestTimeoutInterrupted)
          - Test4: SKIP (TestTimeoutSkip)
      
          Job RC: AVOCADO_JOB_INTERRUPTED
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      41177f0a
  4. 30 3月, 2016 2 次提交
  5. 29 3月, 2016 1 次提交
  6. 26 3月, 2016 1 次提交
  7. 18 3月, 2016 1 次提交
    • C
      External Runner: deal with empty test URL · 139e717b
      Cleber Rosa 提交于
      A test base on the external runner feature depends on both the
      external runner and the test URL. These two are always combined to
      generate the complete command that will be executed by Avocado.
      
      But, the Avocado command line application does not require URLs to be
      given on the command line, because these may come from other sources
      on loaders other than the basic FileLoader.
      
      So, let's also explicitly require a URL to be given to to the External
      Runner loader to return a test factory (class and parameters).
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      139e717b
  8. 17 3月, 2016 1 次提交
  9. 16 3月, 2016 2 次提交
  10. 10 3月, 2016 1 次提交
    • C
      selftests/functional/test_basic.py: extend timeout on test_kill_stopped_sleep · 27029ff4
      Cleber Rosa 提交于
      Given the last CI jobs, RunnerSimpleTest:test_kill_stopped_sleep() has
      been failing often. The obvious reason, given the nature of the test
      and the heavily shared and loaded computing resources they run on, is
      the lack of resources.
      
      One example of such as failure:
      
         ======================================================================
         FAIL: test_kill_stopped_sleep (selftests.functional.test_basic.RunnerSimpleTest)
         ----------------------------------------------------------------------
         Traceback (most recent call last):
           File "/home/travis/build/avocado-framework/avocado/selftests/functional/test_basic.py", line 549, in test_kill_stopped_sleep
             % proc.get_output())
         AssertionError: Avocado process still alive 1s after job-timeout:
         JOB ID     : 5c65a06b4ab15e69d6c4a1fc762368e0e99cbc1f
         JOB LOG    : /tmp/avocado_selftests.functional.test_basicHIyhV4/job-2016-03-09T15.08-5c65a06/job.log
         TESTS      : 1
          (1/1) /bin/sleep 60:
         ctrl+z pressed, stopping test (5046)
         ERROR
      
      So, let's give 4 extra seconds for the process to be
      terminated. Hopefully failures in the timeout handling will still be
      revealed given the relatively small buffer.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      27029ff4
  11. 09 3月, 2016 1 次提交
  12. 04 3月, 2016 2 次提交
    • C
      avocado/core/data_dir.py: make data_dir settings dynamic · be47dcc4
      Cleber Rosa 提交于
      The configurations related to the "data_dir" are currently read at
      module load time. This means that changes in the configuration between
      module load time and changes to the settings (such as parsing an
      additional config file) is never seen.
      
      Since the avocado command line application parses extra configuration
      files (given with `--config`) after the module is loaded, these extra
      configuration files are never applied to the data_dir configuration.
      
      There's one more issue with regards to the the settings usage: because
      once references to the `settings` instance singleton are grabbed, they
      will always point to the same settings objects. The data_dir unittests
      exercise changes to the settings objects by replacing that
      instance. So, let's refer to the settings using the full location
      (module.attribute), which will always give back the "current" (be it
      original or replaced) settings instance.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      be47dcc4
    • C
      selftests/unit/test_datadir.py: combine setUp() and _get_bogus_settings() · 78c2e52d
      Cleber Rosa 提交于
      The current implementation of _get_bogus_settings() solves a partial need
      of the setUp() method. Let's combine both into a single (private) utility
      method (_get_temporary_dirs_mapping_and_config()) that can be re-used.
      
      The major goal is to re-use it when testing how data_dir reacts to changes
      in the settings at run time.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      78c2e52d
  13. 03 3月, 2016 4 次提交
    • L
      selftests: Add avocado -v selftest · 981e7f66
      Lukáš Doktor 提交于
      This check "avocado -v" produces correct output and returns 0.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      981e7f66
    • L
      avocado: Move --silent arg from "run" to core · 3f52fee9
      Lukáš Doktor 提交于
      The `--silent` argument is valid for all commands, let's add it to
      the core avocado args. For backward compatibility keep supporting it in
      "run" subcommand too.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      3f52fee9
    • L
      avocado: Remove the "View" concept · 2105f912
      Lukáš Doktor 提交于
      The "View" concept was developed to abstract the messages and events.
      The problem is it was only abused to pass the status to other places, to
      colorize the messages and to allow creating paginated view.
      
      There already is a nice class hooked to all important events, the
      "TestResult".
      
      For (not only human readable) messages this commit uses the standard
      python logging as it's pretty well known, widely used and very scalable.
      The colored output is handled by already existing
      "ProgressStreamHandler", which maps: DEBUG,INFO,WARNING and >=ERROR
      messages to previously existing: minor, message, warning and error event
      types.
      
      The paginator was unified and is initialized during logging reconfigure.
      During reconfigure all previously logged messages are re-logged into the
      output so one does not lose those messages. Another great difference is
      that the Paginator is cleaned at exit by avocado and does not require
      complex handling to avoid broken console. To use paginator one just
      enables it in "args" and writes to any available stream/stdout/stderr
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      2105f912
    • L
      avocado.core.result: Supply only "job" (and output for json/xunit/...) · 10fb8f69
      Lukáš Doktor 提交于
      Both "stream" and "args" are present in the job. Let's only pass
      the "job" object and let the Result class to take the needed objects.
      
      Additionally allow overriding the output for json/xunit/html in order
      to allow users to specify different value than the one from args.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      10fb8f69
  14. 02 3月, 2016 1 次提交
  15. 25 2月, 2016 1 次提交
  16. 24 2月, 2016 5 次提交
  17. 23 2月, 2016 2 次提交
    • L
      avocado.core.output: Rename add_console_handler to add_log_handler · 7b3c553d
      Lukáš Doktor 提交于
      The function "add_console_handler" is quite useful. This patch extends
      it's capabilities and renames it to fit the new purpose.
      
      Because the new default logging level for "add_log_handler" is INFO,
      we add the "avocado.test" and root logger to level DEBUG.
      
      Then finally a few adjustments to the tests that rely on specific
      log format and level:
      
      1) selftests/functional/test_multiplex.py: adapt to changes in
      test logger That means that extra prefixes ('avocado.test') are
      printed out on each line when avocado is run with '--show-job-log'.
      While at it, be more precise and check for the specific params at the
      specific run with the given variant, instead of looking for a given
      param in the output of the three tests variants.
      
      2) selftests/functional/test_standalone.py: adapt to the change of
      log prefix ('avocado.test') and extra line because of DEBUG level.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      7b3c553d
    • L
      avocado: Rename start_file_logging to start_job_logging · 38ad6b82
      Lukáš Doktor 提交于
      The "start_file_logging" is used when job results are created to add
      job file-handlers to logging.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      38ad6b82
  18. 20 2月, 2016 6 次提交
    • C
      selftests: implement "make selfcheck" target · 01bb3187
      Cleber Rosa 提交于
      This implements a "make selfcheck" that developers can use to run
      the Avocado selftests in itself. It also keeps the old "make check"
      (for a while) so that we can compare to the old approach if any
      regressions occur in the near future.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      01bb3187
    • C
      selftests: remove all plain assertions and use TestCase methods · b3692138
      Cleber Rosa 提交于
      It's more common in our code (and pretty much around all Python
      tests) to use the TestCase utility methods such as `assertEqual`
      instead of doing `assert foo == bar`. Let's remove the few
      occurrences of the `assert` idiom for cohesiveness.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      b3692138
    • C
      selftests/unit/test_utils_linux_modules.py: make test a non static method · 7b141ccb
      Cleber Rosa 提交于
      One of the unittests, namely `test_parse_lsmod_is_empty`, is implemented
      as a static method, which should be fine because it doesn't use any class
      attribute. But, there are a couple of problems.
      
      First, it looks like the Python unittest library, while able to "discover"
      such tests (implemented as static methods):
      
         $ python test_utils_linux_modules.py -v
         test_parse_lsmod (__main__.TestLsmod) ... ok
         test_parse_lsmod_is_empty (__main__.TestLsmod) ... ok
         test_parse_lsmod_no_submodules (__main__.TestLsmod) ... ok
         test_parse_lsmod_single_submodules (__main__.TestLsmod) ... ok
      
         ----------------------------------------------------------------------
         Ran 4 tests in 0.001s
      
         OK
      
      It can not deal with it if its name is given explicitly. Example:
      
         $ python -m unittest test_utils_linux_modules.TestLsmod.test_parse_lsmod_is_empty
         Traceback (most recent call last):
           File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
             "__main__", fname, loader, pkg_name)
           File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
             exec code in run_globals
           File "/usr/lib64/python2.7/unittest/__main__.py", line 12, in <module>
             main(module=None)
           File "/usr/lib64/python2.7/unittest/main.py", line 94, in __init__
             self.parseArgs(argv)
           File "/usr/lib64/python2.7/unittest/main.py", line 149, in parseArgs
             self.createTests()
           File "/usr/lib64/python2.7/unittest/main.py", line 158, in createTests
             self.module)
           File "/usr/lib64/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
             suites = [self.loadTestsFromName(name, module) for name in names]
           File "/usr/lib64/python2.7/unittest/loader.py", line 122, in loadTestsFromName
             (obj, test))
         TypeError: calling <function test_parse_lsmod_is_empty at 0x7fb3f58129b0> returned None, not a test
      
      While a bug should probably be filed on upstream CPython, we can't neither
      should wait on a possible fix.
      
      Second, it's much more common, and arguably more Python, to have non-static
      methods as tests, so that unittest.TestCase methods can be called, such as
      "assertEquals" instead of "assert foo == bar".
      
      So, let's change this method to be a non-static one.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      7b141ccb
    • C
      7abadffa
    • C
    • C
      Safe Loader: add utility module safeloader · a7269e53
      Cleber Rosa 提交于
      The idea is to hold utilities that are used to implement the safe,
      AKA ast-based, test loader.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      a7269e53
  19. 18 2月, 2016 1 次提交
  20. 16 2月, 2016 1 次提交
    • C
      Remote/VM: move functionality from result to runners · 50cc98e9
      Cleber Rosa 提交于
      The functionality to run tests on remote machines and on VMs are
      implemented using a mixture of TestRunner and TestResult classes.
      
      In all fairness, it looks like the TestResult classes were abused
      because non-standard attributes were used as a foundation for that
      functionality. Now that `setup` and `tear_down` have been added
      to the TestRunner interface, let's move those custom features from
      the TestResult classes to the TestRunner ones.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      50cc98e9
  21. 15 2月, 2016 1 次提交
  22. 12 2月, 2016 1 次提交