Tom Hromatka [Mon, 17 May 2021 14:22:48 +0000 (14:22 +0000)]
ftests: Add a cgexec test
Add a basic cgexec test
-----------------------------------------------------------------
Test Results:
Run Date: May 03 19:56:02
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 11.87
034-cgexec-basic_cgexec.py 2.55
teardown 0.00
---------------------------------------------------------
Total Run Time 14.42
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tomasz Kłoczko [Wed, 12 May 2021 20:35:40 +0000 (20:35 +0000)]
automake: replace INCLUDES by CPPFLAGS
automake shows warnings like below:
src/Makefile.am:16: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/Makefile.am: installing 'build-aux/depcomp'
src/bindings/Makefile.am:2: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/daemon/Makefile.am:3: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/pam/Makefile.am:1: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/tools/Makefile.am:3: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
Signed-off-by: Tomasz Kłoczko <kloczek@github.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 5 May 2021 15:19:17 +0000 (11:19 -0400)]
ftests.py: Allow for skipping of multiple tests
In anticipation of some tests not running nicely on some
distros, make the ftests.py --skip/-S option smarter so that
it can accept a single test or multiple tests separated by a
comma.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 17:21:27 +0000 (17:21 +0000)]
gunit: Fix an snprintf() truncation warning
Fix the following snprintf() string truncation warning:
013-cgroup_build_tasks_procs_path.cpp:65:22: warning: ‘%s’ directive output may be truncated writing up
to 820799 bytes into a region of size 4081 [-Wformat-truncation=]
65 | "/sys/fs/cgroup/%s", cg_mount_table[i].name);
| ^~
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/9/cstdio:42,
from /usr/include/c++/9/ext/string_conversions.h:43,
from /usr/include/c++/9/bits/basic_string.h:6493,
from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from ../../googletest/googletest/include/gtest/gtest.h:55,
from 013-cgroup_build_tasks_procs_path.cpp:22:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 16 an
d 820815 bytes into a destination of size 4096
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 17:19:40 +0000 (17:19 +0000)]
gunit: Fix an snprintf() truncation warning
Fix the following snprintf() string truncation warning:
001-path.cpp: In member function ‘virtual void BuildPathV1Test::SetUp()’:
001-path.cpp:70:22: warning: ‘%s’ directive output may be truncated writing up to 820799 bytes into a re
gion of size 4081 [-Wformat-truncation=]
70 | "/sys/fs/cgroup/%s", cg_mount_table[i].name);
| ^~
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/9/cstdio:42,
from /usr/include/c++/9/ext/string_conversions.h:43,
from /usr/include/c++/9/bits/basic_string.h:6493,
from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from ../../googletest/googletest/include/gtest/gtest.h:55,
from 001-path.cpp:22:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 16 an
d 820815 bytes into a destination of size 4096
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 17:08:38 +0000 (17:08 +0000)]
lscgroup: Fix strncpy() truncation warning
Fix the following strncpy() string truncation warning:
In function ‘strncat’,
inlined from ‘print_cgroup’ at lscgroup.c:149:4:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: warning: ‘__builtin___strncat_chk’ output
may be truncated copying between 0 and 4095 bytes from a string of length 4095 [-Wstringop-truncation]
136 | return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 17:04:21 +0000 (17:04 +0000)]
lssubsys: Fix strncpy() truncation warning
Fix the following strncpy() string truncation warning:
In function ‘strncpy’,
inlined from ‘print_all_controllers_in_hierarchy’ at lssubsys.c:131:4,
inlined from ‘cgroup_list_all_controllers’ at lssubsys.c:225:9,
inlined from ‘main’ at lssubsys.c:293:8:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output may be truncated copying 4095 bytes from a string of length 4095 [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 17:03:18 +0000 (17:03 +0000)]
lssubsys: Fix strncpy() truncation warning
Fix the following strncpy() string truncation warning:
In function ‘strncpy’,
inlined from ‘print_all_controllers_in_hierarchy’ at lssubsys.c:127:4,
inlined from ‘cgroup_list_all_controllers’ at lssubsys.c:223:9,
inlined from ‘main’ at lssubsys.c:291:8:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output may be truncated copying 4095 bytes from a string of length 4095 [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 16:58:12 +0000 (16:58 +0000)]
lssubsys: Fix strncpy() truncation warning
Fix the following strncpy() string truncation warning:
In function ‘strncat’,
inlined from ‘print_all_controllers_in_hierarchy’ at lssubsys.c:134:4,
inlined from ‘cgroup_list_all_controllers’ at lssubsys.c:222:9,
inlined from ‘main’ at lssubsys.c:290:8:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: warning: ‘__builtin___strncat_chk’ output may be truncated copying 4095 bytes from a string of length 4095 [-Wstringop-truncation]
136 | return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 16:53:44 +0000 (16:53 +0000)]
cgget: Fix strncpy() truncation warning
Fix the following strncpy() string truncation warning:
In function ‘strncat’,
inlined from ‘fill_empty_controller’ at cgget.c:584:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: warning: ‘__builtin___strncat_chk’ output may be truncated copying between 0 and 4095 bytes from a string of length 4095 [-Wstringop-truncation]
136 | return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 16:48:33 +0000 (16:48 +0000)]
config.c: Fix strncpy() truncation warning
Fix the following strncpy() string truncation warning:
In function ‘strncpy’,
inlined from ‘cgroup_config_create_template_group’ at config.c:1850:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output may be truncated copying 4095 bytes from a string of length 4095 [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 16:46:24 +0000 (16:46 +0000)]
config.c: Fix strncpy() truncation warning
Fix the following strncpy() string truncation warning:
In function ‘strncpy’,
inlined from ‘cgroup_config_create_template_group’ at config.c:1844:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output may be truncated copying 4095 bytes from a string of length 4095 [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 16:42:41 +0000 (16:42 +0000)]
config.c: Fix strncpy() truncation warning
Fix the following strncpy() string truncation warning:
In function ‘strncpy’,
inlined from ‘cgroup_config_create_template_group’ at config.c:1841:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output may be truncated copying 4095 bytes from a string of length 4095 [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 16:40:39 +0000 (16:40 +0000)]
api.c: Fix strncpy() truncation warning
Fix the following strncpy() string truncation warning:
In function ‘strncat’,
inlined from ‘cgroup_get_cgroup’ at api.c:3153:3:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: warning: ‘__builtin___strncat_chk’ output may be truncated copying between 0 and 4095 bytes from a string of length 4095 [-Wstringop-truncation]
136 | return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 16:35:46 +0000 (16:35 +0000)]
api.c: Fix strncpy() truncation warning
Fix the following strncpy() string truncation warning:
In function ‘strncpy’,
inlined from ‘cgroup_parse_rules_file’ at api.c:814:3:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output may be truncated copying 4095 bytes from a string of length 4095 [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 16:32:10 +0000 (16:32 +0000)]
api.c: Fix strncpy() truncation warning
Fix the following strncpy() string truncation warning:
In function ‘strncpy’,
inlined from ‘cgroup_parse_rules_file’ at api.c:798:3:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin___strncpy_chk’ output may be truncated copying between 0 and 255 bytes from a string of length 255 [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 27 Apr 2021 16:30:21 +0000 (16:30 +0000)]
api.c: Fix strncpy() truncation warning
Fix the following strncpy() string truncation warning:
In function ‘strncpy’,
inlined from ‘cgroup_parse_rules_file’ at api.c:676:3:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin___strncpy_chk’ output may be truncated copying between 0 and 255 bytes from a string of length 4352 [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 14 Apr 2021 17:06:25 +0000 (11:06 -0600)]
ftests: Add cgget test with no flags
Add a cgget test that exercises the following format:
cgget CgroupName
-----------------------------------------------------------------
Test Results:
Run Date: Apr 14 10:57:44
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 0.00
033-cgget-no_flags.py 0.11
teardown 0.00
---------------------------------------------------------
Total Run Time 0.11
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Mon, 12 Apr 2021 15:25:00 +0000 (09:25 -0600)]
wrapper.c: Fix fprintf argument warning
Fix a warning in cgroup_add_value_string() where '%d' was
being passed to fprintf when it should have been using '%ld'.
wrapper.c: In function ‘cgroup_add_value_string’:
wrapper.c:207:51: warning: format ‘%d’ expects argument of type ‘int’,
but argument 3 has type ‘long unsigned int’ [-Wformat=]
207 | fprintf(stderr, "value exceeds the maximum of %d
characters\n",
| ~^
| |
| int
| %ld
208 | sizeof(cntl_value->value) - 1);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| long unsigned int
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Mon, 12 Apr 2021 15:18:56 +0000 (09:18 -0600)]
api.c: Fix string truncation warnings
Fix two snprintf string truncation warnings in
cg_build_path_locked().
api.c:1475:38: warning: ‘snprintf’ output may be truncated before the
last format character [-Wformat-truncation=]
1475 | snprintf(path, FILENAME_MAX, "%s/",
| ^
api.c:1475:5: note: ‘snprintf’ output between 2 and 4097 bytes into a
destination of size 4096
1475 | snprintf(path, FILENAME_MAX, "%s/",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1476 | cg_mount_table[i].mount.path);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
api.c:1470:40: warning: ‘/’ directive output may be truncated writing 1
byte into a region of size between 0 and 4095 [-Wformat-truncation=]
1470 | snprintf(path, FILENAME_MAX, "%s/%s/",
| ^
api.c:1470:5: note: ‘snprintf’ output 3 or more bytes (assuming 4098)
into a destination of size 4096
1470 | snprintf(path, FILENAME_MAX, "%s/%s/",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1471 | cg_mount_table[i].mount.path,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1472 | cg_namespace_table[i]);
| ~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Thu, 25 Mar 2021 16:35:32 +0000 (16:35 +0000)]
ftests: Add an lscgroup test with multiple '-g' flags
Add an lscgroup test with multiple '-g' flags.
-----------------------------------------------------------------
Test Results:
Run Date: Mar 25 16:35:47
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 14.12
032-lscgroup-multiple_g_flags.py 4.63
teardown 0.00
---------------------------------------------------------
Total Run Time 18.75
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Thu, 25 Mar 2021 16:34:47 +0000 (16:34 +0000)]
ftests: Add an lscgroup test with a single '-g' flag
Add a test that invokes lscgroup with a single '-g' flag.
-----------------------------------------------------------------
Test Results:
Run Date: Mar 25 16:34:25
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 18.41
031-lscgroup-g_flag.py 0.58
teardown 0.00
---------------------------------------------------------
Total Run Time 18.98
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 24 Mar 2021 19:12:44 +0000 (19:12 +0000)]
ftests: Add an lssubsys -a functional test
Add a functional test that exercises 'lssubsys -a'
-----------------------------------------------------------------
Test Results:
Run Date: Mar 24 19:12:33
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 20.06
030-lssubsys-lssubsys_all.py 0.18
teardown 0.00
---------------------------------------------------------
Total Run Time 20.23
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 24 Mar 2021 19:43:42 +0000 (19:43 +0000)]
cgroup.py: Add method to parse /proc/mounts for cgroup mounts
Add a method - Cgroup.get_cgroup_mounts() - that can parse
/proc/mounts and return a list of CgroupMount instances.
This method will be useful for validating results from lssubsys.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 31 Mar 2021 16:58:48 +0000 (16:58 +0000)]
gtest: Add unit test for cgset's parse_r_flag()
Add a unit test for parse_r_flag() in cgset.c.
[----------] 1 test from CgsetParseRFlagTest
[ RUN ] CgsetParseRFlagTest.EqualCharInValue
[ OK ] CgsetParseRFlagTest.EqualCharInValue (0 ms)
[----------] 1 test from CgsetParseRFlagTest (0 ms total)
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 31 Mar 2021 16:44:11 +0000 (16:44 +0000)]
tools: Create a cgset library for testing purposes
Create libcgset.la so that functions within cgset can be
unit tested.
A functional test would be preferable in this case, but I'm
looking to test a very specific scenario - where there's an
'=' sign in the value of a setting's name/value pair. To the
best of my knowledge, only the rdma (v1) and io (v2)
controllers have settings that utilize an '=' in such a fashion.
I can't think of an easy way to test rdma across our test fleet,
and our automated systems don't support the v2 io controller
yet. Thus a unit test for now.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 30 Mar 2021 18:54:06 +0000 (18:54 +0000)]
cgset: Fix parsing of name/values with an '=' in the value
Fix parsing of name/value pairs that contain an '='
character in the value string. For example, the io.max
setting utilizes the '=' character:
cgset -r io.max="8:16 wbps=1024" foo
Fixes: https://github.com/libcgroup/libcgroup/issues/33 Reported-by: Santiago Ruano Rincón <santiago.ruano-rincon@imt-atlantique.fr> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Mon, 29 Mar 2021 16:46:52 +0000 (16:46 +0000)]
bootstrap: github: Ignore systemd hierarchy
Ignore the "name=systemd" hierarchy by setting the autoconf
--enable-opaque-hierarchy flag equal to "name=systemd". This
instructs libcgroup to ignore mounts named "name=systemd" and
thus these mounts aren't added to the cg_mount_table[].
Suggested-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Mon, 29 Mar 2021 17:54:09 +0000 (17:54 +0000)]
gunit: Ignore systemd hierarchies in test 007
Now that systemd hierarchies are being ignored via the
OPAQUE_HIERARCHY setting, update unit test 007 to ensure
that systemd hierachies are not added to the mount table.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 23 Mar 2021 16:12:13 +0000 (16:12 +0000)]
ftests: Add a simple cgclear functional test
Add a test that invokes cgclear. Note that this test is especially
destructive and is skipped by default. Github Actions invokes it
separately as the final step.
-----------------------------------------------------------------
Test Results:
Run Date: Mar 23 16:07:55
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 0.00
028-cgclear-basic_cgclear.py 1.80
teardown 0.00
---------------------------------------------------------
Total Run Time 1.80
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 10 Mar 2021 18:51:45 +0000 (18:51 +0000)]
ftests: Add cgset invalid options test
Add a test that tests various invalid flag combinations to cgset.
-----------------------------------------------------------------
Test Results:
Run Date: Mar 08 17:39:20
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 18.15
027-cgset-invalid_options.py 0.94
teardown 0.00
---------------------------------------------------------
Total Run Time 19.09
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 10 Mar 2021 18:48:04 +0000 (18:48 +0000)]
ftests: Add a cgset test with multiple '-r' flags and cgroups
Add a cgset test that provides multiple '-r' flags to multiple
cgroups.
-----------------------------------------------------------------
Test Results:
Run Date: Mar 08 19:30:43
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 15.33
026-cgset-multiple_r_multiple_cgroup.py 5.14
teardown 0.00
---------------------------------------------------------
Total Run Time 20.47
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 10 Mar 2021 18:47:03 +0000 (18:47 +0000)]
ftests: Add multiple cgroup cgset set
Add a test that passes in multiple cgroups to cgset.
-----------------------------------------------------------------
Test Results:
Run Date: Mar 08 19:14:20
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 19.85
025-cgset-multiple_cgroups.py 0.85
teardown 0.00
---------------------------------------------------------
Total Run Time 20.69
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 10 Mar 2021 17:36:28 +0000 (17:36 +0000)]
ftests: Add cgset --copy-from test
Add a test that utilizes the cgset --copy-from flag.
-----------------------------------------------------------------
Test Results:
Run Date: Mar 02 20:24:45
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 22.79
023-cgset-copy_from.py 1.13
teardown 0.00
---------------------------------------------------------
Total Run Time 23.93
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 10 Mar 2021 17:32:18 +0000 (17:32 +0000)]
ftests: Add multiple -r flag cgset test
Add a test that provides multiple -r flags to cgset
-----------------------------------------------------------------
Test Results:
Run Date: Mar 02 19:04:36
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 14.53
022-cgset-multiple_r_flag.py 0.72
teardown 0.00
---------------------------------------------------------
Total Run Time 15.25
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 10 Mar 2021 17:16:30 +0000 (17:16 +0000)]
cgroup.py: Allow for multiple cgroup names to be passed to cgset
Add support for multiple cgroup names - or no cgroup names -
to be passed into Cgroup.set(). cgset allows multiple cgroup
names to be supplied with either the '-r' flag or the '--copy-from'
option. No cgroup needs to be provided when '-h' is invoked.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 10 Mar 2021 18:21:25 +0000 (18:21 +0000)]
gunit: Update test 009 to match cgroup_set_values_recursive()
cgroup_set_values_recursive() had a parameter added to ignore
the dirty flag on write failures. This is needed by
cgroup_modify_cgroup() as some writes may be expected to fail.
Update test 009 to utilize this new flag. Note that
cgroup_set_values_recursive() is now being heavily tested by
the functional tests, so this unit test is no longer the primary
means of testing this function.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 10 Mar 2021 02:15:51 +0000 (02:15 +0000)]
ftests: Add invalid parameter test for cgconfigparser
Add a test that provides invalid parameters into cgconfigparser.
-----------------------------------------------------------------
Test Results:
Run Date: Mar 10 02:15:56
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 13.46
021-cgconfig-invalid_options.py 0.31
teardown 0.00
---------------------------------------------------------
Total Run Time 13.77
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Wed, 10 Mar 2021 00:18:02 +0000 (00:18 +0000)]
ftests: Add a cgconfigparser test that sets tasks owner/permissions
Add a cgconfigparser test that sets the owner, group, and
permissions on the tasks file. This test runs on cgroup v1
only.
-----------------------------------------------------------------
Test Results:
Run Date: Mar 10 00:18:10
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 14.47
020-cgconfig-tasks_perms_owner.py 7.14
teardown 0.00
---------------------------------------------------------
Total Run Time 21.61
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Tue, 9 Mar 2021 22:30:33 +0000 (22:30 +0000)]
ftests: Add a cgconfigparser owner, fperm, and dperm test
Add a cgconfigparser test that verifies that the owner,
group, file permissions, and directory permissions are
properly set.
-----------------------------------------------------------------
Test Results:
Run Date: Mar 09 22:29:07
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
---------------------------------------------------------
setup 20.58
019-cgconfig-uidgid_dperm_fperm.py 2.51
teardown 0.00
---------------------------------------------------------
Total Run Time 23.10
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>