OLD | NEW |
1 import os, time, commands, re, logging, glob, threading, shutil | 1 import os, time, commands, re, logging, glob, threading, shutil |
2 from autotest_lib.client.bin import utils | 2 from autotest_lib.client.bin import utils |
3 from autotest_lib.client.common_lib import error | 3 from autotest_lib.client.common_lib import error |
4 import kvm_vm, kvm_utils, kvm_subprocess, kvm_monitor, ppm_utils, test_setup | 4 import kvm_vm, kvm_utils, kvm_subprocess, kvm_monitor, ppm_utils, test_setup |
5 try: | 5 try: |
6 import PIL.Image | 6 import PIL.Image |
7 except ImportError: | 7 except ImportError: |
8 logging.warning('No python imaging library installed. PPM image ' | 8 logging.warning('No python imaging library installed. PPM image ' |
9 'conversion to JPEG disabled. In order to enable it, ' | 9 'conversion to JPEG disabled. In order to enable it, ' |
10 'please install python-imaging or the equivalent for your ' | 10 'please install python-imaging or the equivalent for your ' |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 # Kill all kvm_subprocess tail threads | 356 # Kill all kvm_subprocess tail threads |
357 kvm_subprocess.kill_tail_threads() | 357 kvm_subprocess.kill_tail_threads() |
358 | 358 |
359 # Terminate tcpdump if no VMs are alive | 359 # Terminate tcpdump if no VMs are alive |
360 living_vms = [vm for vm in env.get_all_vms() if vm.is_alive()] | 360 living_vms = [vm for vm in env.get_all_vms() if vm.is_alive()] |
361 if not living_vms and "tcpdump" in env: | 361 if not living_vms and "tcpdump" in env: |
362 env["tcpdump"].close() | 362 env["tcpdump"].close() |
363 del env["tcpdump"] | 363 del env["tcpdump"] |
364 | 364 |
365 if params.get("setup_hugepages") == "yes": | 365 if params.get("setup_hugepages") == "yes": |
366 h = kvm_utils.HugePageConfig(params) | 366 h = test_setup.HugePageConfig(params) |
367 h.cleanup() | 367 h.cleanup() |
368 | 368 |
369 if params.get("type") == "enospc": | 369 if params.get("type") == "enospc": |
370 e = test_setup.EnospcConfig(test, params) | 370 e = test_setup.EnospcConfig(test, params) |
371 e.cleanup() | 371 e.cleanup() |
372 | 372 |
373 # Execute any post_commands | 373 # Execute any post_commands |
374 if params.get("post_command"): | 374 if params.get("post_command"): |
375 process_command(test, params, env, params.get("post_command"), | 375 process_command(test, params, env, params.get("post_command"), |
376 int(params.get("post_command_timeout", "600")), | 376 int(params.get("post_command_timeout", "600")), |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 image = PIL.Image.open(temp_filename) | 458 image = PIL.Image.open(temp_filename) |
459 image.save(screendump_filename, format="JPEG", quality=quali
ty) | 459 image.save(screendump_filename, format="JPEG", quality=quali
ty) |
460 cache[hash] = screendump_filename | 460 cache[hash] = screendump_filename |
461 except NameError: | 461 except NameError: |
462 pass | 462 pass |
463 os.unlink(temp_filename) | 463 os.unlink(temp_filename) |
464 if _screendump_thread_termination_event.isSet(): | 464 if _screendump_thread_termination_event.isSet(): |
465 _screendump_thread_termination_event = None | 465 _screendump_thread_termination_event = None |
466 break | 466 break |
467 _screendump_thread_termination_event.wait(delay) | 467 _screendump_thread_termination_event.wait(delay) |
OLD | NEW |