diff options
author | Jeff Cantrill <jcantril@redhat.com> | 2017-10-26 10:15:25 -0400 |
---|---|---|
committer | Jeff Cantrill <jcantril@redhat.com> | 2017-10-27 09:01:57 -0400 |
commit | 205d03455cf37d66f3629de7951463d755b72b16 (patch) | |
tree | 58a894d2b928fcdcb542b50ba2eb6fb56f89cc54 /roles/openshift_logging/filter_plugins/test | |
parent | 34f6e3e2543ab961bcded8cbc7e531a7bbf5b02c (diff) | |
download | openshift-205d03455cf37d66f3629de7951463d755b72b16.tar.gz openshift-205d03455cf37d66f3629de7951463d755b72b16.tar.bz2 openshift-205d03455cf37d66f3629de7951463d755b72b16.tar.xz openshift-205d03455cf37d66f3629de7951463d755b72b16.zip |
bug 1506073. Lower cpu request for logging when it exceeds limit
Diffstat (limited to 'roles/openshift_logging/filter_plugins/test')
-rw-r--r-- | roles/openshift_logging/filter_plugins/test | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/roles/openshift_logging/filter_plugins/test b/roles/openshift_logging/filter_plugins/test index 3ad956cca..bac25c012 100644 --- a/roles/openshift_logging/filter_plugins/test +++ b/roles/openshift_logging/filter_plugins/test @@ -1,7 +1,22 @@ import unittest from openshift_logging import walk +from openshift_logging import min_cpu class TestFilterMethods(unittest.TestCase): + + + def test_min_cpu_for_none(self): + source = "1000M" + self.assertEquals(min_cpu(source, None), "1000M") + + def test_min_cpu_for_millis(self): + source = "1" + self.assertEquals(min_cpu(source, "0.1"), "0.1") + + + def test_min_cpu_for_whole(self): + source = "120M" + self.assertEquals(min_cpu(source, "2"), "120M") def test_walk_find_key(self): |