diff mbox

[KVM-AUTOTEST,2/2] KVM test: timedrift test: close shell session before failing the test

Message ID 85f1057877cb0af31e96654b04235da7911dc997.1249475102.git.mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish Aug. 5, 2009, 12:32 p.m. UTC
Currently the shell session is sometimes not closed because the error.TestFail
exception is raised before the session has a chance to close.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_tests.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Lucas Meneghel Rodrigues Aug. 7, 2009, 8:36 p.m. UTC | #1
On Wed, Aug 5, 2009 at 9:32 AM, Michael Goldish<mgoldish@redhat.com> wrote:
> Currently the shell session is sometimes not closed because the error.TestFail
> exception is raised before the session has a chance to close.

Ok, bugfix applied!

http://autotest.kernel.org/changeset/3515

> Signed-off-by: Michael Goldish <mgoldish@redhat.com>
> ---
>  client/tests/kvm/kvm_tests.py |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/client/tests/kvm/kvm_tests.py b/client/tests/kvm/kvm_tests.py
> index 67cf713..d146929 100644
> --- a/client/tests/kvm/kvm_tests.py
> +++ b/client/tests/kvm/kvm_tests.py
> @@ -757,11 +757,11 @@ def run_timedrift(test, params, env):
>     logging.info("Total guest duration including rest: %.2f" % guest_delta_total)
>     logging.info("Total drift after rest: %.2f%%" % drift_total)
>
> +    session.close()
> +
>     # Fail the test if necessary
>     if drift > drift_threshold:
>         raise error.TestFail("Time drift too large: %.2f%%" % drift)
>     if drift > drift_threshold_after_rest:
>         raise error.TestFail("Time drift too large after rest period: %.2f%%"
>                              % drift_total)
> -
> -    session.close()
> --
> 1.5.4.1
>
> _______________________________________________
> Autotest mailing list
> Autotest@test.kernel.org
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_tests.py b/client/tests/kvm/kvm_tests.py
index 67cf713..d146929 100644
--- a/client/tests/kvm/kvm_tests.py
+++ b/client/tests/kvm/kvm_tests.py
@@ -757,11 +757,11 @@  def run_timedrift(test, params, env):
     logging.info("Total guest duration including rest: %.2f" % guest_delta_total)
     logging.info("Total drift after rest: %.2f%%" % drift_total)
 
+    session.close()
+
     # Fail the test if necessary
     if drift > drift_threshold:
         raise error.TestFail("Time drift too large: %.2f%%" % drift)
     if drift > drift_threshold_after_rest:
         raise error.TestFail("Time drift too large after rest period: %.2f%%"
                              % drift_total)
-
-    session.close()