1. 15 2月, 2018 1 次提交
  2. 13 2月, 2018 3 次提交
  3. 12 2月, 2018 2 次提交
  4. 10 2月, 2018 1 次提交
    • A
      SIMPLE tests: improve status API · c42bfbc9
      Amador Pahim 提交于
      Currently simple tests have a limited status API, being able to set only
      the WARN status by generating an output string in a very specific and
      hard-coded format.
      
      This patch, while respects the current behaviour, creates configuration
      keys, allowing users to provide regular expressions to search for in the
      test outputs, aiming to set the final test status to either WARN or SKIP
      when the test finishes with exit code 0.
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      c42bfbc9
  5. 08 2月, 2018 1 次提交
    • C
      Test statuses: do not rely on varianter_yaml_to_mux plugin · 6e14beb9
      Cleber Rosa 提交于
      Which is an optional plugin, and the test statuses feature is at the
      innermost core of Avocado.  While the original test indeed saved a lot
      of duplicated code, it's code that serves a specific testing purpose,
      and it's better to be simpler and more verbose and with the right (no)
      dependencies.
      
      This issue came up during the Python 3 port work.  Now that all the
      unittests (selftests/unit/*) were passing (locally, there's one other
      PR pending to be accepted), the next logical step is getting the
      "core" functional (selftests/functional/*) tests passing.  Because
      the 'varianter_yaml_to_mux' optional plugins port is not done, the
      "core" functional tests fail and the current work flow is broken.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      6e14beb9
  6. 21 12月, 2017 1 次提交
  7. 16 12月, 2017 1 次提交
  8. 14 12月, 2017 1 次提交
  9. 12 12月, 2017 1 次提交
    • C
      avocado.core.sysinfo: use avocado.utils.process · 224f7187
      Cleber Rosa 提交于
      The sysinfo code replicates some of the process handling code
      already in avocado.utils.process.  Let's use our library instead
      and remove code duplication.
      
      This also marks the sysinfo interruption tests as "time and resource
      sensitive", and will not run on environments such as Travis-CI, in
      a similar way that other interruption based tests are currently set.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      224f7187
  10. 06 12月, 2017 1 次提交
  11. 30 11月, 2017 4 次提交
    • C
      Output check: add a test for API call check mode enforcement · 11f3b0df
      Cleber Rosa 提交于
      The avocado.utils.process APIs offer the `allow_output_check`
      parameter which exists at a function call level, and thus should be
      applied only during the scope of that function.
      
      While it's questionable if a test process should be able to skip
      some of its generated output (by means of an `avocado.utils.process`
      function parameter), the fact is that the utility libraries offer
      that at a lower level.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      11f3b0df
    • C
      Output check: allow for an explicit `none` mode · 9997aaa1
      Cleber Rosa 提交于
      In commit 4514a8ad, the default value from the command line option
      `--output-check-record` was being used to set the mode of the
      `avocado.utils.process` APIs with regards to output record mode.
      
      The problem with that is it makes it impossible for the API to
      distinguish between "no explicit behavior requested" and "explicitly
      being asked to disable recording".
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      9997aaa1
    • C
      Output check: also support checking against 'output.expected' · f0f9a3fe
      Cleber Rosa 提交于
      Avocado recently introduced the support to record the combined
      output generated by a test.  Now, this introduces support for
      checking against a previously record combined output.
      
      If an 'output.expected' file exists, it'll take precedence
      over the `stdout.expected` and `stderr.expected` files.
      
      Also it's necessary to switch the default operation mode for
      the `avocado.utils.process` functions, since to compare with
      an `output.expected` file, the record mode for the currently
      running test has to be the same.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      f0f9a3fe
    • C
      Output check: remove test that is already run in compound scenarios · 0f95b571
      Cleber Rosa 提交于
      The same code is run on multiple other tests.  It's a waste to run
      it yet another time by itself.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      0f95b571
  12. 29 11月, 2017 2 次提交
  13. 20 11月, 2017 1 次提交
  14. 18 11月, 2017 1 次提交
    • C
      Output check record: introduce control for process execution · 4514a8ad
      Cleber Rosa 提交于
      And the support for combined mode.  So far, there was no need to
      determine how processes would be run, and how their output would be
      collected: the stdout and stderr would always be collcted separately.
      
      Now, with the need to support the "combined" mode, the
      `--output-check-record` command line switch not only has to control
      which files are populated (stdout.expected, stderr.expected) but also
      it needs to control the execution of process, because it's what will
      generate the "raw material" for a possible "output.expected" file.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      4514a8ad
  15. 15 11月, 2017 1 次提交
  16. 16 10月, 2017 1 次提交
    • A
      test: check-output to record diffs · 58fd0c53
      Amador Pahim 提交于
      The output check functionality logs, on failures, the complete contents
      of the both the actual output, and the expected one. Most often than not,
      the most relevant information is the difference between both.
      
      This patch logs the unified diffs and records the diff files
      (`stdout.diff` and `stderr.diff`) containing the unified diff between
      the expected outputs and the actual outputs.
      
      Reference: https://trello.com/c/CXDP1khVSigned-off-by: NAmador Pahim <apahim@redhat.com>
      58fd0c53
  17. 14 10月, 2017 1 次提交
    • C
      avocado.Test: introduce get_data() method · 0941cdd7
      Cleber Rosa 提交于
      This method allows to look for test data in ways that are more
      flexible than the current "datadir" feature currently available.
      
      The current "datadir" is bound to the test filename only, and
      can not provide different data for different tests hosted within
      a single test file.
      
      The newly introduced get_data() method looks for test data in
      various locations, to be able to provide custom data not only
      to different tests hosted inside a single test file, but also
      to different variants.
      
      Note about this alternative implementation of `get_data()`: it does so
      in a much more detached form.  It allows for other test types to
      clearly change the way data files are stored and accessed.  It also
      introduces the concept of named data sources.
      
      In the previous implementation, the types of "data dirs" were hard
      coded, while in this approach, they're defined at the class level and
      it's up to the `get_data()` implementation to deal with it.
      Consequently, the `get_data()` method gets a second (optional)
      parameter that allows the user to specify from which data source the
      data file should be retrieved.
      
      This is necessary, for example, when we add configurability to sources
      of data files, such as expected `stdout`, `stderr` and `output` files.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      0941cdd7
  18. 13 10月, 2017 2 次提交
    • C
      Python 3 port: adapt to range differences · 3b80b9eb
      Cleber Rosa 提交于
      Basically switch to use the alias provided by six, with the Python
      3 name.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      3b80b9eb
    • C
      avocado/core/loader.py: simplify and improve detection of Python files · 317a1d17
      Cleber Rosa 提交于
      The use of PathInspector checks too much and too little at the same time.
      For once, it attempts to find Python code inside a file that doesn't have
      a '.py' suffix.
      
      This means that a file named "test" instead of "test.py" can be recognized
      as an INSTRUMENTED test.  A file no ending in ".py" can not be currently
      loaded as a Python module by Avocado, and it results in a test execution
      ERROR.
      
      This changes the behavior for files with Python code, but not ending
      in '.py' that can not be loaded as INSTRUMENTED tests, and will now
      result in NOT_A_TEST instead.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      317a1d17
  19. 12 10月, 2017 1 次提交
    • L
      output: Adjust LoggingFile to work with raw output · e4b5ee05
      Lukáš Doktor 提交于
      The 4235b329 changed the
      stdout/stderr/output logging handlers to not to add tailing '\n's, but
      these are processed by LoggingFile, which is designed to remove the
      '\n's and to logged them per line. As a result the unittest was
      incorrectly changed as the first outputs actually add the '\n' which was
      removed in the expected output.
      
      This patch keeps the raw approach as it is necessary for the last
      buffered line and instead of buffering puts all lines including the
      tailing '\n' and not '\n' for the remaining last line (if it's
      available). Consequently this should improve the situation where output
      is being produced by stderr and stdout concurrently as no buffering of
      the non-tailing-newline output is done on LoggingFile level.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      e4b5ee05
  20. 11 10月, 2017 1 次提交
  21. 04 10月, 2017 1 次提交
    • A
      log the raw output on stdout/stderr · 4235b329
      Amador Pahim 提交于
      Avocado process module has a routine to drain the std* buffer with a
      per-line basis loop. This loop makes the new-line character to be
      dropped.
      
      On the other hand, the Python logging system is hard-coded to add a new-line
      character at the end of the msg string.
      
      The problem takes place when `process` writes a line which originally
      had new-line character at the end but the logging system still adds the
      new-line character to that line.
      
      In this patch:
      - avocado.utils.process to include the new-line character in the lines
        that originally had one.
      - avocado.core.test to use for raw outputs a custom logging FileHandler
        that does not add a new-line character at the end of each line.
      
      Verified with (checking `.../test-results/1-.../[stdout|stderr|output]`):
      
          $ avocado run --external-runner '/bin/echo' 'foo'
      
          $ avocado run --external-runner '/bin/echo -n' 'foo'
      
          $ avocado run --external-runner '/bin/ls' '.'
      
          $ avocado run --external-runner '/bin/ls' 'nonexistingfile
      
      Reference: https://trello.com/c/dH7FLT75Signed-off-by: NAmador Pahim <apahim@redhat.com>
      4235b329
  22. 03 10月, 2017 3 次提交
  23. 20 9月, 2017 1 次提交
  24. 15 9月, 2017 4 次提交
  25. 29 8月, 2017 2 次提交
  26. 24 8月, 2017 1 次提交
    • C
      Removal of "import magic" for avocado and avocado-rest-client · d39f9a0a
      Cleber Rosa 提交于
      These scripts rely on some Python library path manipulation to be
      able to load from the source tree.  But, in fact that are a few
      reasons for not having those, including:
      
       * All functionality in `avocado` relies on plugins, which will not be
         available from the source tree unless a `$ setup.py develop` is
         executed, which automatically makes the "import magic" unnecessary.
      
       * Most users will end up using a setuptools generated "entry point"
         instead.
      
      For the sake of less code, I propose this (and all other?) magic to be
      removed.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      d39f9a0a