1. 18 9月, 2015 1 次提交
  2. 15 9月, 2015 1 次提交
    • L
      avocado.core.test: Avoid passing ugly exceptions · 73c8cefb
      Lukáš Doktor 提交于
      Currently when one passes exception, which is not instance of Exception,
      avocado proceeds and returns "INTERRUPTED" test instead of "ERROR". This
      for example happens when old-style-class is used as exception. This
      patch uses pure "except" without any argument to catch such exceptions
      and then it wraps them in "exceptions.TestError" instead.
      
      The same applies to "setUp" and "tearDown", they only use different
      class as a wrapper.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      73c8cefb
  3. 14 8月, 2015 1 次提交
  4. 10 8月, 2015 4 次提交
  5. 04 8月, 2015 1 次提交
  6. 08 7月, 2015 1 次提交
  7. 07 7月, 2015 3 次提交
    • L
      avocado: Add fail_on_error decorator · 06d1d8c3
      Lucas Meneghel Rodrigues 提交于
      Give to test writers the fail_on_error decorator, which
      should turn any generic exception into an avocado
      TestFail.
      
      This is important for some tests that can raise
      any exception during a complex operation, and any of those
      exceptions can be considered a test failure.
      Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
      06d1d8c3
    • L
      avocado.core.test: Test() -> Enforce that skip() can only be called from setUp() · f7017640
      Lucas Meneghel Rodrigues 提交于
      Make sure avocado complains loudly when people try to call
      skip() from outside setUp() - this shouldn't be allowed in
      avocado tests. Let the user know of the problem and ask them
      to fix their tests. Also, update the docstring for skip(),
      which will reduce the chances of test writers using it in
      inappropriate places.
      Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
      f7017640
    • L
      avocado: Remove configurable behavior of uncaught exceptions · e363ed40
      Lucas Meneghel Rodrigues 提交于
      In order to keep things simple and clear, enforce the
      following test results rules:
      
       * `PASS`: the test passed, which means all conditions
         being tested have passed.
       * `FAIL`: the test failed, which means at least one
         condition being tested has failed. Ideally, it should
         mean a problem in the software being tested has been found.
       * `ERROR`: an error happened during the test execution.
         This can happen, for example, if there's a bug in the test
         runner, in its libraries or if a resource breaks unexpectedly.
         Uncaught exceptions in the test code will also result in this
         status.
       * `SKIP`: the test runner decided a requested test should not
         be executed. This can happen, for example, due to missing
         requirements in the test environment or when there's a job
         timeout.
      
      In order to do that, let's not make the behavior on exceptions
      other than TestFail to be configurable. Therefore, the config
      value uncaught_exception_result must be removed and the status
      of the test always be 'ERROR'.
      Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
      e363ed40
  8. 19 6月, 2015 1 次提交
  9. 18 6月, 2015 3 次提交
  10. 12 6月, 2015 3 次提交
  11. 09 6月, 2015 3 次提交
  12. 05 6月, 2015 1 次提交
    • C
      trinity example test: fix fetch of tarball parameter and update to 1.5 · ff4e6741
      Cleber Rosa 提交于
      Because of the parameter behaviour change this test was failing to get
      the name of the tarball to use during the test.
      
      Once that was fixed, there was a couple of build errors. Instead of
      debugging the build of the 1.4 version, I tried version 1.5, which
      built without any problems. Let's use this oppotunity to fix the
      test (wrapper) and update the (original test) tarball.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      ff4e6741
  13. 16 5月, 2015 3 次提交
    • L
      avocado.multiplexer: Switch to the new API · d727bfe0
      Lukáš Doktor 提交于
      This patch adds documentation of the "new params API" and removes the
      compatility layer. From now on only the API with paths is valid:
      
          self.params.get(key, path='*', default=None)
      
      where the default path '*' matches anything from --mux-entry path.
      Default path is `/test`.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      d727bfe0
    • L
      examples.tests: Adjust tests to use new params API · 8e2ddf58
      Lukáš Doktor 提交于
      This patch modifies all example tests to use the new API. It uses the
      default path, which is `*`, which matches the mux-entry paths ONLY.
      In order to get the values it's necessarily to inject the YAML files
      into the mux-entry path, by default `/test`, eg:
      
          avocado run sleeptest -m /test:examples/tests/sleeptest.py.data/
          sleeptest.yaml
      
      It might seen as a bit more complicated to execute, but it's definitely
      easier for maintaining and combining existing YAML files. To execute
      matrix of tests you simply inject them into 2 different `/test` children,
      eg: `-m /test/by_length:lengths.yaml /test/by_method:methods.yaml`.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      8e2ddf58
    • L
      avocado.multiplexer: Use !mux and support for recursive mux · f5ce7a45
      Lukáš Doktor 提交于
      This patch modifies the multiplexer logic to support full recursive
      multiplexation, unlike the old version which only flattened the
      multiplexed nodes. This allows greater flexibility.
      
      Additionally it removes the !join flag and inverts the logic to use !mux
      instead. By default leaves are not multiplexed and all are part of the
      current params. Users can specify exact nodes which get multiplexed by
      using !mux keyword.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      f5ce7a45
  14. 05 5月, 2015 1 次提交
  15. 24 4月, 2015 2 次提交
  16. 15 4月, 2015 1 次提交
    • L
      avocado.loader: Fortify test discovery against stdin/out/err corruption · 0783738a
      Lukáš Doktor 提交于
      There are python traps (they can't be called scripts) which on import
      modify stdin/out/err. This even on discovery makes avocado behave very
      badly and it's hard to discover what and when it happened. This patch
      provides dummy stdin/out/err when discovering the tests.
      
      This solution only takes care of stdin/out/err related issues, safer
      method would be to spawn another process and gather the info there.
      Still we can't avoid modifying the OS during the discovery, but that's
      IMO acceptable for a test-framework.
      
      The examples/tests/failtest_ugly.py is used in basic_tests unittest
      using "avocado list" (without this patch it waits for input, than it
      prints the test's outputs and exits without listing the tests).
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      0783738a
  17. 14 4月, 2015 1 次提交
  18. 09 4月, 2015 2 次提交
    • L
      examples.tests: Correct multiplextest yaml file · 135ecc7d
      Lukáš Doktor 提交于
      Multiplextest contains in /guest/os contains Linux and Windows branches.
      These branches are mutually exclusive thus they need to be !join-ed.
      
      Additionally I reworked the /host/kernel_config and split the "numa" vs.
      "page_size" variants and added "default". This IMO reflects the
      real-world usage better.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      135ecc7d
    • L
      avocado.test: Add support for params with paths · 1c9eb21b
      Lukáš Doktor 提交于
      This is a testing version of params with paths support. By default
      it acts as the old Params, but you can use params.get(key, path=....)
      to utilize new-params handling.
      
      For now the PATH for relative paths is hardcoded to "/test/*" but it
      will be specifiable on the command line. I just need to pass it to the
      test which I'd like to do over "metadata" (see below) rather then adding
      it temporarily to the params and risk colisions.
      
      The code is not optimized and in order to be compatible it uses old
      concepts. Some of them I'd like to get rid of in near future:
      
      * default_params => currently used only to set default "metadata" like
        test timeout. I'd like to replace it for RW Test.metadata, which would
        be overwritten durint __init__ if params contain the keys in specific
        paths. IMO they shouldn't be shared with test params.
      * test_factory's params are currently dict with some metadata like
        wether this test is executed from directory or by uri. Again, they are
        metadata and should be handled separately. Some of them might be reused
        to params if needed, but not generaly.
      * create separated multiplexer plugin generate multiple variants
      * reconsider the need for "objects", "object_params" and "object_counts"
      * couple of others I forget to mention...
      
      There is one real change I made, I got rid of ${key}_${type} to specify
      type of the argument. Yaml supports any type we might like and by
      our convention all tests should be written to work without any params.
      Thus this is IMO more confusing, than beneficial. But if you insist
      I can copy&paste the support for it.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      1c9eb21b
  19. 08 4月, 2015 1 次提交
  20. 07 4月, 2015 1 次提交
  21. 31 3月, 2015 1 次提交
  22. 25 3月, 2015 1 次提交
    • L
      scripts.avocado-bash-utils: Add Avocado bash utils · fa0e77a7
      Lukáš Doktor 提交于
      This patch is initial support for people using custom bash scripts
      with avocado. Tests should use:
      
          PATH=$(avocado "exec-path"):$PATH
      
      and then they can utilize the helpers.
      
      This version contain functions to write to Test.log the same way it's
      possible from python including failing the test with TestWarn in case
      avocado_warn was used.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      fa0e77a7
  23. 04 3月, 2015 1 次提交
    • L
      avocado.test: Fortify avocado before very nasty exceptions · fda1dde4
      Lukáš Doktor 提交于
      The NastyException error is back:
      
      class NastyException(Exception):
          def __init__(self, msg):
              self.msg = msg
          def __str__(self):
              return self.msg
      
      crashes Avocado. The problem is we are trying to re-raise the exceptions
      and then read the traceback again. Even reading of the details of this
      very nasty written exception causes critical failure.
      
      What this patch does instead of handling issues wherever we produce
      them, it waits till the exception bubbles to the entry-point and it
      tries to read it. If it fails, we log the original traceback
      (information about the failure) and then user-friendly message saying
      we're unable to retrieve the original failure.
      
      Additionally I had to modify the xunit output as in case of very nasty
      inputs it's unable to reproduce the values.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      fda1dde4
  24. 27 2月, 2015 1 次提交
  25. 26 2月, 2015 1 次提交