diff options
author | Luke Meyer <lmeyer@redhat.com> | 2017-05-26 15:48:10 -0400 |
---|---|---|
committer | Luke Meyer <lmeyer@redhat.com> | 2017-05-29 17:20:37 -0400 |
commit | 090e5ea774608b99dab7a1567d44c0eb972dada4 (patch) | |
tree | a462a249e1cd1bc1429e01576291ffd338900574 /roles/openshift_health_checker/test | |
parent | c5f4a60fdd9ebc81180a96677717ca96b9badc72 (diff) | |
download | openshift-090e5ea774608b99dab7a1567d44c0eb972dada4.tar.gz openshift-090e5ea774608b99dab7a1567d44c0eb972dada4.tar.bz2 openshift-090e5ea774608b99dab7a1567d44c0eb972dada4.tar.xz openshift-090e5ea774608b99dab7a1567d44c0eb972dada4.zip |
memory check: use GiB/MiB and adjust memtotal
fixes https://bugzilla.redhat.com/show_bug.cgi?id=1455884
Various things reserve memory such that memtotal is quite lower than the
actual physical RAM of the system. It's larger as RAM increases but it's
not really proportional so I just added a flat 1GiB adjustment in the
comparison. This ought to "pass when it's close enough."
Diffstat (limited to 'roles/openshift_health_checker/test')
-rw-r--r-- | roles/openshift_health_checker/test/memory_availability_test.py | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/roles/openshift_health_checker/test/memory_availability_test.py b/roles/openshift_health_checker/test/memory_availability_test.py index 1db203854..4fbaea0a9 100644 --- a/roles/openshift_health_checker/test/memory_availability_test.py +++ b/roles/openshift_health_checker/test/memory_availability_test.py @@ -37,6 +37,11 @@ def test_is_active(group_names, is_active): 2000, # too low for recommended but not for configured ), ( + ['nodes'], + 2, # configure threshold where adjustment pushes it over + 1900, + ), + ( ['etcd'], 0, 8200, @@ -65,38 +70,44 @@ def test_succeeds_with_recommended_memory(group_names, configured_min, ansible_m ['masters'], 0, 0, - ['0.0 GB'], + ['0.0 GiB'], ), ( ['nodes'], 0, 100, - ['0.1 GB'], + ['0.1 GiB'], + ), + ( + ['nodes'], + 24, # configure higher threshold + 20 * 1024, # enough to meet recommended but not configured + ['20.0 GiB'], ), ( ['nodes'], 24, # configure higher threshold - 20000, # enough to meet recommended but not configured - ['20.0 GB'], + 22 * 1024, # not enough for adjustment to push over threshold + ['22.0 GiB'], ), ( ['etcd'], 0, - 7000, - ['7.0 GB'], + 6 * 1024, + ['6.0 GiB'], ), ( ['etcd', 'masters'], 0, - 9000, # enough memory for etcd, not enough for a master - ['9.0 GB'], + 9 * 1024, # enough memory for etcd, not enough for a master + ['9.0 GiB'], ), ( ['nodes', 'masters'], 0, # enough memory for a node, not enough for a master - 11000, - ['11.0 GB'], + 11 * 1024, + ['11.0 GiB'], ), ]) def test_fails_with_insufficient_memory(group_names, configured_min, ansible_memtotal_mb, extra_words): |