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

Side by Side Diff: client/virt/tests/kdump.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/jumbo.py ('k') | client/virt/tests/linux_s3.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 1 import logging
2 from autotest_lib.client.common_lib import error 2 from autotest_lib.client.common_lib import error
3 import kvm_utils 3 from autotest_lib.client.virt import virt_utils
4 4
5 5
6 def run_kdump(test, params, env): 6 def run_kdump(test, params, env):
7 """ 7 """
8 KVM reboot test: 8 KVM reboot test:
9 1) Log into a guest 9 1) Log into a guest
10 2) Check and enable the kdump 10 2) Check and enable the kdump
11 3) For each vcpu, trigger a crash and check the vmcore 11 3) For each vcpu, trigger a crash and check the vmcore
12 12
13 @param test: kvm test object 13 @param test: kvm test object
(...skipping 20 matching lines...) Expand all
34 34
35 @param vcpu: vcpu which is used to trigger a crash 35 @param vcpu: vcpu which is used to trigger a crash
36 """ 36 """
37 session = vm.wait_for_login(timeout=timeout) 37 session = vm.wait_for_login(timeout=timeout)
38 session.cmd_output("rm -rf /var/crash/*") 38 session.cmd_output("rm -rf /var/crash/*")
39 39
40 logging.info("Triggering crash on vcpu %d ...", vcpu) 40 logging.info("Triggering crash on vcpu %d ...", vcpu)
41 crash_cmd = "taskset -c %d echo c > /proc/sysrq-trigger" % vcpu 41 crash_cmd = "taskset -c %d echo c > /proc/sysrq-trigger" % vcpu
42 session.sendline(crash_cmd) 42 session.sendline(crash_cmd)
43 43
44 if not kvm_utils.wait_for(lambda: not session.is_responsive(), 240, 0, 44 if not virt_utils.wait_for(lambda: not session.is_responsive(), 240, 0,
45 1): 45 1):
46 raise error.TestFail("Could not trigger crash on vcpu %d" % vcpu) 46 raise error.TestFail("Could not trigger crash on vcpu %d" % vcpu)
47 47
48 logging.info("Waiting for kernel crash dump to complete") 48 logging.info("Waiting for kernel crash dump to complete")
49 session = vm.wait_for_login(timeout=crash_timeout) 49 session = vm.wait_for_login(timeout=crash_timeout)
50 50
51 logging.info("Probing vmcore file...") 51 logging.info("Probing vmcore file...")
52 session.cmd("ls -R /var/crash | grep vmcore") 52 session.cmd("ls -R /var/crash | grep vmcore")
53 logging.info("Found vmcore.") 53 logging.info("Found vmcore.")
54 54
(...skipping 11 matching lines...) Expand all
66 logging.info("Enabling kdump service...") 66 logging.info("Enabling kdump service...")
67 # the initrd may be rebuilt here so we need to wait a little more 67 # the initrd may be rebuilt here so we need to wait a little more
68 session.cmd(kdump_enable_cmd, timeout=120) 68 session.cmd(kdump_enable_cmd, timeout=120)
69 69
70 nvcpu = int(params.get("smp", 1)) 70 nvcpu = int(params.get("smp", 1))
71 for i in range (nvcpu): 71 for i in range (nvcpu):
72 crash_test(i) 72 crash_test(i)
73 73
74 finally: 74 finally:
75 session.close() 75 session.close()
OLDNEW
« no previous file with comments | « client/virt/tests/jumbo.py ('k') | client/virt/tests/linux_s3.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698