[CRIU] [PATCH] zdtm: Remove cgroup hierarhy after test cgroup01 is finished

Kirill Tkhai ktkhai at odin.com
Mon Nov 23 09:06:08 PST 2015


On 23.11.2015 19:54, Pavel Emelyanov wrote:
> On 11/23/2015 06:56 PM, Kirill Tkhai wrote:
>> Hierarhy remains even after cgroup is umounted, so it's need
>> to kill it manually.
> 
> The cgroup01.hook is supposed to clean stuff up after test. Does it do it?

Hm, it was a report about this problem and the test was executed without any
stuff around. So, that way is wrong.

Ok, the stuff does do that.
 
>> Signed-off-by: Kirill Tkhai <ktkhai at odin.com>
>> ---
>>  test/zdtm/live/static/cgroup01.c |    9 ++++++++-
>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/test/zdtm/live/static/cgroup01.c b/test/zdtm/live/static/cgroup01.c
>> index 7f964cf..d3c0d87 100644
>> --- a/test/zdtm/live/static/cgroup01.c
>> +++ b/test/zdtm/live/static/cgroup01.c
>> @@ -69,7 +69,7 @@ int main(int argc, char **argv)
>>  	cgf = fopen("/proc/self/mountinfo", "r");
>>  	if (cgf == NULL) {
>>  		fail("No mountinfo file");
>> -		goto out_rs;
>> +		goto out_hier;
>>  	}
>>  
>>  	while (fgets(paux, sizeof(paux), cgf)) {
>> @@ -106,6 +106,13 @@ int main(int argc, char **argv)
>>  
>>  out_close:
>>  	fclose(cgf);
>> +out_hier:
>> +	for (i = 0; i < 2; i++) {
>> +		sprintf(paux, "%s/%s/%s.%d", dirname, subname, empty, i);
>> +		rmdir(paux);
>> +        }
>> +	sprintf(paux, "%s/%s", dirname, subname);
>> +	rmdir(paux);
>>  out_rs:
>>  	umount(dirname);
>>  out_rd:
>>
>> .
>>
> 


More information about the CRIU mailing list