1*49cdfc7eSAndroid Build Coastguard Worker============================================================== 2*49cdfc7eSAndroid Build Coastguard WorkerTest Suite for the Control Group Freezer and Signal Subsystems 3*49cdfc7eSAndroid Build Coastguard Worker============================================================== 4*49cdfc7eSAndroid Build Coastguard WorkerAuthor: Matt Helsley 5*49cdfc7eSAndroid Build Coastguard WorkerDate: June, 2008 6*49cdfc7eSAndroid Build Coastguard WorkerLast update: January 19th, 2009 7*49cdfc7eSAndroid Build Coastguard Worker 8*49cdfc7eSAndroid Build Coastguard WorkerAbout: 9*49cdfc7eSAndroid Build Coastguard Worker------ 10*49cdfc7eSAndroid Build Coastguard WorkerThese tests exercise the freezer and signal subsystems (aka controllers) 11*49cdfc7eSAndroid Build Coastguard Workeravailable since kernel 2.6.28 or later. 12*49cdfc7eSAndroid Build Coastguard Worker 13*49cdfc7eSAndroid Build Coastguard WorkerThese tests exercise the freezer control group controller. This controller is 14*49cdfc7eSAndroid Build Coastguard Workera useful for implementing container checkpointing or if you wish to gradually 15*49cdfc7eSAndroid Build Coastguard Workerfreeze tasks in cgroups before doing a suspend. 16*49cdfc7eSAndroid Build Coastguard Worker 17*49cdfc7eSAndroid Build Coastguard WorkerThe common case is embodied in the freeze_thaw.sh test file. However, 18*49cdfc7eSAndroid Build Coastguard Workerthe scripts are also designed to test a few obscure cases such as: 19*49cdfc7eSAndroid Build Coastguard Worker freeze self -- freeze the control group that the current process is 20*49cdfc7eSAndroid Build Coastguard Worker in 21*49cdfc7eSAndroid Build Coastguard Worker freeze cancellation -- freeze but then backout of the freeze processing 22*49cdfc7eSAndroid Build Coastguard Worker and issue a "thaw" command before reaching the frozen state 23*49cdfc7eSAndroid Build Coastguard Worker signalling freezing/frozen tasks -- this should delay delivery of the 24*49cdfc7eSAndroid Build Coastguard Worker signal until the task is unfrozen 25*49cdfc7eSAndroid Build Coastguard Worker vfork -- The vfork system call introduces an obscure special case for 26*49cdfc7eSAndroid Build Coastguard Worker the freezer kernel code. This test case attempts to trigger any 27*49cdfc7eSAndroid Build Coastguard Worker unanticipated corner cases involving vfork. 28*49cdfc7eSAndroid Build Coastguard Worker 29*49cdfc7eSAndroid Build Coastguard Worker 30*49cdfc7eSAndroid Build Coastguard WorkerNOTES: 31*49cdfc7eSAndroid Build Coastguard Worker 32*49cdfc7eSAndroid Build Coastguard Worker Using the cgroup freezer prevents the tasks from being automatically 33*49cdfc7eSAndroid Build Coastguard Worker woken up upon a "Power Management Resume". You will need to 34*49cdfc7eSAndroid Build Coastguard Worker manually unfreeze cgroups. 35*49cdfc7eSAndroid Build Coastguard Worker 36*49cdfc7eSAndroid Build Coastguard Worker These tests assume that most of the library functions in 37*49cdfc7eSAndroid Build Coastguard Worker libcgroup_subsys take much less than $sample_sleep time to execute. If 38*49cdfc7eSAndroid Build Coastguard Worker this assumption is incorrect then many of these tests may fail in 39*49cdfc7eSAndroid Build Coastguard Worker unusual ways. So make sure $sample_sleep is a "reasonable" amount of 40*49cdfc7eSAndroid Build Coastguard Worker time. 41*49cdfc7eSAndroid Build Coastguard Worker 42*49cdfc7eSAndroid Build Coastguard WorkerBuilding: 43*49cdfc7eSAndroid Build Coastguard Worker--------- 44*49cdfc7eSAndroid Build Coastguard Worker 45*49cdfc7eSAndroid Build Coastguard WorkerRun the command line: 46*49cdfc7eSAndroid Build Coastguard Worker make all 47*49cdfc7eSAndroid Build Coastguard Worker 48*49cdfc7eSAndroid Build Coastguard Worker 49*49cdfc7eSAndroid Build Coastguard WorkerInstalling: 50*49cdfc7eSAndroid Build Coastguard Worker----------- 51*49cdfc7eSAndroid Build Coastguard Worker 52*49cdfc7eSAndroid Build Coastguard WorkerRun the command line: 53*49cdfc7eSAndroid Build Coastguard Worker 54*49cdfc7eSAndroid Build Coastguard Worker 55*49cdfc7eSAndroid Build Coastguard WorkerCleaning: 56*49cdfc7eSAndroid Build Coastguard Worker--------- 57*49cdfc7eSAndroid Build Coastguard Worker 58*49cdfc7eSAndroid Build Coastguard WorkerRun the command line: 59*49cdfc7eSAndroid Build Coastguard Worker 60*49cdfc7eSAndroid Build Coastguard Worker make clean 61*49cdfc7eSAndroid Build Coastguard Worker 62*49cdfc7eSAndroid Build Coastguard Worker 63*49cdfc7eSAndroid Build Coastguard WorkerRunning: 64*49cdfc7eSAndroid Build Coastguard Worker-------- 65*49cdfc7eSAndroid Build Coastguard Worker 66*49cdfc7eSAndroid Build Coastguard WorkerRun the command line: 67*49cdfc7eSAndroid Build Coastguard Worker 68*49cdfc7eSAndroid Build Coastguard Worker ./run.sh 69*49cdfc7eSAndroid Build Coastguard Worker 70*49cdfc7eSAndroid Build Coastguard WorkerResults: 71*49cdfc7eSAndroid Build Coastguard Worker-------- 72*49cdfc7eSAndroid Build Coastguard Worker 73*49cdfc7eSAndroid Build Coastguard WorkerThe results should show up as PASS/FAIL in the LTP logs for each script. The 74*49cdfc7eSAndroid Build Coastguard Workeroutput frequently will be more specific (beyond which test script failed) 75*49cdfc7eSAndroid Build Coastguard Workerabout where and what failure occurred. 76*49cdfc7eSAndroid Build Coastguard Worker 77