Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(676)

Side by Side Diff: client/virt/tests/shutdown.py

Issue 6883246: Merge autotest upstream from @5318 ~ @5336 (Closed) Base URL: ssh://gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/virt/tests/pxe.py ('k') | client/virt/tests/stress_boot.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import logging, time 1 import logging, time
2 from autotest_lib.client.common_lib import error 2 from autotest_lib.client.common_lib import error
3 import kvm_subprocess, kvm_test_utils, kvm_utils 3 from autotest_lib.client.virt import virt_utils
4 4
5 5
6 def run_shutdown(test, params, env): 6 def run_shutdown(test, params, env):
7 """ 7 """
8 KVM shutdown test: 8 KVM shutdown test:
9 1) Log into a guest 9 1) Log into a guest
10 2) Send a shutdown command to the guest, or issue a system_powerdown 10 2) Send a shutdown command to the guest, or issue a system_powerdown
11 monitor command (depending on the value of shutdown_method) 11 monitor command (depending on the value of shutdown_method)
12 3) Wait until the guest is down 12 3) Wait until the guest is down
13 13
(...skipping 13 matching lines...) Expand all
27 logging.info("Shutdown command sent; waiting for guest to go " 27 logging.info("Shutdown command sent; waiting for guest to go "
28 "down...") 28 "down...")
29 elif params.get("shutdown_method") == "system_powerdown": 29 elif params.get("shutdown_method") == "system_powerdown":
30 # Sleep for a while -- give the guest a chance to finish booting 30 # Sleep for a while -- give the guest a chance to finish booting
31 time.sleep(float(params.get("sleep_before_powerdown", 10))) 31 time.sleep(float(params.get("sleep_before_powerdown", 10)))
32 # Send a system_powerdown monitor command 32 # Send a system_powerdown monitor command
33 vm.monitor.cmd("system_powerdown") 33 vm.monitor.cmd("system_powerdown")
34 logging.info("system_powerdown monitor command sent; waiting for " 34 logging.info("system_powerdown monitor command sent; waiting for "
35 "guest to go down...") 35 "guest to go down...")
36 36
37 if not kvm_utils.wait_for(vm.is_dead, 240, 0, 1): 37 if not virt_utils.wait_for(vm.is_dead, 240, 0, 1):
38 raise error.TestFail("Guest refuses to go down") 38 raise error.TestFail("Guest refuses to go down")
39 39
40 logging.info("Guest is down") 40 logging.info("Guest is down")
41 41
42 finally: 42 finally:
43 session.close() 43 session.close()
OLDNEW
« no previous file with comments | « client/virt/tests/pxe.py ('k') | client/virt/tests/stress_boot.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698