tests.cgroup: Add TestFreezer
This subtest tests the 'freezer.state' cgroup functionality. It assignes the virtual machine into freezer cgroup, schedule cpu-intensive work and verifies the correct function in both states (frozen/thawed) during long and short period of time.
* Adds TestFreezer (freezer) test
* Adds assign_vm_into_cgroup() function
* Code cleanup
Please see the pull request for updates:
https://github.com/autotest/autotest/pull/55
PATCH 1/1 tests.cgroup: Add TestFreezer
This subtest tests the 'freezer.state' cgroup functionality. It assignes the virtual machine into freezer cgroup, schedule cpu-intensive work and verifies the correct function in both states (frozen/thawed) during long and short period of time.
* Adds TestFreezer (freezer) test
* Adds assign_vm_into_cgroup() function
* Code cleanup
--- client/tests/cgroup/cgroup_common.py | 16 +--- client/tests/kvm/tests/cgroup.py | 159 +++++++++++++++++++++++++++++++--- 2 files changed, 146 insertions(+), 29 deletions(-)
client/tests/cgroup/cgroup_common.py +1 -15
@@ -6,25 +6,11 @@ Helpers for cgroup testing. @copyright: 2011 Red Hat Inc. @author: Lukas Doktor <[email protected]> """ -import logging, os, shutil, subprocess, time, traceback +import logging, os, shutil, subprocess, time from tempfile import mkdtemp from autotest_lib.client.bin import utils from autotest_lib.client.common_lib import error -def _traceback(name, exc_info): - """ - Formats traceback into lines "name: line\nname: line" - @param name: desired line preposition - @param exc_info: sys.exc_info of the exception - @return: string which contains beautifully formatted exception - """ - out = "\n" - for line in traceback.format_exception(exc_info[0], exc_info[1], - exc_info[2]): - out += "%s: %s" % (name, line) - return out - - class Cgroup(object): """ Cgroup handling class.
client/tests/kvm/tests/cgroup.py +145 -14
205 lines not on this page · raw message
Signature · 1 line
1.7.6.4