On 10/29/20 4:58 AM, Michal Koutný wrote:
Hi.
On Wed, Oct 28, 2020 at 01:03:23PM -0600, Tom Hromatka
<tom.hroma...@oracle.com> wrote:
+ version = Cgroup.version(CONTROLLER)
+ if version == Cgroup.CGROUP_UNK:
+ raise ValueError("Unable to get the controller version for {}".format(
+ CONTROLLER))
+
+ if version == Cgroup.CGROUP_V1:
+ Cgroup.set(config, CGNAME, CGV1_SETTING, CGV1_VALUE)
+ else:
+ Cgroup.set(config, CGNAME, CGV2_SETTING, CGV2_VALUE)
I'd suggest logging a message what variant of the test is being run (to
see in the test report what was actually tested when it depends on the
environment). Alternatively, split the tests into v1 and v2 and skip the
variant that doesn't apply (this may be an overkill for this purpose
though).
Thanks. A log message is definitely warranted. Good call.
I waffled on splitting the test into two, and your comment
is making me think that may be the best bet. Once the
container is setup, running a single test is very fast (typically
less than a second.) While the test is still simple, the
various "if" statements are more error prone and definitely
reduce readability.
Thanks again for your help.
Tom
Michal
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel