diff options
| author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-12-19 15:06:11 +0100 |
|---|---|---|
| committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-12-20 10:02:47 +0100 |
| commit | 08c3f0f7379eabe51cd965d0dc35626d8939ae27 (patch) | |
| tree | 69f1728b5fcfe1fed211eb693211a6e5818f6895 /plugins/tests/test_check_swap.c | |
| parent | 9083896d9c5f5a06f4f0c7c356879dc32330dab7 (diff) | |
| download | monitoring-plugins-08c3f0f7379eabe51cd965d0dc35626d8939ae27.tar.gz | |
Add test proc/meminfo file and corresponding test
Diffstat (limited to 'plugins/tests/test_check_swap.c')
| -rw-r--r-- | plugins/tests/test_check_swap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/tests/test_check_swap.c b/plugins/tests/test_check_swap.c index 42ac0086..86ab188f 100644 --- a/plugins/tests/test_check_swap.c +++ b/plugins/tests/test_check_swap.c | |||
| @@ -13,9 +13,12 @@ int main() { | |||
| 13 | 13 | ||
| 14 | swap_config config = swap_config_init(); | 14 | swap_config config = swap_config_init(); |
| 15 | 15 | ||
| 16 | swap_result test_data = get_swap_data(config); | 16 | swap_result test_data = getSwapFromProcMeminfo(config, "./var/proc_meminfo"); |
| 17 | 17 | ||
| 18 | plan_tests(1); | 18 | plan_tests(4); |
| 19 | 19 | ||
| 20 | ok(test_data.errorcode == 0, "Test whether we manage to retrieve swap data"); | 20 | ok(test_data.errorcode == 0, "Test whether we manage to retrieve swap data"); |
| 21 | ok(test_data.metrics.total == 34233905152, "Is the total Swap correct"); | ||
| 22 | ok(test_data.metrics.free == 34231021568, "Is the free Swap correct"); | ||
| 23 | ok(test_data.metrics.used == 0, "Is the used Swap correct"); | ||
| 21 | } | 24 | } |
