From: Lucas Meneghel Rodrigues <lmr@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: Re: KVM autotest: add boot_savevm test
Date: Sat, 17 Apr 2010 15:18:00 -0300 [thread overview]
Message-ID: <1271528280.2597.0.camel@localhost.localdomain> (raw)
In-Reply-To: <20100415190940.GA5303@amt.cnet>
On Thu, 2010-04-15 at 16:09 -0300, Marcelo Tosatti wrote:
> This test boots a guest while periodically running savevm/loadvm.
Ok Marcelo, test looks good, applied.
Thanks!
> Adjust savevm_delay/guest memory size to reduce run time, if
> excessive.
>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>
> Index: autotest/client/tests/kvm/tests/boot_savevm.py
> ===================================================================
> --- /dev/null
> +++ autotest/client/tests/kvm/tests/boot_savevm.py
> @@ -0,0 +1,54 @@
> +import logging, time
> +from autotest_lib.client.common_lib import error
> +import kvm_subprocess, kvm_test_utils, kvm_utils
> +
> +def run_boot_savevm(test, params, env):
> + """
> + KVM boot savevm test:
> + 1) Start guest
> + 2) Periodically savevm/loadvm
> + 4) Log into the guest to verify it's up, fail after timeout seconds
> +
> + @param test: kvm test object
> + @param params: Dictionary with the test parameters
> + @param env: Dictionary with test environment.
> + """
> + vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> + savevm_delay = float(params.get("savevm_delay"))
> + savevm_login_delay = float(params.get("savevm_login_delay"))
> + logging.info("savevm_delay = %f" % savevm_delay)
> + login_expire = time.time() + savevm_login_delay
> + end_time = time.time() + float(params.get("savevm_timeout"))
> +
> + while time.time() < end_time:
> + time.sleep(savevm_delay)
> +
> + s, o = vm.send_monitor_cmd("stop")
> + if s:
> + logging.error("stop failed: %r" % o)
> + s, o = vm.send_monitor_cmd("savevm 1")
> + if s:
> + logging.error("savevm failed: %r" % o)
> + s, o = vm.send_monitor_cmd("system_reset")
> + if s:
> + logging.error("system_reset: %r" % o)
> + s, o = vm.send_monitor_cmd("loadvm 1")
> + if s:
> + logging.error("loadvm failed: %r" % o)
> + s, o = vm.send_monitor_cmd("cont")
> + if s:
> + logging.error("cont failed: %r" % o)
> +
> + # Log in
> + if (time.time() > login_expire):
> + login_expire = time.time() + savevm_login_delay
> + logging.info("Logging in after loadvm...")
> + session = kvm_utils.wait_for(vm.remote_login, 1, 0, 1)
> + if not session:
> + logging.info("Failed to login")
> + else:
> + logging.info("Logged in to guest!")
> + break
> +
> + if (time.time() > end_time):
> + raise error.TestFail("fail: timeout")
> Index: autotest/client/tests/kvm/tests_base.cfg.sample
> ===================================================================
> --- autotest.orig/client/tests/kvm/tests_base.cfg.sample
> +++ autotest/client/tests/kvm/tests_base.cfg.sample
> @@ -105,6 +105,15 @@ variants:
> iterations = 2
> used_mem = 1024
>
> + - boot_savevm: install setup unattended_install
> + type = boot_savevm
> + savevm_delay = 0.3
> + savevm_login_delay = 120
> + savevm_timeout = 2000
> + kill_vm_on_error = yes
> + kill_vm_gracefully = yes
> + kill_vm = yes
> +
> - autotest: install setup unattended_install
> type = autotest
> test_timeout = 1800
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2010-04-17 18:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 19:09 KVM autotest: add boot_savevm test Marcelo Tosatti
2010-04-17 18:18 ` Lucas Meneghel Rodrigues [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1271528280.2597.0.camel@localhost.localdomain \
--to=lmr@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox