1. 25 6月, 2019 2 次提交
    • C
      Test: report state on each phase · ac776472
      Cleber Rosa 提交于
      The test can be asked to report its state, or it can do it itself.
      Given that the test knows when it enters each phase, let's ask it to
      report it.
      
      Because the *state* is now reported, it's possible for a test to
      finish (for instance by killing itself) without setting a valid (user
      visible) status, such as "PASS", "FAIL", etc.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      ac776472
    • C
      Test: report test phases · 33b28b0f
      Cleber Rosa 提交于
      The avocado test runner mostly "flies blind" when it comes to the
      individual test phases, that is, it doesn't know if a test is
      currently being initialized, running its setup, running the test
      method itself or its teardown.
      
      With this, the runner gets access to that information, and can act
      differently based on this knowledge.  One use case is to allow for
      different timeouts on different test phases.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      33b28b0f
  2. 21 6月, 2019 1 次提交
  3. 19 6月, 2019 2 次提交
  4. 15 6月, 2019 1 次提交
  5. 30 4月, 2019 1 次提交
    • C
      Selftests: temporary file management improvements · 234da7fd
      Cleber Rosa 提交于
      Rules such as "check" on our Makefile make sure that no temporary
      directory created by Avocado is left behind, but, it's very hard to
      tell who created a rogue directory.
      
      This brings improvements to the naming of the temporary directory, so
      that it's trivial to tell which test created in the first place.
      
      Additionally, it improves the temporary directory creation, usually by
      making use of a tearDown() test phase, instead of other more fragile
      methods.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      234da7fd
  6. 02 4月, 2019 1 次提交
  7. 20 3月, 2019 1 次提交
  8. 08 3月, 2019 1 次提交
    • C
      Drop Python 2 · a90c24c6
      Cleber Rosa 提交于
      And the compatiblity helper six.  With Python 2 gone, a number of
      package changes are also introduced, so that the packages are always
      named python3-<suffix>.
      
      Also, because it would be confusing not having an "avocado" script,
      and to conform with the system wide change introduced by distros that
      now offer Python 3 by default, the scripts are no longer called
      avocado-3 (or avocado-3.x), but simply "avocado".
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      a90c24c6
  9. 16 2月, 2019 1 次提交
    • C
      Record all logged messages during test run into the test log · beb9dac8
      Cleber Rosa 提交于
      Each test has its own log file within a given job result dir,
      located at "test-results/$(test-id)/debug.log".
      
      If the test is an INSTRUMENTED test, using the standard Python logging
      module/API, all produced content should be recorded into the test log
      file.  This adds a handler that does exactly that to the logging
      module root logger.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      beb9dac8
  10. 05 2月, 2019 1 次提交
  11. 29 1月, 2019 1 次提交
  12. 10 12月, 2018 1 次提交
  13. 07 12月, 2018 1 次提交
    • C
      Job: clean up "dry-run" jobs by default · 4e59ec91
      Cleber Rosa 提交于
      In an effort to make jobs more self contained, and given that dry-run
      jobs created temporary content that is not supposed to be kept after
      the job is run, this introduces the following changes:
      
       * Jobs with "dry-run" enabled will now, by default, cleanup their
         own data.  Basically, this means that the "base log directory"
         created during job initialization, and that for non "dry-run"
         jobs is usually "~/avocado/job-results", will also be removed
         at the job's "cleanup()" phase.
      
       * A new "--dry-run-no-cleanup" command line option, that only makes
         sense when jobs with dry-run enabled start to clean up data for
         themselves
      
       * Because some result plugins will, by default, write to the job
         results directory, results plugins are now run before a job cleanup
         is done.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      4e59ec91
  14. 06 12月, 2018 1 次提交
  15. 14 11月, 2018 1 次提交
  16. 02 10月, 2018 1 次提交
    • C
      Add core test parameter passing support (non-varianter based) · 252f8be2
      Cleber Rosa 提交于
      Currently, the only way to pass parameters to Avocado is by using the
      variants layer, that is, one of the existing varianter plugin
      implementations.  This was based on earlier design decisions, that
      we're trying to fix without breaking expectation and compatibility.
      
      While it'd makes sense to support parameters created by the varianter
      layer itself, together with non-varianter parameters, it seems that we
      can start by adding support for one or the other being used at a time.
      
      This commit does exactly that: add support for a method of passing
      parameters via the command line for all tests in a job, without
      having to resort to the varianter.  When the varianter is used,
      it takes precedence and the core test parameter passing support
      is ignored.
      
      This should solve a number of use cases that require one-time
      executions of tests with different parameters, especially
      executions during test development and debugging.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      252f8be2
  17. 15 9月, 2018 1 次提交
    • C
      External Runner: support relative paths given on the command line · 89704618
      Cleber Rosa 提交于
      I was trying to use the external runner, in a reasonably simple way:
      from within a project (QEMU) build dir, I'd run:
      
       $ avocado run --external-runner=tests/qemu-iotests/check \
         --external-runner-chdir=runner -- 001 002
      
      But, what should work, did not.  The problem is with the non-absolute
      path to the external runner, that is needed because we're changing
      directories.
      
      Absolute paths won't hurt otherwise (when no chdir is done), so it's
      always done here.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      89704618
  18. 01 9月, 2018 1 次提交
  19. 03 8月, 2018 1 次提交
  20. 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
  21. 19 7月, 2018 1 次提交
  22. 03 5月, 2018 1 次提交
  23. 01 5月, 2018 1 次提交
  24. 25 4月, 2018 1 次提交
  25. 23 4月, 2018 2 次提交
  26. 21 4月, 2018 3 次提交
    • C
      FDDrainer: pass text to loggers · e1b21e2d
      Cleber Rosa 提交于
      The FDDrainer reads from process output and write to loggers.  The
      test log, which is intended for humans, can indeed try to treat it as
      text.  The stream logger, on the other hand, should deal with data as
      binary content *only*, but this will be handled on a future change.
      
      By having text content passed to the loggers, we avoid the occurrence
      of log lines that look like:
      
        [stdout] b'command output'
      
      Or output files (job-YYYY-MM-DDTHH.MM-id/tests/<test>/output) that
      may literally contain:
      
        b'command output'
      
      The encoding used is the one specified at the command execution.  With
      this fix, a number of tests on Python 3 can now run successfully.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      e1b21e2d
    • C
      selftests/functional/test_basic.py: make echo output safe · 6a104b45
      Cleber Rosa 提交于
      In the module global scope, "man echo" is executed to attempt to
      determine if it's a GNU echo.  But, "man echo" in a locale such
      as UTF-8 produces funky copyright characters:
      
        $ LANG=en_US.UTF-8 man echo | chardetect -
        <stdin>: windows-1252 with confidence 0.73
      
      Which can not be decoded by the UTF-8 codec, producing
      UnicodeDecodeErrors.  Even if that wasn't the case, it's better to
      control the locale of command that can generate varied output, and
      that we depend on.
      
        $ LANG=C man echo | chardetect -
        <stdin>: ascii with confidence 1.0
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      6a104b45
    • C
      avocado.utils.process: require commands to be given as unicode strings · 1401f3cf
      Cleber Rosa 提交于
      This change introduces the following requirement: the command to
      be run by the avocado.utils.process functions should be given as unicode.
      It brings a clearer interface, in which there's no need to deal with
      encodings internally.
      
      For simple test, it brings changes to respect the of passing unicode.
      And, it changes the presentation of simple tests with unicode names
      explicitly expreseed as such.
      
      The way to deal with the process data that may be generated on
      stdout/stderr is unchanged.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      1401f3cf
  27. 19 4月, 2018 1 次提交
  28. 18 4月, 2018 1 次提交
    • C
      Travis-CI: skip tests that are time/resource sensitive · 822095d5
      Cleber Rosa 提交于
      And that have been causing failures on Travis jobs, due to limited
      on unreliable amount of resources present.
      
      This is the full list of tests that won't be run anymore on Travis,
      only on `make check-full`:
      
        selftests.functional.test_basic.RunnerOperationTest.test_early_latest_result
        selftests.functional.test_basic.RunnerSimpleTest.test_kill_stopped_sleep
        selftests.functional.test_interrupt.InterruptTest.test_well_behaved_sigint
        selftests.functional.test_interrupt.InterruptTest.test_well_behaved_sigterm
        selftests.functional.test_loader.LoaderTestFunctional.test_simple_using_main
        selftests.functional.test_loader.LoaderTestFunctional.test_sleep_a_lot
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      822095d5
  29. 11 4月, 2018 1 次提交
  30. 28 3月, 2018 3 次提交
  31. 22 3月, 2018 1 次提交
  32. 20 3月, 2018 1 次提交
    • C
      Travis-CI: whitelist style check errors · aadb1c9a
      Cleber Rosa 提交于
      The latest jobs have been failing because of the following issues:
      
          ************* Module raise
          E1130: 48,30: Raise.test: bad operand type for unary -: NoneType
          ************* Module selftests.functional.test_basic
          I1101:1191,24: PluginsXunitTest.run_and_check: Module 'lxml.etree'
          has not 'XMLSchema' member, but source is unavailable. Consider
          adding this module to extension-pkg-whitelist if you want to
          perform analysis based on run-time introspection of living
          objects.
          I1101:1191,40: PluginsXunitTest.run_and_check: Module 'lxml.etree'
          has not 'parse' member, but source is unavailable. Consider adding
          this module to extension-pkg-whitelist if you want to perform
          analysis based on run-time introspection of living objects.
          I1101:1193,43: PluginsXunitTest.run_and_check: Module 'lxml.etree'
          has not 'parse' member, but source is unavailable. Consider adding
          this module to extension-pkg-whitelist if you want to perform
          analysis based on run-time introspection of living objects.
          ************* Module selftests.unit.test_xunit
          I1101: 91,24: xUnitSucceedTest.test_add_success: Module
          'lxml.etree' has not 'XMLSchema' member, but source is
          unavailable. Consider adding this module to
          extension-pkg-whitelist if you want to perform analysis based on
          run-time introspection of living objects.
          I1101: 91,40: xUnitSucceedTest.test_add_success: Module
          'lxml.etree' has not 'parse' member, but source is
          unavailable. Consider adding this module to
          extension-pkg-whitelist if you want to perform analysis based on
          run-time introspection of living objects.
          I1101: 92,43: xUnitSucceedTest.test_add_success: Module
          'lxml.etree' has not 'parse' member, but source is
          unavailable. Consider adding this module to
          extension-pkg-whitelist if you want to perform analysis based on
          run-time introspection of living objects.
      
      We can't whitelist the `lxml.etree` module at this time (inspekt doesn't
      have such an option) and the raise failure is a false positive.  Let's
      ignore those issues then.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      aadb1c9a
  33. 15 3月, 2018 1 次提交
    • C
      Python 3: load JSON as supported on 3.4 (and earlier) · d2b4edc3
      Cleber Rosa 提交于
      Under Python 3.4, which runs on our CI and is our lowest supported
      version, json.loads() requires a string, while newer versions also
      allows bytes.
      
          >>> json.loads(b'{}')
          Traceback (most recent call last):
            File "<stdin>", line 1, in <module>
            File "/home/cleber/.local/lib/python3.4/json/__init__.py", line 312, in loads s.__class__.__name__))
          TypeError: the JSON object must be str, not 'bytes'
      
      Let's make that code compatible with Python 3.4.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      d2b4edc3