[Libcg-devel] [PATCH] cgset: fix misleading error message

2019-01-15 Thread Tom Hromatka
When cgset fails to modify a cgroup, it output a hardcoded error message which can cause user confusion. This commit updates the error message to behave like other error messages throughout libcgroup and produce a more user-friendly output. Signed-off-by: Tom Hromatka --- src/tools/cgset.c | 5

[Libcg-devel] [PATCH 1/2] api: Refactor cgroup v1 logic in cgroup_init()

2019-01-23 Thread Tom Hromatka
In preparation for adding support for cgroup v2, this commit moves some cgroup v1 mount logic out of cgroup_init() and into its own function. Signed-off-by: Tom Hromatka --- src/api.c | 218 +- 1 file changed, 117 insertions(+), 101

[Libcg-devel] [PATCH 2/2] api: Add cgroup v2 support

2019-01-23 Thread Tom Hromatka
This commit adds cgroup v2 support to cgget, cgset, and cgroup_init(). Signed-off-by: Tom Hromatka --- src/api.c| 134 +-- src/libcgroup-internal.h | 6 +++ 2 files changed, 125 insertions(+), 15 deletions(-) diff --git a/src/api.c

[Libcg-devel] [PATCH 0/2] Add cgroup v2 support to cgget/cgset

2019-01-23 Thread Tom Hromatka
This patchset adds cgroup v2 support to cgget and cgset. It may also add cgroup v2 support for other commands, but I haven't extensively tested them yet. Tom Hromatka (2): api: Refactor cgroup v1 logic in cgroup_init() api: Add cgroup v2 support src/api.c

Re: [Libcg-devel] [PATCH 0/2] Add cgroup v2 support to cgget/cgset

2019-01-28 Thread Tom Hromatka
On 1/26/19 9:54 AM, Dhaval Giani wrote: On Thu, Jan 24, 2019 at 4:53 AM Tom Hromatka wrote: This patchset adds cgroup v2 support to cgget and cgset. It may also add cgroup v2 support for other commands, but I haven't extensively tested them yet. How have you tested the submitted

Re: [Libcg-devel] [PATCH 1/2] api: Refactor cgroup v1 logic in cgroup_init()

2019-01-28 Thread Tom Hromatka
On 1/26/19 9:56 AM, Dhaval Giani wrote: On Thu, Jan 24, 2019 at 4:53 AM Tom Hromatka wrote: In preparation for adding support for cgroup v2, this commit moves some cgroup v1 mount logic out of cgroup_init() and into its own function. Signed-off-by: Tom Hromatka --- src/api.c | 218

Re: [Libcg-devel] [PATCH 0/2] Add cgroup v2 support to cgget/cgset

2019-02-01 Thread Tom Hromatka
On 1/28/19 2:18 PM, Dhaval Giani wrote: On Mon, Jan 28, 2019 at 7:19 AM Tom Hromatka wrote: On 1/26/19 9:54 AM, Dhaval Giani wrote: On Thu, Jan 24, 2019 at 4:53 AM Tom Hromatka wrote: This patchset adds cgroup v2 support to cgget and cgset. It may also add cgroup v2 support for other

[Libcg-devel] [PATCH] Add googletest framework

2019-05-06 Thread Tom Hromatka
This patch adds unit test support, via the googletest framework, to libcgroup. I created a handful of unit tests for the internal function cg_build_path() to provide a few usage examples. Tom Hromatka (1): tests: Add googletest framework .gitignore | 1 + .gitmodules

[Libcg-devel] [PATCH] tests: Add googletest framework

2019-05-06 Thread Tom Hromatka
This commit adds support for the googletest unit test framework. To enable the testing of non-exported functions, a more permissive map file was added. Signed-off-by: Tom Hromatka --- .gitignore | 1 + .gitmodules| 4 ++ Makefile.am| 3

[Libcg-devel] [PATCH v2 1/2] tests: Add googletest unit test framework

2019-05-29 Thread Tom Hromatka
This commit adds support for the googletest unit test framework. To enable the testing of non-exported functions, a more permissive map file was added. Signed-off-by: Tom Hromatka --- .gitignore | 1 + .gitmodules| 4 ++ Makefile.am

[Libcg-devel] [PATCH v2 2/2] tests: Add unit tests for cg_build_path()

2019-05-29 Thread Tom Hromatka
This commit adds unit tests for the internal function cg_build_path(). While code coverage is not (yet) enabled, I believe these tests provide full code coverage for the aforementioned function and its sister function cg_build_path_locked(). Signed-off-by: Tom Hromatka --- tests/gunit/001

[Libcg-devel] [PATCH v2 0/2] Add googletest framework

2019-05-29 Thread Tom Hromatka
example test * Updated copyright headers to match existing libcgroup headers * Moved the unit tests to tests/gunit/ * Moved libcgroup_unittest.map to the gunit folder * Added doxygen headers on the test functions Tom Hromatka (2): tests: Add googletest unit test framework tests: Add unit tests

[Libcg-devel] [PATCH v3 0/2] Add googletest framework

2019-05-30 Thread Tom Hromatka
unit tests to tests/gunit/ * Moved libcgroup_unittest.map to the gunit folder * Added doxygen headers on the test functions Tom Hromatka (2): tests: Add googletest unit test framework tests: Add unit tests for cg_build_path() .gitignore | 1 + .gitmodules

[Libcg-devel] [PATCH v3 1/2] tests: Add googletest unit test framework

2019-05-30 Thread Tom Hromatka
This commit adds support for the googletest unit test framework. To enable the testing of non-exported functions, a more permissive map file was added. Signed-off-by: Tom Hromatka --- .gitignore | 1 + .gitmodules| 4 + Makefile.am

[Libcg-devel] [PATCH v3 2/2] tests: Add unit tests for cg_build_path()

2019-05-30 Thread Tom Hromatka
a namespace Signed-off-by: Tom Hromatka --- tests/gunit/001-path.cpp | 175 +++ tests/gunit/Makefile.am | 3 +- 2 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 tests/gunit/001-path.cpp diff --git a/tests/gunit/001-path.cpp b/tests/guni

[Libcg-devel] [PATCH 2/2] tests: Add functional test for basic cgget operations

2019-06-04 Thread Tom Hromatka
This commit adds a functional test for a basic cgget call. The test utilizes the new functional text framework and lxc containers to establish a non-destructive cgroup test environment. Tests added: 001-cgget-basic_cgget.py - Test simple cgget functionality Signed-off-by: Tom Hromatka

[Libcg-devel] [PATCH 1/2] tests: Add functional test suite

2019-06-04 Thread Tom Hromatka
setup6.95 001-cgget-basic_cgget.py 0.07 teardown 0.00 - Total Run Time 7.02 Signed-off-by: Tom Hromatka --- co

[Libcg-devel] [PATCH 0/2] Add functional test framework

2019-06-04 Thread Tom Hromatka
that would be better in a subsequent patch set. Tom Hromatka (2): tests: Add functional test suite tests: Add functional test for basic cgget operations configure.in | 1 + tests/Makefile.am | 2 +- tests/ftests/.gitignore | 5

Re: [Libcg-devel] [PATCH] cgrulesengd: Do not ignore changes of short-lived processes

2019-06-05 Thread Tom Hromatka
On 4/2/19 9:21 AM, Michal Koutný wrote: When a double-forking daemon spawns the shortlived forking process and we fail to classify it in time, the child does not inherit (the intended) cgroup membership. I created a simple double-forking test program to try and reproduce the issue, but I was

Re: [Libcg-devel] [PATCH v2 0/1] cgrulesengd: Do not ignore changes of short-lived processes

2019-06-07 Thread Tom Hromatka
On 6/7/19 3:19 AM, Michal Koutný wrote: On Wed, Jun 05, 2019 at 02:42:00PM -0600, Tom Hromatka wrote: I created a simple double-forking test program to try and reproduce the issue, but I was unable to get it to happen.  Is your system heavily loaded?  Any recommendations on reproducing the

Re: [Libcg-devel] [PATCH 1/2] tests: Add functional test suite

2019-06-21 Thread Tom Hromatka
On 6/10/19 11:56 AM, Dhaval Giani wrote: On Tue, Jun 4, 2019 at 1:34 PM Tom Hromatka wrote: This commit adds a functional test suite that utilizes lxc containers to guarantee a non-destructive test environment. The tests can be invoked individually, as a group of related tests, or from

[Libcg-devel] [PATCH v2 6/7] tests: Add functional test suite

2019-06-21 Thread Tom Hromatka
setup6.95 001-cgget-basic_cgget.py 0.07 teardown 0.00 - Total Run Time 7.02 Signed-off-by: Tom Hromatka --- tests/ftests

[Libcg-devel] [PATCH v2 7/7] tests: Add functional test for basic cgget operations

2019-06-21 Thread Tom Hromatka
This commit adds a functional test for a basic cgget call. The test utilizes the new functional text framework and lxc containers to establish a non-destructive cgroup test environment. Tests added: 001-cgget-basic_cgget.py - Test simple cgget functionality Signed-off-by: Tom Hromatka

[Libcg-devel] [PATCH v2 5/7] tests: Add functional test LXC container class

2019-06-21 Thread Tom Hromatka
This commit adds a Container() class for managing LXC containers. Signed-off-by: Tom Hromatka --- tests/ftests/container.py | 235 ++ tests/ftests/default.conf | 28 ++ 2 files changed, 263 insertions(+) create mode 100644 tests/ftests

[Libcg-devel] [PATCH v2 4/7] tests: Add functional test cgroup class

2019-06-21 Thread Tom Hromatka
This commit adds a Cgroup() class for managing cgroups. Signed-off-by: Tom Hromatka --- tests/ftests/cgroup.py | 185 + 1 file changed, 185 insertions(+) create mode 100644 tests/ftests/cgroup.py diff --git a/tests/ftests/cgroup.py b/tests

[Libcg-devel] [PATCH v2 3/7] tests: Add functional test run class

2019-06-21 Thread Tom Hromatka
This commit adds a Run() class that can invoke Python's Popen command. Signed-off-by: Tom Hromatka --- tests/ftests/run.py | 73 + 1 file changed, 73 insertions(+) create mode 100644 tests/ftests/run.py diff --git a/tests/ftests/run

[Libcg-devel] [PATCH v2 1/7] tests: Add functional test folder

2019-06-21 Thread Tom Hromatka
This commit adds a folder that will hold the functional tests and their framework. Signed-off-by: Tom Hromatka --- configure.in | 1 + tests/Makefile.am| 2 +- tests/ftests/.gitignore | 5 + tests/ftests/Makefile.am | 27 +++ tests/ftests

[Libcg-devel] [PATCH v2 0/7] Add functional test framework

2019-06-21 Thread Tom Hromatka
that would be better in a subsequent patch set. The patches are also available here: https://github.com/drakenclimber/libcgroup/tree/issues/functional_tests_v2 Changes from v1 to v2: * Removed SPDX license line from headers * Split patchset up into seven patches Tom Hromatka (7): tests: Add

[Libcg-devel] [PATCH v2 2/7] tests: Add functional test logging class

2019-06-21 Thread Tom Hromatka
This commit adds a Log() class for the functional test suite. Signed-off-by: Tom Hromatka --- tests/ftests/log.py | 66 + 1 file changed, 66 insertions(+) create mode 100644 tests/ftests/log.py diff --git a/tests/ftests/log.py b/tests/ftests

Re: [Libcg-devel] [PATCH v2 4/7] tests: Add functional test cgroup class

2019-06-25 Thread Tom Hromatka
On 6/25/19 2:27 PM, Dhaval Giani wrote: On Fri, Jun 21, 2019 at 3:46 PM Tom Hromatka wrote: This commit adds a Cgroup() class for managing cgroups. Any relation to the struct cgroup? How are they related? Not really.  This class abstracts the major libcgroup CLI APIs - cgget, cgset

Re: [Libcg-devel] [PATCH v2 4/7] tests: Add functional test cgroup class

2019-06-25 Thread Tom Hromatka
On 6/25/19 2:34 PM, Dhaval Giani wrote: On Tue, Jun 25, 2019 at 1:32 PM Tom Hromatka wrote: On 6/25/19 2:27 PM, Dhaval Giani wrote: On Fri, Jun 21, 2019 at 3:46 PM Tom Hromatka wrote: This commit adds a Cgroup() class for managing cgroups. Any relation to the struct cgroup? How are

[Libcg-devel] [PATCH v3 1/7] tests: Add functional test folder

2019-06-27 Thread Tom Hromatka
This commit adds a folder that will hold the functional tests and their framework. Signed-off-by: Tom Hromatka Reviewed-by: Dhaval Giani --- configure.in | 1 + tests/Makefile.am| 2 +- tests/ftests/.gitignore | 5 + tests/ftests/Makefile.am | 27

[Libcg-devel] [PATCH v3 4/7] tests: Add functional test cgroup class

2019-06-27 Thread Tom Hromatka
ytes = Cgroup.get(config, controller=None, cgname='AnotherCgroup', setting='memory.limit_in_bytes', print_headers=False, values_only=True) Providing invalid parameters to a Cgroup method will result in a ValueError while a failure to execute a command will result in

[Libcg-devel] [PATCH v3 7/7] tests: Add functional test for basic cgget operations

2019-06-27 Thread Tom Hromatka
This commit adds a functional test for a basic cgget call. The test utilizes the new functional text framework and lxc containers to establish a non-destructive cgroup test environment. Tests added: 001-cgget-basic_cgget.py - Test simple cgget functionality Signed-off-by: Tom Hromatka

[Libcg-devel] [PATCH v3 5/7] tests: Add functional test LXC container class

2019-06-27 Thread Tom Hromatka
# create and start the container mycontainer.create() mycontainer.start() Container() can raise ValueError on invalid parameters, ContainerError when a container operation unexpectedly failes, or RunError when running a command fails. Signed-off-by: Tom Hromatka --- tests/ftests/consts.p

[Libcg-devel] [PATCH v3 2/7] tests: Add functional test logging class

2019-06-27 Thread Tom Hromatka
l LOGLEVEL -L LOGFILE, --logfile LOGFILE Signed-off-by: Tom Hromatka Reviewed-by: Dhaval Giani --- tests/ftests/consts.py | 7 +++ tests/ftests/log.py| 57 ++ 2 files changed, 64 insertions(+) create mode 100644 tests/ftests/log.py di

[Libcg-devel] [PATCH v3 3/7] tests: Add functional test run class

2019-06-27 Thread Tom Hromatka
stderr = Jun 27 12:34:18: DEBUG: run: command = sudo lxc-attach -n test_libcg -- /libcg/src/tools/.libs/cgget -n -v -r cpu.shares 001cgget ret = 0 stdout = 512 stderr = If the command fails, Run.run() throws a RunError exception which contains

[Libcg-devel] [PATCH v3 0/7] Add functional test framework

2019-06-27 Thread Tom Hromatka
to their respective patches * Deleted LogError() exception class as it was not being used Changes from v1 to v2: * Removed SPDX license line from headers * Split patchset up into seven patches Tom Hromatka (7): tests: Add functional test folder tests: Add functional test logging class tests

[Libcg-devel] [PATCH v3 6/7] tests: Add functional test suite

2019-06-27 Thread Tom Hromatka
setup6.95 001-cgget-basic_cgget.py 0.07 teardown 0.00 - Total Run Time 7.02 Signed-off-by: Tom Hromatka --- tests/ftests

Re: [Libcg-devel] [PATCH v3 4/7] tests: Add functional test cgroup class

2019-07-02 Thread Tom Hromatka
On 7/2/19 5:35 AM, Michal Koutný wrote: On Thu, Jun 27, 2019 at 01:08:36PM -0600, Tom Hromatka wrote: +@staticmethod +def concatenate_controllers(controller_list): +if type(controller_list) is types.StringType: +# controller is already a string. return it as is

Re: [Libcg-devel] [PATCH v3 6/7] tests: Add functional test suite

2019-07-03 Thread Tom Hromatka
On 7/2/19 5:44 AM, Michal Koutný wrote: On Thu, Jun 27, 2019 at 01:08:38PM -0600, Tom Hromatka wrote: Example test invocations: [...] Maybe these examples could be in the file tree itself (either one of the Python files or README-like file). Good idea.  I'll make a README as

Re: [Libcg-devel] [PATCH v3 0/7] Add functional test framework

2019-07-03 Thread Tom Hromatka
On 7/2/19 5:50 AM, Michal Koutný wrote: Hi. This is drive-by review of form (some remarks posted to particular patches), I didn't look deeper into how the actual testing is structured. No worries.  Thanks for the time you were able to give. On Thu, Jun 27, 2019 at 01:08:32PM -0600

Re: [Libcg-devel] [PATCH v3 0/7] Add functional test framework

2019-07-03 Thread Tom Hromatka
On 7/2/19 5:50 AM, Michal Koutný wrote: Hi. This is drive-by review of form (some remarks posted to particular patches), I didn't look deeper into how the actual testing is structured. On Thu, Jun 27, 2019 at 01:08:32PM -0600, Tom Hromatka wrote: These patches add nondestru

[Libcg-devel] [PATCH v4 2/7] tests: Add functional test logging class

2019-07-03 Thread Tom Hromatka
l LOGLEVEL -L LOGFILE, --logfile LOGFILE Signed-off-by: Tom Hromatka Reviewed-by: Dhaval Giani --- tests/ftests/consts.py | 7 +++ tests/ftests/log.py| 56 ++ 2 files changed, 63 insertions(+) create mode 100644 tests/ftests/log.py di

[Libcg-devel] [PATCH v4 0/7] Add functional test framework

2019-07-03 Thread Tom Hromatka
y to their respective patches * Deleted LogError() exception class as it was not being used Changes from v1 to v2: * Removed SPDX license line from headers * Split patchset up into seven patches Tom Hromatka (7): tests: Add functional test folder tests: Add functional test logging class

[Libcg-devel] [PATCH v4 6/7] tests: Add functional test suite

2019-07-03 Thread Tom Hromatka
setup6.95 001-cgget-basic_cgget.py 0.07 teardown 0.00 - Total Run Time 7.02 Signed-off-by: Tom Hromatka --- tests/ftests

[Libcg-devel] [PATCH v4 1/7] tests: Add functional test folder

2019-07-03 Thread Tom Hromatka
This commit adds a folder that will hold the functional tests and their framework. Signed-off-by: Tom Hromatka Reviewed-by: Dhaval Giani --- configure.in | 1 + tests/Makefile.am| 2 +- tests/ftests/.gitignore | 5 + tests/ftests/Makefile.am | 27

[Libcg-devel] [PATCH v4 7/7] tests: Add functional test for basic cgget operations

2019-07-03 Thread Tom Hromatka
This commit adds a functional test for a basic cgget call. The test utilizes the new functional text framework and lxc containers to establish a non-destructive cgroup test environment. Tests added: 001-cgget-basic_cgget.py - Test simple cgget functionality Signed-off-by: Tom Hromatka

[Libcg-devel] [PATCH v4 4/7] tests: Add functional test cgroup class

2019-07-03 Thread Tom Hromatka
ytes = Cgroup.get(config, controller=None, cgname='AnotherCgroup', setting='memory.limit_in_bytes', print_headers=False, values_only=True) Providing invalid parameters to a Cgroup method will result in a ValueError while a failure to execute a command will result in

[Libcg-devel] [PATCH v4 5/7] tests: Add functional test LXC container class

2019-07-03 Thread Tom Hromatka
# create and start the container mycontainer.create() mycontainer.start() Container() can raise ValueError on invalid parameters, ContainerError when a container operation unexpectedly failes, or RunError when running a command fails. Signed-off-by: Tom Hromatka --- tests/ftests/consts.p

[Libcg-devel] [PATCH v4 3/7] tests: Add functional test run class

2019-07-03 Thread Tom Hromatka
stderr = Jun 27 12:34:18: DEBUG: run: command = sudo lxc-attach -n test_libcg -- /libcg/src/tools/.libs/cgget -n -v -r cpu.shares 001cgget ret = 0 stdout = 512 stderr = If the command fails, Run.run() throws a RunError exception which contains

[Libcg-devel] [PATCH 4/7] tests: Disable the legacy tests

2019-09-24 Thread Tom Hromatka
I was unable to get the legacy tests to pass in Travis CI, so I am disabling them for the time being. Signed-off-by: Tom Hromatka --- tests/Makefile.am | 4 +++- tests/tools/cgclassify/Makefile.am | 4 +++- tests/tools/cgconfigparser/Makefile.am | 6 -- tests/tools

[Libcg-devel] [PATCH 7/7] tests: Enable code coverage after a successful Travis CI build

2019-09-24 Thread Tom Hromatka
This commit enables coveralls.io to generate code coverage results by utilizing the gcov data generated during both the unit and functional test runs. Signed-off-by: Tom Hromatka --- .gitignore | 3 + .travis.yml| 14 +++ bootstrap.sh | 8 +- configure.in

[Libcg-devel] [PATCH 2/7] tests: Minor changes to the functional tests for Travis CI

2019-09-24 Thread Tom Hromatka
I found a couple minor issues when running the tests on Travis CI. The RunError() exception wasn't being invoked properly and there was a typo in its string generation. This commit resolves both of these issues Signed-off-by: Tom Hromatka --- tests/ftests/container.py | 4 ++-- tests/f

[Libcg-devel] [PATCH 6/7] tests: Switch to using LXD for functional tests

2019-09-24 Thread Tom Hromatka
Prior to this commit, the functional tests used LXC. LXD is better for configuring a shared device between the host and container that can be written to by the container. This feature is critical for tracking code coverage in the functional tests. Signed-off-by: Tom Hromatka --- .travis.yml

[Libcg-devel] [PATCH 5/7] tests: Add Travis CI yaml configuration file

2019-09-24 Thread Tom Hromatka
This commit adds the Travis CI yaml configuration file that will kick off the continuous integration. Signed-off-by: Tom Hromatka --- .travis.yml | 47 +++ 1 file changed, 47 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b

[Libcg-devel] [PATCH 1/7] tests: Update googletest settings to work with Travis CI

2019-09-24 Thread Tom Hromatka
Minor changes to make the googletest framework and the unit tests work under Travis CI. Signed-off-by: Tom Hromatka --- bootstrap.sh| 8 tests/gunit/Makefile.am | 13 +++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh

[Libcg-devel] [PATCH 3/7] tests: Default the functional tests to python3

2019-09-24 Thread Tom Hromatka
Signed-off-by: Tom Hromatka --- tests/ftests/001-cgget-basic_cgget.py | 2 +- tests/ftests/ftests.py| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ftests/001-cgget-basic_cgget.py b/tests/ftests/001-cgget-basic_cgget.py index 9638335..be58869 100755

[Libcg-devel] [PATCH 0/7] Enable continuous integration and code coverage

2019-09-24 Thread Tom Hromatka
/travisci Tom Hromatka (7): tests: Update googletest settings to work with Travis CI tests: Minor changes to the functional tests for Travis CI tests: Default the functional tests to python3 tests: Disable the legacy tests tests: Add Travis CI yaml configuration file tests: Switch to using LXD

Re: [Libcg-devel] [PATCH 4/7] tests: Disable the legacy tests

2019-09-24 Thread Tom Hromatka
On 9/24/19 4:19 PM, Dhaval Giani wrote: On Tue, Sep 24, 2019 at 1:36 PM Tom Hromatka wrote: I was unable to get the legacy tests to pass in Travis CI, so I am disabling them for the time being. Signed-off-by: Tom Hromatka --- tests/Makefile.am | 4 +++- tests/tools

Re: [Libcg-devel] [PATCH 7/7] tests: Enable code coverage after a successful Travis CI build

2019-09-24 Thread Tom Hromatka
On 9/24/19 4:20 PM, Dhaval Giani wrote: On Tue, Sep 24, 2019 at 1:36 PM Tom Hromatka wrote: This commit enables coveralls.io to generate code coverage results by utilizing the gcov data generated during both the unit and functional test runs. Signed-off-by: Tom Hromatka --- .gitignore

Re: [Libcg-devel] [PATCH 0/7] Enable continuous integration and code coverage

2019-09-24 Thread Tom Hromatka
On 9/24/19 4:22 PM, Dhaval Giani wrote: On Tue, Sep 24, 2019 at 1:36 PM Tom Hromatka wrote: This patchset enables continuous integration, via Travis CI, and code coverage via Coveralls. Travis CI runs all unit and functional tests with the --enable-code-coverage flag passed into ./configure

Re: [Libcg-devel] [PATCH 3/7] tests: Default the functional tests to python3

2019-09-24 Thread Tom Hromatka
On 9/24/19 2:36 PM, Tom Hromatka wrote: Signed-off-by: Tom Hromatka Michal, would you like me to add your name to this patch? i.e.     Suggested-by: Michal Koutný Thanks. Tom --- tests/ftests/001-cgget-basic_cgget.py | 2 +- tests/ftests/ftests.py| 2 +- 2 files

Re: [Libcg-devel] [PATCH 3/7] tests: Default the functional tests to python3

2019-09-25 Thread Tom Hromatka
On 9/25/19 2:43 AM, Michal Koutný wrote: On Tue, Sep 24, 2019 at 04:50:51PM -0600, Tom Hromatka wrote: Michal, would you like me to add your name to this patch? i.e.     Suggested-by: Michal Koutný No problem with that. Maybe add an explanation to the commit message that this change is

[Libcg-devel] [PATCH v2 5/7] tests: Add Travis CI yaml configuration file

2019-09-25 Thread Tom Hromatka
This commit adds the Travis CI yaml configuration file that will kick off the continuous integration. Signed-off-by: Tom Hromatka --- .travis.yml | 47 +++ 1 file changed, 47 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b

[Libcg-devel] [PATCH v2 4/7] tests: Disable the legacy tests

2019-09-25 Thread Tom Hromatka
The legacy tests do not successfully run in Travis CI. This commit disables them from running but does leave the test code in place. The future of these tests and whether they will be removed from the repo or not will be revisited at a later date. Signed-off-by: Tom Hromatka --- tests

[Libcg-devel] [PATCH v2 1/7] tests: Update googletest settings to work with Travis CI

2019-09-25 Thread Tom Hromatka
Minor changes to make the googletest framework and the unit tests work under Travis CI. Signed-off-by: Tom Hromatka --- bootstrap.sh| 8 tests/gunit/Makefile.am | 13 +++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh

[Libcg-devel] [PATCH v2 3/7] tests: Default the functional tests to python3

2019-09-25 Thread Tom Hromatka
Python 2.7 will not be maintained beyond January 1, 2020. To avoid potential problems when python 2 is retired, this commit explicitly instructs the functional tests to use python3. Suggested-by: Michal Koutný Signed-off-by: Tom Hromatka --- tests/ftests/001-cgget-basic_cgget.py | 2 +- tests

[Libcg-devel] [PATCH v2 0/7] Enable continuous integration and code coverage

2019-09-25 Thread Tom Hromatka
/issues/travisci v2 patches are available here: https://github.com/drakenclimber/libcgroup/tree/issues/travisci_v2 Tom Hromatka (7): tests: Update googletest settings to work with Travis CI tests: Minor changes to the functional tests for Travis CI tests: Default the functional tests to python3

[Libcg-devel] [PATCH v2 6/7] tests: Switch to using LXD for functional tests

2019-09-25 Thread Tom Hromatka
Prior to this commit, the functional tests used LXC. LXD is better for configuring a shared device between the host and container that can be written to by the container. This feature is critical for tracking code coverage in the functional tests. Signed-off-by: Tom Hromatka --- .travis.yml

[Libcg-devel] [PATCH v2 2/7] tests: Minor changes to the functional tests for Travis CI

2019-09-25 Thread Tom Hromatka
I found a couple minor issues when running the tests on Travis CI. The RunError() exception wasn't being invoked properly and there was a typo in its string generation. This commit resolves both of these issues Signed-off-by: Tom Hromatka --- tests/ftests/container.py | 4 ++-- tests/f

[Libcg-devel] [PATCH v2 7/7] tests: Enable code coverage after a successful Travis CI build

2019-09-25 Thread Tom Hromatka
: https://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_code_coverage.m4 Signed-off-by: Tom Hromatka --- .gitignore | 3 + .travis.yml| 14 +++ bootstrap.sh | 8 +- configure.in | 42 --- m4/ax_code_coverage.m4 | 264

[Libcg-devel] [PATCH v3 1/8] tests: Improve the unit test framework integration with automake

2019-10-07 Thread Tom Hromatka
up a potential issue on some versions of automake that don't properly expand $(top_builddir) early in the automake process. Signed-off-by: Tom Hromatka --- bootstrap.sh| 8 tests/gunit/Makefile.am | 13 +++-- 2 files changed, 15 insertions(+), 6 deletions(-) di

[Libcg-devel] [PATCH v3 5/8] tests: Disable the legacy tests

2019-10-07 Thread Tom Hromatka
The legacy tests do not successfully run in Travis CI. This commit disables them from running but does leave the test code in place. The future of these tests and whether they will be removed from the repo or not will be revisited at a later date. Signed-off-by: Tom Hromatka --- tests

[Libcg-devel] [PATCH v3 3/8] tests: Fix inconsistent return value in functional test's Container() class

2019-10-07 Thread Tom Hromatka
This commit fixes the Container() class' inconsistent usage of decode(). In the rootfs() method, it returned a binary array in one case and a string in another. Now the rootfs() method will always return a string. Signed-off-by: Tom Hromatka --- tests/ftests/container.py | 4 ++-- 1

[Libcg-devel] [PATCH v3 0/8] Enable continuous integration and code coverage

2019-10-07 Thread Tom Hromatka
are available here: https://github.com/drakenclimber/libcgroup/tree/issues/travisci_v3 Tom Hromatka (8): tests: Improve the unit test framework integration with automake tests: Fix errors in functional test error path handling tests: Fix inconsistent return value in functional test's Cont

[Libcg-devel] [PATCH v3 7/8] tests: Switch to using LXD for functional tests

2019-10-07 Thread Tom Hromatka
Prior to this commit, the functional tests used LXC. LXD is better for configuring a shared device between the host and container that can be written to by the container. This feature is critical for tracking code coverage in the functional tests. Signed-off-by: Tom Hromatka --- .travis.yml

[Libcg-devel] [PATCH v3 2/8] tests: Fix errors in functional test error path handling

2019-10-07 Thread Tom Hromatka
mmand Signed-off-by: Tom Hromatka --- tests/ftests/run.py | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/ftests/run.py b/tests/ftests/run.py index 80e5221..0b4e068 100644 --- a/tests/ftests/run.py +++ b/tests/ftests/run.py @@ -54,8 +54,8 @@ class Run(o

[Libcg-devel] [PATCH v3 6/8] tests: Add Travis CI yaml configuration file

2019-10-07 Thread Tom Hromatka
This commit adds the Travis CI yaml configuration file that will automatically invoke continuous integration for the libcgroup project. Signed-off-by: Tom Hromatka --- .travis.yml | 47 +++ 1 file changed, 47 insertions(+) create mode 100644

[Libcg-devel] [PATCH v3 4/8] tests: Use python3 in the functional tests

2019-10-07 Thread Tom Hromatka
Python 2.7 will not be maintained beyond January 1, 2020. To avoid potential problems when python 2 is retired, this commit explicitly instructs the functional tests to use python3. Suggested-by: Michal Koutný Signed-off-by: Tom Hromatka --- tests/ftests/001-cgget-basic_cgget.py | 2 +- tests

[Libcg-devel] [PATCH v3 8/8] tests: Gather code coverage data after a successful CI run

2019-10-07 Thread Tom Hromatka
autoconf team, and it has been used verbatim. The original file is available here: https://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_code_coverage.m4 Signed-off-by: Tom Hromatka --- .gitignore | 3 + .travis.yml| 14 +++ bootstrap.sh

[Libcg-devel] [PATCH 1/2] README: Rename README to README.md

2019-10-09 Thread Tom Hromatka
Rename README to README.md so that markdown is supported. This will allow for code coverage and continuous integration information to be directly embedded into the readme. Signed-off-by: Tom Hromatka --- README| 183 -- README.md

[Libcg-devel] [PATCH 2/2] README: Add continuous integration and code coverage badges

2019-10-09 Thread Tom Hromatka
This commit adds continuous integration and code coverage status to the README via small infographics that display test pass/fail and coverage percentage, respectively. Signed-off-by: Tom Hromatka --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index

[Libcg-devel] [PATCH 0/2] Show continuous integration results in README

2019-10-09 Thread Tom Hromatka
to Travis CI and coveralls.) Tom Hromatka (2): README: Rename README to README.md README: Add continuous integration and code coverage badges README| 183 - README.md | 186

Re: [Libcg-devel] [PATCH 2/2] README: Add continuous integration and code coverage badges

2019-10-09 Thread Tom Hromatka
On 10/9/19 3:55 PM, Dhaval Giani wrote: On Wed, Oct 9, 2019, 2:50 PM Tom Hromatka <mailto:[email protected]>> wrote: This commit adds continuous integration and code coverage status to the README via small infographics that display test pass/fail and coverage p

[Libcg-devel] [PATCH] README: Add README.md

2019-10-10 Thread Tom Hromatka
e can do. Signed-off-by: Tom Hromatka --- README.md | 4 1 file changed, 4 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000..0677037 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +[![Build Status](https://img.shields.io/t

Re: [Libcg-devel] libcgroup and cgroup v2?

2019-10-14 Thread Tom Hromatka
On 10/14/19 10:30 AM, Michal Koutný wrote: Hello Tom, I see your efforts around covering libcgroup with tests, I assume from earlier conversations it is because of adding support for cgroup v2. Yes, that's correct. From my experience, usage of libcgroup is often in direct conflict with s

[Libcg-devel] [PATCH 1/9] tests: Add STATIC and UNIT_TEST definitions to automake files

2019-11-06 Thread Tom Hromatka
In a standard libcgroup library build, UNIT_TEST is _not_ defined, and thus the prototypes are not available. In a unit test build, UNIT_TEST is defined and the function prototypes are available for the unit tests to use. Signed-off-by: Tom Hromatka

[Libcg-devel] [PATCH 2/9] api.c: Add options field for rules defined in cgrules conf file

2019-11-06 Thread Tom Hromatka
ff-by: Tom Hromatka --- src/api.c| 67 ++-- src/libcgroup-internal.h | 4 +++ 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/src/api.c b/src/api.c index 41daa11a0fca..c418223bd6a6 100644 --- a/src/api.c +++ b/src/api.c @@ -

[Libcg-devel] [PATCH 4/9] api.c: Add function to read /proc/{pid}/cgroup

2019-11-06 Thread Tom Hromatka
necessary memory for each string within the arrays. Note that it's common to have many controllers on newer kernels, so MAX_MNT_ELEMENTS was increased to 16 to handle these additional controllers. Signed-off-by: Tom Hromatka --- src/api.c

[Libcg-devel] [PATCH 7/9] tests: Add unit tests for cgroup_compare_ignore_rule()

2019-11-06 Thread Tom Hromatka
not match a new process Signed-off-by: Tom Hromatka --- src/api.c | 4 +- src/libcgroup-internal.h | 3 + tests/gunit/004-cgroup_compare_ignore_rule.cpp | 241 + tests/gunit/Makefile.am

[Libcg-devel] [PATCH 3/9] tests: Add unit tests for cgroup_parse_rules_options()

2019-11-06 Thread Tom Hromatka
tions_InvalidOption2() - An invalid option along with a valid option is tested RulesOptions_EmptyOptions() - An empty string is tested RulesOptions_NullOptions() - A null-pointer option string is tested Signed-off-by: Tom Hromatka --- src/api.c |

[Libcg-devel] [PATCH 5/9] tests: Add unit tests for cg_get_cgroups_from_proc_cgroups()

2019-11-06 Thread Tom Hromatka
ReadExampleFile() - Read several lines that are similar to a typical /proc/{pid}/cgroups file Signed-off-by: Tom Hromatka --- src/api.c | 6 +- src/libcgroup-internal.h | 6 + .../gunit/003-cg_get_cgroups_from_proc_cgroups.cpp

[Libcg-devel] [PATCH 9/9] tests: Add unit tests for cgroup_compare_wildcard_procname()

2019-11-06 Thread Tom Hromatka
that matches the rule exactly. Expects true. ProcnameWildcard_NoAsteriskMatchExactly - Compares a rule with no wildcards with a process name that exactly matches the rule. Expects false as the function exits early due to no asterisk in the rule. Signed-off-by: Tom Hromatka --- src/

[Libcg-devel] [PATCH 0/9] Add logic to cgrulesengd for ignore rules

2019-11-06 Thread Tom Hromatka
ibcgroup/builds/135355854 Code coverage increased from 16% to 18%. The logic added for this commit was fully covered with the exception of a few error handling cases: https://coveralls.io/builds/26816041 Tom Hromatka (9): tests: Add STATIC and UNIT_TEST definitions to automake files api.c: Add op

[Libcg-devel] [PATCH 8/9] cgrulesengd: Add wildcard matching for process names

2019-11-06 Thread Tom Hromatka
7;, 'foo2', etc. would be moved to the FooCG/ cgroup. Processes named 'bar', 'fo', etc. would not match this rule. Signed-off-by: Tom Hromatka --- src/api.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/src/api.c b/src/

[Libcg-devel] [PATCH 6/9] api.c: Add logic to process ignore rules

2019-11-06 Thread Tom Hromatka
e IgnoreCgroup cgroup, then cgrulesengd will ignore it and it will not be moved * If a process named "bar" is spawned in IgnoreCgroup, it will not match the first rule and will fall into the default rule. Thus it will be moved to the DefaultCg

Re: [Libcg-devel] [PATCH 1/9] tests: Add STATIC and UNIT_TEST definitions to automake files

2019-11-15 Thread Tom Hromatka
On 11/15/19 2:23 PM, Dhaval Giani wrote: On Wed, Nov 6, 2019 at 3:43 PM Tom Hromatka wrote: This commit adds two new definitions to the automake Makefile.am files. This change has no effect on the deliverable binaries. STATIC - For a standard libcgroup library build, STATIC is equal

Re: [Libcg-devel] [PATCH 4/9] api.c: Add function to read /proc/{pid}/cgroup

2019-11-15 Thread Tom Hromatka
On 11/15/19 2:29 PM, Dhaval Giani wrote: On Wed, Nov 6, 2019 at 3:43 PM Tom Hromatka wrote: This commit adds a function that, given a pid, can read in the controllers and cgroups listed in /proc/{pid}/cgroup. The caller is expected to allocate the controller_list[] and cgroup_list[] arrays

[Libcg-devel] [PATCH v2 05/10] api.c: Add function to read /proc/{pid}/cgroup

2019-11-18 Thread Tom Hromatka
necessary memory for each string within the arrays. Signed-off-by: Tom Hromatka --- src/api.c | 103 ++ 1 file changed, 103 insertions(+) diff --git a/src/api.c b/src/api.c index 907475f8d6cf..105816a3ff51 100644 --- a/src/api.c +++ b/src

  1   2   3   4   5   6   >