]> git.ipfire.org Git - thirdparty/libcgroup.git/log
thirdparty/libcgroup.git
3 years agogithub: Move Doxygen Folder
Tom Hromatka [Fri, 17 Dec 2021 22:30:07 +0000 (15:30 -0700)] 
github: Move Doxygen Folder

After Doxygen is built, move the html folder under doc/.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoMerge pull request #79 from drakenclimber/issues/doxygen
Tom Hromatka [Fri, 17 Dec 2021 22:19:25 +0000 (15:19 -0700)] 
Merge pull request #79 from drakenclimber/issues/doxygen

github: Add Doxyfile and github doxygen action

3 years agogithub: Add Doxyfile and github doxygen action 79/head
Tom Hromatka [Tue, 14 Dec 2021 21:50:33 +0000 (14:50 -0700)] 
github: Add Doxyfile and github doxygen action

Add a default Doxyfile and a doxygen action.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
3 years agoInitialize cgroup version for named V1 hierarchy
Ingo van Lil [Thu, 16 Dec 2021 20:32:23 +0000 (13:32 -0700)] 
Initialize cgroup version for named V1 hierarchy

Commit 3aac9889 added the 'version' field in cg_mount_table_s and
initializes it in cgroup_process_v1_mnt(). The same initialization is
required in a second place dealing with named hierarchies.

Signed-off-by: Ingo van Lil <inguin@gmx.de>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoMerge pull request #27 from drakenclimber/issues/73
Tom Hromatka [Tue, 14 Dec 2021 21:39:27 +0000 (14:39 -0700)] 
Merge pull request #27 from drakenclimber/issues/73

ftests: Add a test to get/set cgroup.type

3 years agoMerge pull request #74 from drakenclimber/issues/73
Tom Hromatka [Tue, 14 Dec 2021 21:13:07 +0000 (14:13 -0700)] 
Merge pull request #74 from drakenclimber/issues/73

api.c: Allow reading/writing from cgroup.* files in cgroup v2

3 years agoapi.c: Allow reading/writing from cgroup.* files in cgroup v2 74/head
Tom Hromatka [Mon, 6 Dec 2021 21:53:01 +0000 (14:53 -0700)] 
api.c: Allow reading/writing from cgroup.* files in cgroup v2

Allow reading/writing from cgroup.* files (such as cgroup.type
and cgroup.procs) on cgroup v2 filesystems.

Closes: https://github.com/libcgroup/libcgroup/issues/73
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
3 years agoMerge pull request #76 from drakenclimber/issues/71
Tom Hromatka [Tue, 7 Dec 2021 17:21:59 +0000 (10:21 -0700)] 
Merge pull request #76 from drakenclimber/issues/71

github: Force a fresh clone on all self-hosted runners

3 years agogithub: Force a fresh clone on all self-hosted runners 76/head
Tom Hromatka [Tue, 7 Dec 2021 16:36:51 +0000 (09:36 -0700)] 
github: Force a fresh clone on all self-hosted runners

The cgroup v2 job is being run on a self-hosted runner that
re-uses the workspace.  Delete the local workspace on all
self-hosted runners prior to cloning the repo.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoMerge pull request #75 from drakenclimber/issues/71v2
Tom Hromatka [Tue, 7 Dec 2021 16:31:31 +0000 (09:31 -0700)] 
Merge pull request #75 from drakenclimber/issues/71v2

tests: Update submodule to the latest commit on libcgroup-tests main

3 years agotests: Update submodule to the latest commit on libcgroup-tests main branch 75/head
Tom Hromatka [Tue, 7 Dec 2021 16:14:26 +0000 (09:14 -0700)] 
tests: Update submodule to the latest commit on libcgroup-tests main branch

Closes: https://github.com/libcgroup/libcgroup/issues/71
Reported-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoftests: Add a test to get/set cgroup.type
Tom Hromatka [Mon, 6 Dec 2021 21:55:17 +0000 (14:55 -0700)] 
ftests: Add a test to get/set cgroup.type

Add a functional test that can get/set cgroup.type on a
cgroup v2 filesystem.

-----------------------------------------------------------------
Test Results:
        Run Date:                          Dec 06 14:40:46
        Passed:                                  1 test(s)
        Skipped:                                 0 test(s)
        Failed:                                  0 test(s)
-----------------------------------------------------------------
Timing Results:
        Test                             Time (sec)
        -------------------------------------------
        setup                                  0.00
        035-cgset-set_cgroup_type.py           2.30
        teardown                               0.00
        -------------------------------------------
        Total Run Time                         2.30

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoautomake: idiomatically mark test libraries as convenience libraries
Ross Burton [Thu, 2 Dec 2021 10:51:28 +0000 (10:51 +0000)] 
automake: idiomatically mark test libraries as convenience libraries

Instead of installing then deleting, mark the libraries which are only
used at build time and should not be installed as noinst, so they don't
get installed at all.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoautomake: Don't install testing libraries
Tom Hromatka [Fri, 12 Nov 2021 13:55:20 +0000 (06:55 -0700)] 
automake: Don't install testing libraries

libcgset and libcgfortesting are libraries that are used by the
unit test framework and are not intended to be installed when
`make install` is invoked.  Delete them from the install path.

Closes: https://github.com/libcgroup/libcgroup/issues/62
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoautomake: Link libcgset with libcgroup
Tom Hromatka [Fri, 12 Nov 2021 13:51:36 +0000 (06:51 -0700)] 
automake: Link libcgset with libcgroup

When linking with the -Wl,--no-undefined flag enabled, libcgset
fails due to undefined symbols.  Fix this by enabling this flag
and linking with libcgroup.la

Closes: https://github.com/libcgroup/libcgroup/issues/66
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoREADME: fix typos across the file
Kamalesh Babulal [Mon, 1 Nov 2021 20:26:45 +0000 (14:26 -0600)] 
README: fix typos across the file

Fix a couple of typos across the file.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgclassify: fix error message
Kamalesh Babulal [Mon, 1 Nov 2021 20:26:12 +0000 (14:26 -0600)] 
cgclassify: fix error message

Fix the typo in the error message, while trying to parse the cgroup to
place the task.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoftests.py: fix test results timing alignment
Kamalesh Babulal [Thu, 28 Oct 2021 20:25:09 +0000 (14:25 -0600)] 
ftests.py: fix test results timing alignment

The current width length of 35 characters, used as alignment for the
first column in the timing results of ftests.sh.log is not enough and
results in misaligned output. Fix it by assigning the columns format
strings width to the longest filename, calculated just before executing
every testcase. This avoids adjusting the width every time, with newer
testcases. Also, fix the banner separator lines to match the width of
the filename column + 15 (time), dynamically.

without the patch:
```
Timing Results:
        Test                                    Time (sec)
        ---------------------------------------------------------
        setup                                        96.39
        001-cgget-basic_cgget_v1.py                   1.36
        002-cgdelete-recursive_delete.py              4.07
        003-cgget-basic_cgget_v2.py                   0.00
        004-cgsnapshot-basic_snapshot_v1.py           9.41
        005-cgsnapshot-basic_snapshot_v2.py           0.00
        006-cgrules-basic_cgrules_v1.py               0.00
        007-cgrules-basic_cgrules_v2.py               0.00
        008-cgget-multiple_r_flags.py                 1.80
        009-cgget-g_flag_controller_only.py           1.03
        010-cgget-g_flag_controller_and_cgroup.py           1.10
        011-cgget-r_flag_two_cgroups.py               2.34
        012-cgget-multiple_r_flags2.py                3.27
        013-cgget-multiple_g_flags.py                 1.74
        014-cgget-a_flag.py                           1.65
        015-cgget-multiline_r_flag.py                 0.99
        016-cgget-invalid_options.py                  3.30
        017-cgconfig-load_file.py                     1.78
        018-cgconfig-load_dir.py                      2.83
        019-cgconfig-uidgid_dperm_fperm.py            3.40
        020-cgconfig-tasks_perms_owner.py             7.26
        021-cgconfig-invalid_options.py               0.75
        022-cgset-multiple_r_flag.py                  2.21
        023-cgset-copy_from.py                        3.27
        025-cgset-multiple_cgroups.py                 3.14
        026-cgset-multiple_r_multiple_cgroup.py           3.80
        027-cgset-invalid_options.py                  6.42
        029-lssubsys-basic_lssubsys.py                3.60
        030-lssubsys-lssubsys_all.py                  0.72
        031-lscgroup-g_flag.py                        1.81
        032-lscgroup-multiple_g_flags.py              3.20
        033-cgget-no_flags.py                         1.12
        034-cgexec-basic_cgexec.py                    2.49
        teardown                                      0.00
        ---------------------------------------------------------
        Total Run Time                              176.24
PASS ftests.sh (exit status: 0)
```

with the patch:
```
Timing Results:
        Test                                          Time (sec)
        --------------------------------------------------------
        setup                                              95.12
        001-cgget-basic_cgget_v1.py                         1.50
        002-cgdelete-recursive_delete.py                    4.31
        003-cgget-basic_cgget_v2.py                         0.00
        004-cgsnapshot-basic_snapshot_v1.py                 2.68
        005-cgsnapshot-basic_snapshot_v2.py                 0.00
        006-cgrules-basic_cgrules_v1.py                     0.00
        007-cgrules-basic_cgrules_v2.py                     0.00
        008-cgget-multiple_r_flags.py                       1.89
        009-cgget-g_flag_controller_only.py                 1.30
        010-cgget-g_flag_controller_and_cgroup.py           1.20
        011-cgget-r_flag_two_cgroups.py                     6.31
        012-cgget-multiple_r_flags2.py                      3.49
        013-cgget-multiple_g_flags.py                       1.82
        014-cgget-a_flag.py                                 2.36
        015-cgget-multiline_r_flag.py                       1.07
        016-cgget-invalid_options.py                        3.45
        017-cgconfig-load_file.py                           2.58
        018-cgconfig-load_dir.py                            3.08
        019-cgconfig-uidgid_dperm_fperm.py                  3.88
        020-cgconfig-tasks_perms_owner.py                  10.46
        021-cgconfig-invalid_options.py                     0.78
        022-cgset-multiple_r_flag.py                        2.33
        023-cgset-copy_from.py                              3.50
        025-cgset-multiple_cgroups.py                       3.90
        026-cgset-multiple_r_multiple_cgroup.py             4.75
        027-cgset-invalid_options.py                        8.52
        029-lssubsys-basic_lssubsys.py                      1.68
        030-lssubsys-lssubsys_all.py                        0.81
        031-lscgroup-g_flag.py                              2.10
        032-lscgroup-multiple_g_flags.py                    3.49
        033-cgget-no_flags.py                               1.28
        034-cgexec-basic_cgexec.py                          3.21
        teardown                                            0.00
        --------------------------------------------------------
        Total Run Time                                    182.86
PASS ftests.sh (exit status: 0)
```

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoftests: testcase 013 - remove debug statements
Kamalesh Babulal [Thu, 21 Oct 2021 21:28:45 +0000 (15:28 -0600)] 
ftests: testcase 013 - remove debug statements

Remove the debugging statements that print the return values
(result, cause) from testcase 013-cgget-multiple_g_flags.py.
These values show up in ftests.sh.log, otherwise, and might
lead to confusion on how to interpret them.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agogithub: re-arrange workflow run commands
Kamalesh Babulal [Thu, 21 Oct 2021 21:18:28 +0000 (15:18 -0600)] 
github: re-arrange workflow run commands

The current workflow executes the functional tests from the make check
called at the top-level source directory. Though this runs the tests
case, it also has an unintended side effect of re-running gunit tests
for every functional test combination in the workflow. Fix it, by
re-arranging the function test run commands, to change into
tests/ftests directory before executing make check.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoconfigure.ac: check for the library containing fts_open
Ross Burton [Fri, 10 Sep 2021 17:24:47 +0000 (11:24 -0600)] 
configure.ac: check for the library containing fts_open

The musl C library doesn't provide fts.h[1], so libcgroup doesn't
compile with musl. However, there is a standalone implementation of fts
for musl users[2] which can be used.

Use AC_SEARCH_LIBS to search for fts_open, which will check if it is part
of libc, and if not look in libfts, then set LIBS if needed.

[1] https://wiki.musl-libc.org/faq.html
[2] https://github.com/void-linux/musl-fts

Closes #61.

Signed-off-by: Ross Burton <ross.burton@arm.com>
[TJH: minor formatting changes to match existing configure.ac]
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #59 from drakenclimber/issues/mainbadge
Tom Hromatka [Wed, 21 Jul 2021 15:50:41 +0000 (09:50 -0600)] 
Merge pull request #59 from drakenclimber/issues/mainbadge

README.md: Display status of main branch in build status badge

4 years agoREADME.md: Display status of main branch in build status badge 59/head
Tom Hromatka [Wed, 21 Jul 2021 15:40:45 +0000 (09:40 -0600)] 
README.md: Display status of main branch in build status badge

The master branch was renamed to main, but the build status
badge wasn't updated as part of this change.  Display the
build status of the main branch in README.md

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #57 from drakenclimber/issues/fixmerge
Tom Hromatka [Tue, 6 Jul 2021 20:47:45 +0000 (14:47 -0600)] 
Merge pull request #57 from drakenclimber/issues/fixmerge

github: Fix merge collision in v1/v2 code coverage

4 years agogithub: Fix merge collision in v1/v2 code coverage 57/head
Tom Hromatka [Tue, 6 Jul 2021 20:37:23 +0000 (14:37 -0600)] 
github: Fix merge collision in v1/v2 code coverage

Fix merge collision in the gathering of the v1/v2
code coverage metrics.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #56 from drakenclimber/issues/improvecodecov
Tom Hromatka [Tue, 6 Jul 2021 20:08:13 +0000 (14:08 -0600)] 
Merge pull request #56 from drakenclimber/issues/improvecodecov

github: Improve code coverage collection

4 years agogithub: Improve code coverage collection 56/head
Tom Hromatka [Tue, 6 Jul 2021 19:26:34 +0000 (13:26 -0600)] 
github: Improve code coverage collection

Improve code coverage collection by utilizing the "-i" flag
prior to the run.  This allows coverage on #ifdef'ed code.

Also, archive the code coverage files for later analysis if
desired.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #54 from drakenclimber/issues/removetestsdir
Tom Hromatka [Tue, 6 Jul 2021 15:45:37 +0000 (09:45 -0600)] 
Merge pull request #54 from drakenclimber/issues/removetestsdir

github: Delete the tests folder before bootstrap

4 years agogithub: Delete the tests folder before bootstrap 54/head
Tom Hromatka [Tue, 6 Jul 2021 15:16:09 +0000 (09:16 -0600)] 
github: Delete the tests folder before bootstrap

On self-hosted github machines, the working directory for
libcgroup is reused from one run to the next.  This is fine
for the root of the directory as the proper git clean/reset
commands are issues.  But this is problematic for the git
submodules like the tests/ folder because clean/reset is nott
run there.

Remove the tests/ directory entirely and rely on ./bootstrap.sh
to recreate and populate it.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #53 from drakenclimber/pull/45
Tom Hromatka [Tue, 6 Jul 2021 15:13:17 +0000 (09:13 -0600)] 
Merge pull request #53 from drakenclimber/pull/45

Replace __BEGIN_DECLS and __END_DECLS with extern "C".

4 years agoReplace __BEGIN_DECLS and __END_DECLS with extern "C". 53/head
Anthony G. Basile [Tue, 6 Jul 2021 13:54:47 +0000 (07:54 -0600)] 
Replace __BEGIN_DECLS and __END_DECLS with extern "C".

The macros __BEGIN_DECLS and __END_DECLS are a GNU-ism found in
glibc and uClibc, but not musl.  We replace them by the more general
extern "C" { ... } block exposed only if we have __cplusplus.

Forward ported from a patch by Anthony G. Basile <blueness@gentoo.org>.

Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #52 from drakenclimber/issues/cgv2-tests
Tom Hromatka [Mon, 21 Jun 2021 21:38:48 +0000 (15:38 -0600)] 
Merge pull request #52 from drakenclimber/issues/cgv2-tests

github: Add self-hosted runner

4 years agogithub: Add self-hosted runner 52/head
Tom Hromatka [Wed, 2 Jun 2021 21:07:29 +0000 (21:07 +0000)] 
github: Add self-hosted runner

Add a self-hosted runner to test full v2 functionality

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #24 from drakenclimber/issues/cgv2-tests
Tom Hromatka [Mon, 21 Jun 2021 20:55:11 +0000 (14:55 -0600)] 
Merge pull request #24 from drakenclimber/issues/cgv2-tests

Add support for full cgroup v2 systems

4 years agoMerge pull request #51 from drakenclimber/issues/contributing
Tom Hromatka [Wed, 9 Jun 2021 17:17:26 +0000 (11:17 -0600)] 
Merge pull request #51 from drakenclimber/issues/contributing

docs: Add CONTRIBUTING.md

4 years agodocs: Add CONTRIBUTING.md 51/head
Tom Hromatka [Mon, 24 May 2021 14:55:16 +0000 (08:55 -0600)] 
docs: Add CONTRIBUTING.md

Add a document that outlines the steps to contribute to
libcgroup.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Skip test 032 due to Github Issue #50
Tom Hromatka [Wed, 2 Jun 2021 19:46:48 +0000 (19:46 +0000)] 
ftests: Skip test 032 due to Github Issue #50

On full cgroup v2 systems, skip 032-lscgroup-multiple_g_flags.py
due to Github Issue #50.  Currently lscgroup is doing path matching
on the mounts that have the same path as the cgroup rather than
reading cgroup.controllers for that particular cgroup.  I'm afraid
fixing it could involve a non-trivial rewrite of lscgroup since it
doesn't use any of the common structures used elsewhere in libcgroup.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Skip test 031 due to Github Issue #50
Tom Hromatka [Wed, 2 Jun 2021 20:37:21 +0000 (20:37 +0000)] 
ftests: Skip test 031 due to Github Issue #50

On full cgroup v2 systems, skip 031-lscgroup-g_flag.py
due to Github Issue #50.  Currently lscgroup is doing path matching
on the mounts that have the same path as the cgroup rather than
reading cgroup.controllers for that particular cgroup.  I'm afraid
fixing it could involve a non-trivial rewrite of lscgroup since it
doesn't use any of the common structures used elsewhere in libcgroup.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Modify functional test 030 to support cgroup v2
Tom Hromatka [Wed, 2 Jun 2021 20:11:01 +0000 (20:11 +0000)] 
ftests: Modify functional test 030 to support cgroup v2

Add cgroup v2 support to the 030-lssubsys-lssubsys_all.py
functional test.  It continues to support cgroup v1 as well.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Modify functional test 014 to support cgroup v2
Tom Hromatka [Wed, 2 Jun 2021 13:34:33 +0000 (13:34 +0000)] 
ftests: Modify functional test 014 to support cgroup v2

Add support for a full cgroup v2 system to the 014-cgget-a_flag.py
functional test.  It continues to support cgroup v1 as well.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Modify functional test 013 to support cgroup v2
Tom Hromatka [Wed, 2 Jun 2021 20:38:42 +0000 (20:38 +0000)] 
ftests: Modify functional test 013 to support cgroup v2

Add cgroup v2 support to the 013-cgget-multiple_g_flags.py
functional test.  It continues to support cgroup v1 as well.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agocgroup.py: Fix bug in delete with multiple controllers
Tom Hromatka [Wed, 2 Jun 2021 13:33:14 +0000 (13:33 +0000)] 
cgroup.py: Fix bug in delete with multiple controllers

When multiple controllers are passed into Cgroup.delete()
via a list, delete() was erroneously joining them without
a comma separator.  Add the comma separator.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Modify functional test 012 to support cgroup v2
Tom Hromatka [Wed, 2 Jun 2021 13:48:51 +0000 (13:48 +0000)] 
ftests: Modify functional test 012 to support cgroup v2

Add cgroup v2 support to the 012-cgget-multiple_r_flags2.py
functional test.  It continues to support cgroup v1 as well.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Modify functional test 011 to support cgroup v2
Tom Hromatka [Wed, 2 Jun 2021 14:33:06 +0000 (14:33 +0000)] 
ftests: Modify functional test 011 to support cgroup v2

Add cgroup v2 support to the 011-cgget-r_flag_two_cgroups.py
functional test.  It continues to support cgroup v1 as well.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Modify functional test 010 to support cgroup v2
Tom Hromatka [Wed, 2 Jun 2021 13:10:02 +0000 (13:10 +0000)] 
ftests: Modify functional test 010 to support cgroup v2

Add cgroup v2 support to the 010-cgget-g_flag_controller_and_cgroup.py
functional test.  It continues to support cgroup v1 as well.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Modify functional test 009 to support cgroup v2
Tom Hromatka [Wed, 2 Jun 2021 19:58:24 +0000 (19:58 +0000)] 
ftests: Modify functional test 009 to support cgroup v2

Add cgroup v2 support to the 009-cgget-g_flag_controller_only.py
functional test.  It continues to support cgroup v1 as well.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Modify functional test 008 to support cgroup v2
Tom Hromatka [Tue, 1 Jun 2021 22:10:12 +0000 (22:10 +0000)] 
ftests: Modify functional test 008 to support cgroup v2

Add cgroup v2 support to the 008-cgget-multiple_r_flags.py
functional test.  It continues to support cgroup v1 as well.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Modify functional test 005 to support cgroup v2
Tom Hromatka [Wed, 2 Jun 2021 13:58:53 +0000 (13:58 +0000)] 
ftests: Modify functional test 005 to support cgroup v2

Add support for a full cgroup v2 system to the
005-cgsnapshot-basic_snapshot_v2.py functional test. It
continues to support cgroup v1 systems and mixed systems
as well.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agorun.py: Ignore LXD cgroup v2 warning
Tom Hromatka [Tue, 1 Jun 2021 22:08:13 +0000 (22:08 +0000)] 
run.py: Ignore LXD cgroup v2 warning

On full cgroup v2 systems, LXD raises the following warning:
WARNING: cgroup v2 is not fully supported yet

Add logic to run.py to ignore this warning.  A non-zero return
code or other strings in stderr should still cause a RunError
exception to be raised.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #49 from drakenclimber/issues/delete-cgclear
Tom Hromatka [Tue, 1 Jun 2021 18:46:54 +0000 (12:46 -0600)] 
Merge pull request #49 from drakenclimber/issues/delete-cgclear

cgclear: Delete cgclear

4 years agoMerge pull request #48 from drakenclimber/issues/apt-update
Tom Hromatka [Tue, 1 Jun 2021 18:42:00 +0000 (12:42 -0600)] 
Merge pull request #48 from drakenclimber/issues/apt-update

github: Run apt update before apt install

4 years agogithub: Run apt update before apt install 48/head
Tom Hromatka [Tue, 1 Jun 2021 18:25:10 +0000 (12:25 -0600)] 
github: Run apt update before apt install

Run apt update before apt install

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #23 from drakenclimber/issues/delete-cgclear
Tom Hromatka [Tue, 1 Jun 2021 13:44:48 +0000 (07:44 -0600)] 
Merge pull request #23 from drakenclimber/issues/delete-cgclear

ftests: Delete the cgclear functional test

4 years agoMerge pull request #22 from drakenclimber/issues/cgexec-test
Tom Hromatka [Mon, 24 May 2021 15:41:02 +0000 (09:41 -0600)] 
Merge pull request #22 from drakenclimber/issues/cgexec-test

Add a cgexec functional test

4 years agocgclear: Delete cgclear 47/head 49/head
Tom Hromatka [Tue, 18 May 2021 18:34:33 +0000 (18:34 +0000)] 
cgclear: Delete cgclear

With systemd managing the mounting/unmounting of
cgroups, cgclear no longer makes sense.  Remove it.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Delete the cgclear functional test
Tom Hromatka [Tue, 18 May 2021 18:33:14 +0000 (18:33 +0000)] 
ftests: Delete the cgclear functional test

Delete the cgclear functional test.  cgclear has been
removed from libcgroup.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoftests: Add a cgexec test
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>
4 years agocgroup.py: Add method to get pids in a cgroup
Tom Hromatka [Mon, 17 May 2021 14:15:59 +0000 (14:15 +0000)] 
cgroup.py: Add method to get pids in a cgroup

Add a method, get_pids_in_cgroup(), that will return
the pids in a given cgroup.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoprocess.py: Add support for cgexec'ing a new process
Tom Hromatka [Mon, 17 May 2021 14:12:37 +0000 (14:12 +0000)] 
process.py: Add support for cgexec'ing a new process

Add support for cgexec to create_process_in_cgroup().
cgclassify still remains as the default process assignment
mechanism.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agocgroup.py: Add support for cgexec
Tom Hromatka [Mon, 17 May 2021 14:04:37 +0000 (14:04 +0000)] 
cgroup.py: Add support for cgexec

Add support for cgexec to the Cgroup class.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoautomake: replace CPPFLAGS by AM_CPPFLAGS
Tomasz Kłoczko [Wed, 12 May 2021 20:36:17 +0000 (20:36 +0000)] 
automake: replace CPPFLAGS by AM_CPPFLAGS

To not interfere with env $CPPFLAGS it is better to use AM_CPPFLAGS

Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoautomake: build PAM module as unversioned DSO
Tomasz Kłoczko [Wed, 12 May 2021 20:36:02 +0000 (20:36 +0000)] 
automake: build PAM module as unversioned DSO

PAM modules should be build as unversioned DSO.
Add -avoid-version to pam_cgroup_la_LDFLAGS

Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoautomake: replace INCLUDES by CPPFLAGS
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>
4 years agoUpdate version number to 2.0 v2.0
Tom Hromatka [Thu, 6 May 2021 14:14:30 +0000 (14:14 +0000)] 
Update version number to 2.0

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #21 from drakenclimber/issues/skip-tests
Tom Hromatka [Wed, 5 May 2021 15:24:00 +0000 (09:24 -0600)] 
Merge pull request #21 from drakenclimber/issues/skip-tests

ftests.py: Allow for skipping of multiple tests

4 years agoftests.py: Allow for skipping of multiple tests
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>
4 years agoMerge pull request #42 from drakenclimber/issues/update-map
Tom Hromatka [Mon, 3 May 2021 21:15:50 +0000 (15:15 -0600)] 
Merge pull request #42 from drakenclimber/issues/update-map

libcgroup.map: Update version number

4 years agolibcgroup.map: Update version number 42/head
Tom Hromatka [Mon, 3 May 2021 21:02:04 +0000 (15:02 -0600)] 
libcgroup.map: Update version number

Update the version number for the most recent exported
functions.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #41 from drakenclimber/issues/fix-warnings
Tom Hromatka [Fri, 30 Apr 2021 13:47:10 +0000 (07:47 -0600)] 
Merge pull request #41 from drakenclimber/issues/fix-warnings

Fix warnings

4 years agoMerge pull request #20 from drakenclimber/issues/fix-warnings
Tom Hromatka [Fri, 30 Apr 2021 13:39:03 +0000 (07:39 -0600)] 
Merge pull request #20 from drakenclimber/issues/fix-warnings

Fix warnings in libcgroup-tests repo

4 years agoparse.y: Fix nonterminal %type warnings 41/head
Tom Hromatka [Tue, 27 Apr 2021 19:24:41 +0000 (19:24 +0000)] 
parse.y: Fix nonterminal %type warnings

Fix the following warnings in parse.y:

../parse.y:48.14-15: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
   48 | %type <name> ID DEFAULT group_name
      |              ^~
../parse.y:48.17-23: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
   48 | %type <name> ID DEFAULT group_name
      |                 ^~~~~~~

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agogunit: Fix an snprintf() truncation warning
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>
4 years agogunit: Fix an snprintf() truncation warning
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>
4 years agoMakefile.am/tests: Do not compile the old tests
Tom Hromatka [Tue, 27 Apr 2021 17:12:15 +0000 (17:12 +0000)] 
Makefile.am/tests: Do not compile the old tests

For historical reasons, the old tests remain in the testing
directory but are not being run or installed.

Due to compiler warnings from newer versions of GCC, do not
compile these tests.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agolscgroup: Fix strncpy() truncation warning
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>
4 years agolscgroup: Fix strncpy() truncation warning
Tom Hromatka [Tue, 27 Apr 2021 17:07:31 +0000 (17:07 +0000)] 
lscgroup: Fix strncpy() truncation warning

Fix the following strncpy() string truncation warning:

In function ‘strncpy’,
    inlined from ‘display_controller_data’ at lscgroup.c:104:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound 4096 equals destination size [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agolscgroup: Fix strncpy() truncation warning
Tom Hromatka [Tue, 27 Apr 2021 17:06:26 +0000 (17:06 +0000)] 
lscgroup: Fix strncpy() truncation warning

Fix the following strncpy() string truncation warning:

In function ‘strncpy’,
    inlined from ‘display_controller_data’ at lscgroup.c:99:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound 4096 equals destination size [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agolssubsys: Fix strncpy() truncation warning
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>
4 years agolssubsys: Fix strncpy() truncation warning
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>
4 years agolssubsys: Fix strncpy() truncation warning
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>
4 years agocgget: Fix strncpy() truncation warning
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>
4 years agotools: Fix strncpy() truncation warning
Tom Hromatka [Tue, 27 Apr 2021 16:50:53 +0000 (16:50 +0000)] 
tools: Fix strncpy() truncation warning

Fix the following strncpy() string truncation warning:

In function ‘strncpy’,
    inlined from ‘parse_cgroup_spec’ at ../tools/tools-common.c:92:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound 4096 equals destination size [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoconfig.c: Fix strncpy() truncation warning
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>
4 years agoconfig.c: Fix strncpy() truncation warning
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>
4 years agoconfig.c: Fix strncpy() truncation warning
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>
4 years agoapi.c: Fix strncpy() truncation warning
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>
4 years agoapi.c: Fix strncpy() truncation warning
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>
4 years agoapi.c: Fix strncpy() truncation warning
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>
4 years agoapi.c: Fix strncpy() truncation warning
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>
4 years agodoc: Update github release process
Tom Hromatka [Mon, 26 Apr 2021 22:06:01 +0000 (22:06 +0000)] 
doc: Update github release process

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoUpdate version number to 2.0.rc1 v2.0.rc1
Tom Hromatka [Mon, 26 Apr 2021 21:16:26 +0000 (21:16 +0000)] 
Update version number to 2.0.rc1

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMakefile.am: Remove default.conf
Tom Hromatka [Mon, 26 Apr 2021 19:44:12 +0000 (19:44 +0000)] 
Makefile.am: Remove default.conf

Remove the reference in EXTRA_DIST to default.conf.
default.conf was deleted in e326a57222e8 ("ftests: Remove
unused config files").

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #40 from drakenclimber/issues/38
Tom Hromatka [Mon, 19 Apr 2021 14:43:21 +0000 (08:43 -0600)] 
Merge pull request #40 from drakenclimber/issues/38

cgget: Fix segfault when no flags provided

4 years agoMerge pull request #19 from drakenclimber/issues/38
Tom Hromatka [Mon, 19 Apr 2021 14:33:39 +0000 (08:33 -0600)] 
Merge pull request #19 from drakenclimber/issues/38

ftests: Add cgget test with no flags

4 years agocgget: Fix segfault when no flags provided 40/head
Tom Hromatka [Wed, 14 Apr 2021 16:02:44 +0000 (10:02 -0600)] 
cgget: Fix segfault when no flags provided

Fix a segmentation fault when cgget is invoked in the
following form:
cgget CroupName

parse_opt_args() was erroneously expecting a previously
populated struct cgroup in this case, and we were indexing
out of bounds of the cg_list.

Fixes: 1b7d606fa12a ("cgget: Major refactor")
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #39 from drakenclimber/issues/fixwarnings
Tom Hromatka [Thu, 15 Apr 2021 20:42:02 +0000 (14:42 -0600)] 
Merge pull request #39 from drakenclimber/issues/fixwarnings

Fix compiler warnings

4 years agoMerge pull request #18 from drakenclimber/issues/fixtest004
Tom Hromatka [Thu, 15 Apr 2021 20:23:53 +0000 (14:23 -0600)] 
Merge pull request #18 from drakenclimber/issues/fixtest004

ftests: Allow test 004 to run on systems w/ or w/o swap

4 years agoftests: Allow test 004 to run on systems w/ or w/o swap
Tom Hromatka [Thu, 25 Mar 2021 20:03:35 +0000 (20:03 +0000)] 
ftests: Allow test 004 to run on systems w/ or w/o swap

Add smarts to test 004 so that it can be run on systems with
or without swap.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
4 years agoMerge pull request #17 from drakenclimber/issues/lscgroup
Tom Hromatka [Thu, 15 Apr 2021 19:57:21 +0000 (13:57 -0600)] 
Merge pull request #17 from drakenclimber/issues/lscgroup

Add support and tests for lscgroup

4 years agoftests: Add cgget test with no flags
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>