1. 19 12月, 2017 1 次提交
  2. 12 10月, 2017 2 次提交
  3. 06 9月, 2017 1 次提交
  4. 05 9月, 2017 1 次提交
    • S
      iotests.py: add FilePath context manager · f4844ac0
      Stefan Hajnoczi 提交于
      The scratch/ (TEST_DIR) directory is not automatically cleaned up after
      test execution.  It is the responsibility of tests to remove any files
      they create.
      
      A nice way of doing this is to declare files at the beginning of the
      test and automatically remove them with a context manager:
      
        with iotests.FilePath('test.img') as img_path:
            qemu_img(...)
            qemu_io(...)
        # img_path is guaranteed to be deleted here
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20170824072202.26818-3-stefanha@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      f4844ac0
  5. 23 8月, 2017 1 次提交
  6. 24 7月, 2017 1 次提交
    • K
      qemu-iotests: Avoid unnecessary sleeps · 2c93c5cb
      Kevin Wolf 提交于
      Test cases 030, 041 and 055 used to sleep for a second after calling
      block-job-pause to make sure that the block job had time to actually
      get into paused state. We can instead poll its status and use that one
      second only as a timeout.
      
      The tests also slept a second for checking that the block jobs don't
      make progress while being paused. Half a second is more than enough for
      this.
      
      These changes reduce the total time for the three tests by 25 seconds on
      my laptop (from 155 seconds to 130).
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      2c93c5cb
  7. 07 4月, 2017 1 次提交
  8. 31 10月, 2016 1 次提交
  9. 28 10月, 2016 3 次提交
  10. 23 9月, 2016 1 次提交
  11. 06 9月, 2016 2 次提交
  12. 27 7月, 2016 1 次提交
    • D
      iotest: fix python based IO tests · 4c44b4a4
      Daniel P. Berrange 提交于
      The previous commit refactoring iotests.py:
      
        commit 66613974
        Author: Daniel P. Berrange <berrange@redhat.com>
        Date:   Wed Jul 20 14:23:10 2016 +0100
      
          scripts: refactor the VM class in iotests for reuse
      
      was not properly tested and included a number of broken
      bits.
      
       - The 'event_match' method was not moved into qemu.py
       - The 'self._args' list parameter in QEMUMachine needs
         to be copied otherwise modifications will affect the
         global 'qemu_opts' variable in iotests.py
       - The QEMUQtestMachine class methods had inverted
         parameter order for the super() calls
       - The QEMUQtestMachine class forgot to add
         '-machine accel=qtest'
       - The QEMUQtestMachine class constructor needs to set
         a default 'name' value before using it as it may
         be None
       - The QEMUQtestMachine class constructor needs to use
         named parameters when calling the super constructor
         as it is leaving out some positional parameters.
       - The 'qemu_prog' variable should be a string not a
         list in iotests.py
       - The VM classs constructor needs to use named
         parameters when calling the super constructor
         as it is leaving out some positional parameters.
       - The path to the socket-scm-helper needs to be
         passed into the QEMUMachine class
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1469549767-27249-1-git-send-email-berrange@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      4c44b4a4
  13. 22 7月, 2016 1 次提交
  14. 12 5月, 2016 1 次提交
    • S
      qemu-iotests: iotests: fail hard if not run via "check" · 5a8fabf3
      Sascha Silbe 提交于
      Running an iotests-based Python test directly might appear to work,
      but may fail in subtle ways and is insecure:
      
      - It creates files with predictable file names in a world-writable
        location (/var/tmp).
      
      - Tests expect the environment to be set up by check. E.g. 041 and 055
        may take the wrong code paths if QEMU_DEFAULT_MACHINE is not
        set. This can lead to false negatives.
      
      Instead fail hard and tell the user we want to be run via "check".
      
      The actual environment expected by the tests is currently only defined
      by the implementation of "check". We use two of the environment
      variables set by "check" as indication of whether we're being run via
      "check". Anyone writing their own test runner (replacing "check") will
      need to replicate the full environment (in a broader sense, not just
      environment variables) provided by "check" anyway, including setting
      the two environment variables we check. Whereas a regular developer
      just trying to invoke the tests usually won't have both of these
      defined in their environment so we can catch their mistake and give
      out useful advice.
      Signed-off-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Reviewed-by: NBo Tu <tubo@linux.vnet.ibm.com>
      Message-id: 1461094442-16014-1-git-send-email-silbe@linux.vnet.ibm.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      5a8fabf3
  15. 20 4月, 2016 1 次提交
  16. 15 4月, 2016 1 次提交
  17. 13 4月, 2016 3 次提交
    • S
      qemu-iotests: iotests.py: get rid of __all__ · 3ef3dcef
      Sascha Silbe 提交于
      The __all__ list contained a typo for as long as the iotests module
      existed. That typo prevented "from iotests import *" (which is the
      only case where iotests.__all__ is used at all) from ever working.
      
      The names used by iotests are highly prone to name collisions, so
      importing them all unconditionally is a bad idea anyway. Since __all__
      is not adding any value, let's just get rid of it.
      
      Fixes: f345cfd0 ("qemu-iotests: add iotests Python module")
      Signed-off-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Reviewed-by: NBo Tu <tubo@linux.vnet.ibm.com>
      Message-id: 1459848109-29756-8-git-send-email-silbe@linux.vnet.ibm.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      3ef3dcef
    • S
      qemu-iotests: 148: properly skip test if quorum support is missing · 3f647b51
      Sascha Silbe 提交于
      qemu-iotests test case 148 already had some code for skipping the test
      if quorum support is missing, but it didn't work in all
      cases. TestQuorumEvents.setUp() gets run before the actual test class
      (which contains the skipping code) and tries to start qemu with a drive
      using the quorum driver. For some reason this works fine when using
      qcow2, but fails for raw.
      
      As the entire test case requires quorum, just check for availability
      before even starting the test suite. Introduce a verify_quorum()
      function in iotests.py for this purpose so future test cases can make
      use of it.
      Signed-off-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Reviewed-by: NBo Tu <tubo@linux.vnet.ibm.com>
      Message-id: 1459848109-29756-5-git-send-email-silbe@linux.vnet.ibm.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      3f647b51
    • S
      qemu-iotests: iotests.VM: remove qtest socket on error · c1c71e49
      Sascha Silbe 提交于
      On error, VM.launch() cleaned up the monitor unix socket, but left the
      qtest unix socket behind. This caused the remaining sub-tests to fail
      with EADDRINUSE:
      
      +======================================================================
      +ERROR: testQuorum (__main__.TestFifoQuorumEvents)
      +----------------------------------------------------------------------
      +Traceback (most recent call last):
      +  File "148", line 63, in setUp
      +    self.vm.launch()
      +  File "/home6/silbe/qemu/tests/qemu-iotests/iotests.py", line 247, in launch
      +    self._qmp.accept()
      +  File "/home6/silbe/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 141, in accept
      +    return self.__negotiate_capabilities()
      +  File "/home6/silbe/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 57, in __negotiate_capabilities
      +    raise QMPConnectError
      +QMPConnectError
      +
      +======================================================================
      +ERROR: testQuorum (__main__.TestQuorumEvents)
      +----------------------------------------------------------------------
      +Traceback (most recent call last):
      +  File "148", line 63, in setUp
      +    self.vm.launch()
      +  File "/home6/silbe/qemu/tests/qemu-iotests/iotests.py", line 244, in launch
      +    self._qtest = qtest.QEMUQtestProtocol(self._qtest_path, server=True)
      +  File "/home6/silbe/qemu/tests/qemu-iotests/../../scripts/qtest.py", line 33, in __init__
      +    self._sock.bind(self._address)
      +  File "/usr/lib64/python2.7/socket.py", line 224, in meth
      +    return getattr(self._sock,name)(*args)
      +error: [Errno 98] Address already in use
      
      Fix this by cleaning up both the monitor socket and the qtest socket iff
      they exist.
      Signed-off-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Reviewed-by: NBo Tu <tubo@linux.vnet.ibm.com>
      Message-id: 1459848109-29756-4-git-send-email-silbe@linux.vnet.ibm.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      c1c71e49
  18. 30 3月, 2016 3 次提交
  19. 18 12月, 2015 2 次提交
    • K
      qemu-iotests: Remove cache mode test without medium · fc17c259
      Kevin Wolf 提交于
      Specifying the cache mode for a driver without a medium is not a useful
      thing to do: As long as there is no medium, the cache mode doesn't make
      a difference, and once the 'change' command is used to insert a medium,
      it ignores the old cache mode and makes the new medium use
      cache=writethrough.
      
      Later patches will make it an error to specify the cache mode for an
      empty drive. Remove the corresponding test case.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      fc17c259
    • K
      blockdev: Set 'format' indicates non-empty drive · 39c4ae94
      Kevin Wolf 提交于
      Creating an empty drive while specifying 'format' doesn't make sense.
      The specified format driver would simply be ignored.
      
      Make a set 'format' option an indication that a non-empty drive should
      be created. This makes 'format' consistent with 'driver' and allows
      using it with a block driver that doesn't need any other options (like
      null-co/null-aio).
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      39c4ae94
  20. 03 12月, 2015 1 次提交
  21. 05 9月, 2015 4 次提交
  22. 02 7月, 2015 2 次提交
  23. 22 5月, 2015 1 次提交
    • F
      qemu-iotests: Make debugging python tests easier · aa4f592a
      Fam Zheng 提交于
      Adding "-d" option. The output goes to "tee" so it appears in your
      console. Also, raise the verbosity of unnitest runner.
      
      When testing a topic branch, it's possible that a bug introduced by a
      code change makes the python test case hang, with debug output, it is
      much easier to locate the problem.
      
      This can also be helpful if you want to watch the progress of a python
      test, it offers you a way to sense the speed of each test case method
      you're writing.
      
      Note: because there is no easy way to get *both* the verbose output and
      the output expected by ./check comparison, the case would always fail
      with an "output mismatch". The sole purpose of using this option is
      giving developers a quick way to debug when things go wrong.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      aa4f592a
  24. 28 4月, 2015 1 次提交
    • J
      iotests: add QMP event waiting queue · 7898f74e
      John Snow 提交于
      A filter is added to allow callers to request very specific
      events to be pulled from the event queue, while leaving undesired
      events still in the stream.
      
      This allows us to poll for completion data for multiple asynchronous
      events in any arbitrary order.
      
      A new timeout context is added to the qmp pull_event method's
      wait parameter to allow tests to fail if they do not complete
      within some expected period of time.
      
      Also fixed is a bug in qmp.pull_event where we try to retrieve an event
      from an empty list if we attempt to retrieve an event with wait=False
      but no events have occurred.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1429314609-29776-19-git-send-email-jsnow@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      7898f74e
  25. 16 2月, 2015 2 次提交
  26. 07 2月, 2015 1 次提交