Re: [PATCH] KVM test: Create a verify_kernel_crash() VM method

2011-03-02 Thread Michael Goldish
On 03/02/2011 07:30 AM, Jason Wang wrote: Lucas Meneghel Rodrigues writes: A method to verify guest kernel panics can be very useful for a number of tests. Adapted from a function present on virtio_console test, create VM.verify_kernel_crash() and use it on unattended_install.

Re: [PATCH] KVM test: Create a verify_kernel_crash() VM method

2011-03-02 Thread Michael Goldish
On 03/02/2011 05:46 AM, Lucas Meneghel Rodrigues wrote: A method to verify guest kernel panics can be very useful for a number of tests. Adapted from a function present on virtio_console test, create VM.verify_kernel_crash() and use it on unattended_install. Signed-off-by: Lucas Meneghel

[KVM-AUTOTEST PATCH 1/3] KVM test: kvm_config.py: support one-line conditional blocks

2011-02-21 Thread Michael Goldish
on the same line, e.g. ide: qcow2: Fedora: only unattended_install is equivalent to: ide..qcow2..Fedora: only unattended_install Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_config.py | 79 ++-- 1 files changed, 44 insertions

[KVM-AUTOTEST PATCH 2/3] KVM test: kvm_config.py: process_content(): look for Op instead of str

2011-02-21 Thread Michael Goldish
Looking for str is a mistake because content should only contains Ops and Filters. This is a harmless bug but it should be fixed. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_config.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[KVM-AUTOTEST PATCH 3/3] KVM test: kvm_config.py: support negative conditional blocks

2011-02-21 Thread Michael Goldish
If the filter starting a conditional block is preceded by '!', the condition is negative. For example: !Fedora.14, RHEL.6.0: only qcow2 means for everything except Fedora.14 and RHEL.6.0, allow only qcow2. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm

[KVM-AUTOTEST PATCH 1/2] KVM test: make_qemu_command(): properly deal with get_mac_address() failure

2011-02-18 Thread Michael Goldish
-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 969558b..d852784 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm

[KVM-AUTOTEST PATCH 2/2] KVM test: kvm_vm.py: make 'nic_mac' trigger a VM restart when changed

2011-02-18 Thread Michael Goldish
get_mac_address() should first check if 'nic_mac' is defined and then check the address pool. This way, if 'nic_mac' is changed between tests, make_qemu_command(), which calls get_mac_address(), will reveal the change and trigger a VM restart. Signed-off-by: Michael Goldish mgold...@redhat.com

[KVM-AUTOTEST PATCH 2/4] KVM test: kvm_config.py: allow 'include' when parsing strings

2011-02-17 Thread Michael Goldish
Currently 'include' is only allowed when parsing a file. This patch allows it to be used when parsing a string as well. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_config.py |9 - 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/client

[KVM-AUTOTEST PATCH 3/4] KVM test: kvm_config.py: remove unnecessary 'string' import

2011-02-17 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_config.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm/kvm_config.py b/client/tests/kvm/kvm_config.py index 27c3171..60df208 100755 --- a/client/tests/kvm/kvm_config.py +++ b

[KVM-AUTOTEST PATCH 4/4] KVM test: kvm_config.py: correct docstring of get_next_line()

2011-02-17 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_config.py |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/kvm_config.py b/client/tests/kvm/kvm_config.py index 60df208..a125129 100755 --- a/client/tests/kvm/kvm_config.py +++ b

[KVM-AUTOTEST PATCH 1/4] KVM test: kvm_config.py: parse extra strings passed as command line args

2011-02-17 Thread Michael Goldish
This allows to quickly see the effect of some extra code, e.g. ./kvm_config.py tests.cfg only my_set no qcow2 The given strings may contain newlines. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_config.py |7 ++- 1 files changed, 6 insertions(+), 1

Re: [Autotest] [KVM-AUTOTEST PATCH] KVM test: refactor kvm_config.py

2011-02-10 Thread Michael Goldish
On 02/10/2011 01:31 AM, Ryan Harper wrote: * Eduardo Habkost ehabk...@redhat.com [2011-02-09 10:22]: On Wed, Feb 09, 2011 at 10:06:03AM -0600, Ryan Harper wrote: Instead of regular expressions in the filters, the following syntax is used: , means OR .. means AND . means

Re: [Autotest] [KVM-AUTOTEST PATCH] KVM test: refactor kvm_config.py

2011-02-10 Thread Michael Goldish
On 02/10/2011 12:34 PM, Avi Kivity wrote: On 02/10/2011 11:14 AM, Michael Goldish wrote: only Fedora..boot So this would include Fedora.9.32.boot and Fedora.9.64.boot, but exclude Windows.XP.32.boot or Fedora.9.32.migrate? seems reasonable. Correct, and it would also include boot.Fedora

Re: [Autotest] [KVM-AUTOTEST PATCH] KVM test: refactor kvm_config.py

2011-02-10 Thread Michael Goldish
On 02/10/2011 12:47 PM, Avi Kivity wrote: On 02/10/2011 12:46 PM, Michael Goldish wrote: On 02/10/2011 12:34 PM, Avi Kivity wrote: On 02/10/2011 11:14 AM, Michael Goldish wrote: only Fedora..boot So this would include Fedora.9.32.boot and Fedora.9.64.boot, but exclude Windows.XP

Re: [Autotest] [KVM-AUTOTEST PATCH] KVM test: refactor kvm_config.py

2011-02-10 Thread Michael Goldish
On 02/10/2011 12:55 PM, Michael Goldish wrote: On 02/10/2011 12:47 PM, Avi Kivity wrote: On 02/10/2011 12:46 PM, Michael Goldish wrote: On 02/10/2011 12:34 PM, Avi Kivity wrote: On 02/10/2011 11:14 AM, Michael Goldish wrote: only Fedora..boot So this would include Fedora.9.32.boot

Re: [Autotest] [KVM-AUTOTEST PATCH] KVM test: refactor kvm_config.py

2011-02-10 Thread Michael Goldish
On 02/10/2011 01:03 PM, Avi Kivity wrote: On 02/10/2011 12:57 PM, Michael Goldish wrote: I can't easily think of a case where this might cause confusion. The purpose of this is to allow people to write: only qcow2..raw..rtl8139 without having to remember the order in which

Re: [KVM-AUTOTEST PATCH] KVM test: refactor kvm_config.py

2011-02-09 Thread Michael Goldish
On 02/09/2011 11:28 AM, Avi Kivity wrote: On 02/09/2011 03:50 AM, Michael Goldish wrote: This is a reimplementation of the dict generator. It is much faster than the current implementation and uses a very small amount of memory. Running time and memory usage scale polynomially

Re: [PATCH 1/2] KVM test: Turning hugepages setup into KVM autotest infrastructure

2011-01-19 Thread Michael Goldish
On 01/19/2011 03:56 AM, Lucas Meneghel Rodrigues wrote: So we can get rid of scripts/hugepage.py. The implementation strategy is to have a kvm_utils.HugePageConfig class that can do both hugepages setup and cleanup, and call it during pre/postprocessing. Signed-off-by: Lucas Meneghel

Re: [PATCH 1/3] KVM test: Introduce check_image postprocess directive

2011-01-18 Thread Michael Goldish
On 01/19/2011 01:45 AM, Lucas Meneghel Rodrigues wrote: With check_image_foo = yes, KVM autotest will use qemu-img to perform checks on the qcow2 image. This new functionality intends to replace the script check_image.py. The plan is to supersede most of the pre/post scripts in place

Re: [Autotest] [PATCH 2/3] KVM test: Modify enospc test to not require scripts/check_image.py

2011-01-18 Thread Michael Goldish
On 01/19/2011 01:45 AM, Lucas Meneghel Rodrigues wrote: With this we prepare to remove the aforementioned script. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com --- client/tests/kvm/tests/enospc.py | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git

Re: [PATCH 2/2] KVM test: Run client tests of autotest in parallel with migration

2011-01-11 Thread Michael Goldish
On 01/11/2011 07:22 AM, Lucas Meneghel Rodrigues wrote: From: Jason Wang jasow...@redhat.com Run some workload in the background and do the migration would be helpful to verfiy the correctness, so this patch use the Thread class to wait for the completion of autotest cmd -- bin/autotest

[KVM-AUTOTEST PATCH 01/26] error.py: clear context when setting base_context

2011-01-11 Thread Michael Goldish
Because base_context is one level higher than context, it makes sense to clear context when base_context is changed. This can prevent mistakes and save a little bit of code. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/common_lib/error.py |1 + 1 files changed, 1 insertions

[KVM-AUTOTEST PATCH 02/26] error.py: Unhandled*: don't keep references to unhandled exceptions

2011-01-11 Thread Michael Goldish
these parameters in .args. It's better to deal with this problem in the Unhandled* wrappers than to have to deal with it in all other exception classes. This weird Python behavior is apparently a known issue: http://bugs.python.org/issue1692335 Signed-off-by: Michael Goldish mgold...@redhat.com

[KVM-AUTOTEST PATCH 03/26] KVM test: migrate.mig_cancel: set mig_cancel to 'yes' instead of 'True'

2011-01-11 Thread Michael Goldish
The tests using mig_cancel expect it to be 'yes', not 'True'. This is consistent with other boolean test parameters. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests_base.cfg.sample |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/client

[KVM-AUTOTEST PATCH 04/26] KVM test: migrate_with_file_transfer: respect 'mig_cancel'

2011-01-11 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- .../kvm/tests/migration_with_file_transfer.py |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm/tests/migration_with_file_transfer.py b/client/tests/kvm/tests/migration_with_file_transfer.py

[KVM-AUTOTEST PATCH 06/26] KVM test: clock_getres: fix dmesg logging

2011-01-11 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests/clock_getres.py |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/tests/clock_getres.py b/client/tests/kvm/tests/clock_getres.py index 1a762e5..5ab4d33 100644 --- a/client

[KVM-AUTOTEST PATCH 05/26] KVM test: migration: minor style changes

2011-01-11 Thread Michael Goldish
Mainly moving a logging call from kvm_monitor.py to kvm_vm.py. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_monitor.py |1 - client/tests/kvm/kvm_vm.py |6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/tests/kvm

[KVM-AUTOTEST PATCH 08/26] KVM test: unattended_install.py style changes

2011-01-11 Thread Michael Goldish
debug messages. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests/unattended_install.py | 64 +++-- 1 files changed, 28 insertions(+), 36 deletions(-) diff --git a/client/tests/kvm/tests/unattended_install.py b/client/tests/kvm/tests

[KVM-AUTOTEST PATCH 10/26] KVM test: use VM.reboot() instead of kvm_test_utils.reboot()

2011-01-11 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests/boot.py | 16 +--- client/tests/kvm/tests/guest_test.py|4 ++-- client/tests/kvm/tests/iofuzz.py|3 +-- client/tests/kvm/tests/kdump.py

[KVM-AUTOTEST PATCH 12/26] KVM test: kvm_preprocessing.py: remove some unnecessary debug messages

2011-01-11 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py index 5a452fa..7b3b75b 100644 --- a/client

[KVM-AUTOTEST PATCH 11/26] KVM test: cleanup and contextify stress_boot

2011-01-11 Thread Michael Goldish
- Minor style changes. - Make the code a bit shorter. - Use contexts. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests/stress_boot.py | 45 +--- 1 files changed, 18 insertions(+), 27 deletions(-) diff --git a/client/tests/kvm/tests

[KVM-AUTOTEST PATCH 09/26] KVM test: make reboot() a VM method

2011-01-11 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py | 54 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index b0b3ea6..525c065 100755 --- a/client

[KVM-AUTOTEST PATCH 16/26] KVM test: kvm_monitor: make MonitorSocketError.__init__() receive a socket.error

2011-01-11 Thread Michael Goldish
Receive a socket.error exception and store it as an attribute. It's cleaner and probably a bit easier to maintain than embedding the error message in the string passed to the constructor. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_monitor.py | 19

[KVM-AUTOTEST PATCH 18/26] KVM test: _remote_login(): fail if a login prompt is received after a password prompt

2011-01-11 Thread Michael Goldish
No need to wait for the password prompt to appear twice. If a login prompt is received after a password prompt, it means the password/username was incorrect. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_utils.py |9 ++--- 1 files changed, 6 insertions

[KVM-AUTOTEST PATCH 19/26] KVM test: log qemu command and qemu output as INFO rather than DEBUG

2011-01-11 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index c9f779f..1fcb352 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests

[KVM-AUTOTEST PATCH 20/26] KVM test: rss_file_transfer.py: refactor exceptions

2011-01-11 Thread Michael Goldish
- Override the __init__() and __str__() methods of some exceptions. - Use FileTransferSocketError instead of FileTransferSendError. - Embed the socket error message and/or the current filename in raised exceptions. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm

[KVM-AUTOTEST PATCH 21/26] KVM test: rss_file_transfer.py: timeout fixes

2011-01-11 Thread Michael Goldish
- Make some changes to the way timeouts are handled internally. - Increase default timeout from 10 to 60 or 20 for various functions. - Set a timeout for _send() as well. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/rss_file_transfer.py | 115

[KVM-AUTOTEST PATCH 22/26] KVM test: rss_file_transfer: optionally log some statistics

2011-01-11 Thread Michael Goldish
This may be useful in migration_with_file_transfer, for example, as it will show how the transfer speed drops during migration. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_utils.py | 20 -- client/tests/kvm/kvm_vm.py

[KVM-AUTOTEST PATCH 26/26] KVM test: don't attempt to run clock_getres on Windows

2011-01-11 Thread Michael Goldish
It compiles something on the host, sends it to the guest and runs it, so it's a Linux-only test. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests_base.cfg.sample |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm

[KVM-AUTOTEST PATCH 17/26] KVM test: kill_unresponsive_vms: log exception message

2011-01-11 Thread Michael Goldish
If a VM is unresponsive (login() raises an exception), log it. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm

[KVM-AUTOTEST PATCH 25/26] KVM test: VM.destroy(): allow keeping the MAC addresses

2011-01-11 Thread Michael Goldish
Sometimes (e.g. in guest_s4) we want to destroy and restart a VM without changing its MAC addresses. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py | 15 +-- 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py

[KVM-AUTOTEST PATCH 24/26] KVM test: vmstop: ignore exceptions raised in the background thread

2011-01-11 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests/vmstop.py |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm/tests/vmstop.py b/client/tests/kvm/tests/vmstop.py index 0fb48fa..4d47471 100644 --- a/client/tests/kvm/tests

[KVM-AUTOTEST PATCH 07/26] KVM test: VM.destroy(): modify logging messages

2011-01-11 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 4c3ab14..b0b3ea6 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests

[KVM-AUTOTEST PATCH 14/26] KVM test: VMMigrateStateMismatchError: call base constructor

2011-01-11 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 98ad0c3..c9f779f 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm

[KVM-AUTOTEST PATCH 13/26] KVM test: beautify VM, shell, monitor and login exception messages

2011-01-11 Thread Michael Goldish
- Separate different logical parts of the messages with 4 spaces. - Add output info to all login and SCP messages. - Add 'using arping' to VMAddressVerificationError. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_monitor.py|4 +- client/tests/kvm

[KVM-AUTOTEST PATCH 23/26] KVM test: migrate.with_file_transfer: don't limit file_size to 10MB with rtl8139

2011-01-11 Thread Michael Goldish
It can take less than a second to transfer 10MB, even with rtl8139. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests_base.cfg.sample |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm

[KVM-AUTOTEST PATCH 1/4] KVM test: kvm_vm.py: add status and output to VMDeadError

2011-01-11 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 0403569..a69a191 100755 --- a/client/tests/kvm/kvm_vm.py +++ b

[KVM-AUTOTEST PATCH 2/4] KVM test: kvm_utils.Thread.join(): allow suppressing the exception

2011-01-11 Thread Michael Goldish
If suppress_exception is True, the exception raised in the thread will not be re-raised. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_utils.py | 16 +--- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/client/tests/kvm/kvm_utils.py b

[KVM-AUTOTEST PATCH 3/4] KVM test: don't re-raise a background exception if something went wrong in the main thread

2011-01-11 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- .../kvm/tests/migration_with_file_transfer.py |7 ++- client/tests/kvm/tests/migration_with_reboot.py|7 ++- client/tests/kvm/tests/vmstop.py |5 + 3 files changed, 13 insertions(+), 6

[KVM-AUTOTEST PATCH 4/4] KVM test: VM.migrate(): make sure the VM is alive after migration

2011-01-11 Thread Michael Goldish
Also add a context() call to make the VMDeadError exception more descriptive. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py

Re: [PATCH 1/2 RESEND] KVM Test: Introduce qmp_monitor property in 'kvm_vm.VM'

2011-01-10 Thread Michael Goldish
On 01/10/2011 12:47 PM, qz...@redhat.com wrote: From: Qingtang Zhouqz...@redhat.com Introduce qmp_monitor property can help us easily get a qmp monitor of guest. CC to Luiz and kvm@vger.kernel.org Signed-off-by: Qingtang Zhouqz...@redhat.com The monitor property returns the main monitor.

[KVM-AUTOTEST PATCH v3 01/11] Fix Unhandled* exceptions

2011-01-07 Thread Michael Goldish
. To fix this, this patch makes the Unhandled* exceptions rely on __str__() and attributes (self.unhandled_exception and self.traceback) instead of __init__() and self.args. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/bin/job.py |6 ++-- client/common_lib/error.py

[KVM-AUTOTEST PATCH v3 02/11] CmdError: remove extra blank line between methods

2011-01-07 Thread Michael Goldish
For consistency with other exception classes, keep just a single blank line between __init__() and __str__(). Signed-off-by: Michael Goldish mgold...@redhat.com --- client/common_lib/error.py |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/client/common_lib/error.py b

[KVM-AUTOTEST PATCH v3 03/11] Introduce exception context strings

2011-01-07 Thread Michael Goldish
base_context(). This may be useful for some functions. - Update the comment in error.py. - Rename context_for_exception() to exception_context(). - Add set_exception_context(). - Add join_contexts(). Signed-off-by: Michael Goldish mgold...@redhat.com Signed-off-by: Eduardo Habkost ehabk...@redhat.com

[KVM-AUTOTEST PATCH v3 04/11] Embed context information in exception strings

2011-01-07 Thread Michael Goldish
Exceptions look for a ._context attribute and embed it in the string returned by __str__(). If the attribute isn't set (or if it's an empty string) nothing is embedded. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/common_lib/error.py | 10 +- 1 files changed, 9

[KVM-AUTOTEST PATCH v3 05/11] KVM test: Thread.join(): insert the current context into the thread's exception

2011-01-07 Thread Michael Goldish
Because contexts are thread specific, exceptions raised in another thread will not contain the context in which the thread was started/joined. This context should be explicitly inserted into any exception raised in the thread and re-raised in join(). Signed-off-by: Michael Goldish mgold

[KVM-AUTOTEST PATCH v3 06/11] KVM test: use error.context() in migration_with_file_transfer

2011-01-07 Thread Michael Goldish
This is an example of a case where context information is useful. Signed-off-by: Michael Goldish mgold...@redhat.com --- .../kvm/tests/migration_with_file_transfer.py | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/tests/kvm/tests

[KVM-AUTOTEST PATCH v3 08/11] KVM test: use error.context() in VM.login() and VM.copy_files_*()

2011-01-07 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 056416e..997a44f 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client

[KVM-AUTOTEST PATCH v3 10/11] KVM test: use error.context() in VM.migrate()

2011-01-07 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 6f494eb..259bb18 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests

[KVM-AUTOTEST PATCH v3 11/11] KVM test: use error.context() in guest_s4

2011-01-07 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests/guest_s4.py | 13 +++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/tests/guest_s4.py b/client/tests/kvm/tests/guest_s4.py index 7f61c33..5641654 100644 --- a/client/tests

[KVM-AUTOTEST PATCH v3 07/11] KVM test: use error.context() in kvm_preprocessing.py

2011-01-07 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py index 5ce0a3b..5a452fa 100644 --- a/client

[KVM-AUTOTEST PATCH v3 09/11] KVM test: use error.context() in VM.create()

2011-01-07 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 997a44f..6f494eb 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm

Re: [KVM-AUTOTEST PATCH v2 3/6] [RFC] Introduce exception context strings

2011-01-06 Thread Michael Goldish
On 01/05/2011 06:21 PM, Avi Kivity wrote: On 01/05/2011 06:12 PM, Avi Kivity wrote: On 01/05/2011 05:45 PM, Michael Goldish wrote: In complex tests (KVM) an exception string is often not informative enough and the traceback and source code have to be examined in order to figure out what

[KVM-AUTOTEST PATCH v2 1/6] [RFC] Fix Unhandled* exceptions

2011-01-05 Thread Michael Goldish
it to the parent exception's __init__() without modification. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/bin/job.py |6 ++-- client/common_lib/error.py | 51 --- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/client/bin

[KVM-AUTOTEST PATCH v2 3/6] [RFC] Introduce exception context strings

2011-01-05 Thread Michael Goldish
If login fails in the pre-reboot section, the resulting exception string can can have something like context: before reboot embedded in it. (The actual embedding is done in the next patch in the series.) Signed-off-by: Michael Goldish mgold...@redhat.com Signed-off-by: Eduardo Habkost ehabk

[KVM-AUTOTEST PATCH v2 2/6] [RFC] CmdError: remove extra blank line between methods

2011-01-05 Thread Michael Goldish
For consistency with other exception classes, keep just a single blank line between __init__() and __str__(). Signed-off-by: Michael Goldish mgold...@redhat.com --- client/common_lib/error.py |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/client/common_lib/error.py b

[KVM-AUTOTEST PATCH v2 4/6] [RFC] Embed context information in exception strings

2011-01-05 Thread Michael Goldish
Exceptions look for a ._context attribute and embed it in the string returned by __str__(). If the attribute isn't set (or if it's an empty string) nothing is embedded. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/common_lib/error.py | 10 +- 1 files changed, 9

[KVM-AUTOTEST PATCH v2 6/6] [RFC] KVM test: use error.context() in kvm_preprocessing.py

2011-01-05 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py | 13 +++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py index 5ce0a3b..e5b8906 100644

[KVM-AUTOTEST PATCH v2 5/6] [RFC] KVM test: use error.context() in migration_with_file_transfer

2011-01-05 Thread Michael Goldish
This is an example of a case where context information is useful. Signed-off-by: Michael Goldish mgold...@redhat.com --- .../kvm/tests/migration_with_file_transfer.py | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/tests/kvm/tests

Re: [KVM-AUTOTEST PATCH v2 3/6] [RFC] Introduce exception context strings

2011-01-05 Thread Michael Goldish
On 01/05/2011 06:21 PM, Eduardo Habkost wrote: On Wed, Jan 05, 2011 at 06:12:05PM +0200, Avi Kivity wrote: It would be nice to make the error context a stack, and to use the with statement to manage the stack: with error.context(main test): foo() with error.context(before

[KVM-AUTOTEST PATCH 01/17] KVM test: introduce exception classes for _remote_login() and _remote_scp()

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_utils.py | 68 +++- 1 files changed, 66 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py index 49e3fe8..41117e3 100644

[KVM-AUTOTEST PATCH 02/17] KVM test: kvm_utils.py: reorder remote_login(), remote_scp(), copy_files_to(), etc

2011-01-03 Thread Michael Goldish
Reorder the definition of these functions so that login functions are clustered together, and higher level functions are further down in the file. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_utils.py | 180 1 files changed

[KVM-AUTOTEST PATCH 03/17] KVM test: use the new LoginError and SCPError exceptions

2011-01-03 Thread Michael Goldish
- Raise these exceptions where appropriate (remote_login(), remote_scp(), etc) - Modify code that uses the functions that raise the new exceptions to account for their changed behavior. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py

[KVM-AUTOTEST PATCH 04/17] KVM test: add VM.wait_for_login() and kvm_utils.wait_for_login()

2011-01-03 Thread Michael Goldish
These are intended as a replacement for kvm_test_utils.wait_for_login(). Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_utils.py | 29 +++ client/tests/kvm/kvm_vm.py| 43 + 2 files changed, 72

[KVM-AUTOTEST PATCH 05/17] KVM test: use the new wait_for_login()

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_test_utils.py |4 +--- client/tests/kvm/tests/autotest.py |2 +- client/tests/kvm/tests/balloon_check.py|2 +- client/tests/kvm/tests/boot.py

[KVM-AUTOTEST PATCH 08/17] KVM test: let kvm_vm.create_image() raise a CmdError if qemu-img fails

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py | 15 ++- 1 files changed, 2 insertions(+), 13 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index c237fbe..32be55e 100755 --- a/client/tests/kvm/kvm_vm.py +++ b

[KVM-AUTOTEST PATCH 10/17] KVM test: add VM.verify_alive() and Monitor.verify_responsive()

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_monitor.py | 31 +++ client/tests/kvm/kvm_vm.py | 21 - 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/client/tests/kvm/kvm_monitor.py b/client

[KVM-AUTOTEST PATCH 11/17] KVM test: use VM.verify_alive() instead of kvm_test_utils.get_living_vm()

2011-01-03 Thread Michael Goldish
It looks cleaner even though it's 1 extra line. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests/autotest.py |3 ++- client/tests/kvm/tests/balloon_check.py|3 ++- client/tests/kvm/tests/boot.py |3

[KVM-AUTOTEST PATCH 13/17] KVM test: make migrate() a VM method

2011-01-03 Thread Michael Goldish
This should make it easier to run things in parallel to migration, because the method switches the VM object's __dict__ instead of the VM object itself. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py | 142 1 files

[KVM-AUTOTEST PATCH 15/17] KVM test: use VM.migrate() instead of kvm_test_utils.migrate()

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests/migration.py|7 +++ client/tests/kvm/tests/migration_multi_host.py |3 +-- client/tests/kvm/tests/timedrift_with_migration.py |2 +- 3 files changed, 5 insertions(+), 7 deletions

[KVM-AUTOTEST PATCH 16/17] KVM test: reorder kvm_utils.copy_files_from() path parameters

2011-01-03 Thread Michael Goldish
change because the only use of kvm_utils.copy_files_*() is in kvm_vm.py. VM.copy_files_*() remain unchanged. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_utils.py |8 client/tests/kvm/kvm_vm.py|2 +- 2 files changed, 5 insertions(+), 5 deletions

[KVM-AUTOTEST PATCH 06/17] KVM test: rename VM.remote_login() to VM.login()

2011-01-03 Thread Michael Goldish
Keep remote_login() as an alias for backward compatibility. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py |2 +- client/tests/kvm/kvm_test_utils.py|2 +- client/tests/kvm/kvm_vm.py| 21 ++--- client/tests

[KVM-AUTOTEST PATCH 07/17] KVM test: introduce VM exceptions

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py | 146 1 files changed, 146 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index e310401..c237fbe 100755

[KVM-AUTOTEST PATCH 09/17] KVM test: use the new VM exceptions

2011-01-03 Thread Michael Goldish
- Raise them where appropriate. - Catch and handle them where appropriate. - Modify docstrings. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py|9 +-- client/tests/kvm/kvm_test_utils.py |5 +- client/tests/kvm/kvm_vm.py

[KVM-AUTOTEST PATCH 14/17] KVM test: simplify migration_with_reboot and migration_with_file_transfer

2011-01-03 Thread Michael Goldish
Now that migration can be performed without switching VMs (but rather by switching states) these tests can be greatly simplified. Signed-off-by: Michael Goldish mgold...@redhat.com --- .../kvm/tests/migration_with_file_transfer.py | 53 +++- client/tests/kvm/tests

[KVM-AUTOTEST PATCH 17/17] KVM test: rename path parameters in kvm_vm.copy_files_*()

2011-01-03 Thread Michael Goldish
local_path - host_path remote_path - guest_path Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py | 17 - 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 4680577

[KVM-AUTOTEST PATCH 12/17] KVM test: kvm_preprocessing.py: simplify handling of params['migration_mode']

2011-01-03 Thread Michael Goldish
Also reorder the if statements because if migration_mode is specified it causes an unconditional VM restart (unlike start_vm). Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py | 16 ++-- 1 files changed, 6 insertions(+), 10 deletions

[KVM-AUTOTEST PATCH 1/7] [RFC] Fix Unhandled* exceptions

2011-01-03 Thread Michael Goldish
it to the parent exception's __init__() without modification. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/bin/job.py |6 ++-- client/common_lib/error.py | 51 --- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/client/bin

[KVM-AUTOTEST PATCH 2/7] [RFC] CmdError: remove extra blank line between methods

2011-01-03 Thread Michael Goldish
For consistency with other exception classes, keep just a single blank line between __init__() and __str__(). Signed-off-by: Michael Goldish mgold...@redhat.com --- client/common_lib/error.py |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/client/common_lib/error.py b

[KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Michael Goldish
If login fails in the pre-reboot section, the resulting exception string can can have something like context: before reboot embedded in it. (The actual embedding is done in the next patch in the series.) Signed-off-by: Michael Goldish mgold...@redhat.com --- client/common_lib/error.py | 82

[KVM-AUTOTEST PATCH 4/7] [RFC] Embed context information in exception strings

2011-01-03 Thread Michael Goldish
Exceptions look for a .context attribute and embed it in the string returned by __str__(). If the attribute isn't set (or if it's an empty strgin) nothing is embedded. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/common_lib/error.py | 13 - 1 files changed, 12

[KVM-AUTOTEST PATCH 5/7] [RFC] Set the .context attribute for exceptions in _call_test_function()

2011-01-03 Thread Michael Goldish
Before passing exceptions on up, inject context information into them which can later be used by __str__(). Signed-off-by: Michael Goldish mgold...@redhat.com --- client/common_lib/test.py | 16 ++-- 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/client/common_lib

[KVM-AUTOTEST PATCH 6/7] [RFC] KVM test: use error.context() in migration_with_file_transfer

2011-01-03 Thread Michael Goldish
This is an example of a case where context information is useful. Signed-off-by: Michael Goldish mgold...@redhat.com --- .../kvm/tests/migration_with_file_transfer.py |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/tests/kvm/tests

[KVM-AUTOTEST PATCH 7/7] [RFC] KVM test: use error.context() in kvm_preprocessing.py

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py index 5ce0a3b..b7f3154 100644 --- a/client

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Michael Goldish
On 01/03/2011 09:26 PM, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote: +# Exception context information: +# -- +# Every function can have some context string associated with it. +# The context string can be changed

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Michael Goldish
On 01/03/2011 10:26 PM, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote: + +context_data = threading.local() +context_data.contexts = {} Won't this create a single dictionary, only for one single thread, leaving all other threads

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Michael Goldish
On 01/03/2011 10:16 PM, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 09:48:02PM +0200, Michael Goldish wrote: On 01/03/2011 09:26 PM, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote: +# Exception context information

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Michael Goldish
On 01/04/2011 12:06 AM, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 07:22:17PM -0200, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 11:07:53PM +0200, Michael Goldish wrote: If I understand your suggestion correctly, then: - The purpose of contexts is to add information to exceptions

Re: [Autotest] [KVM-AUTOTEST PATCH 03/28] KVM test: corrections to migration_with_reboot

2010-12-28 Thread Michael Goldish
On 12/28/2010 02:25 PM, Jason Wang wrote: Michael Goldish writes: - Use wait_for() to try remote_login() multiple times before giving up. - Take VM parameters from vm.params, not params. Is there any differnce between those in current context? Other looks good, thanks

Re: [Autotest] [KVM-AUTOTEST PATCH v2] KVM test: migration_with_file_transfer: verify transfer correctness

2010-12-28 Thread Michael Goldish
On 12/28/2010 02:38 PM, Jason Wang wrote: Michael Goldish writes: After the transfer, copy the file back from the guest to the host and make sure the returned file is identical to the one sent to the guest. Changes from v1: - hash_file() is in autotest_lib.client.bin.utils, so

  1   2   3   4   5   6   7   >