From 735b04eff721a28e791714c0da4c8ac5726bfbcf Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 4 Jan 2024 02:37:26 +0100 Subject: Fix tests --- plugins/tests/test_check_swap.c | 3 +-- plugins/tests/test_check_swap.t | 2 +- plugins/tests/var/proc_meminfo | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) mode change 100644 => 100755 plugins/tests/test_check_swap.t (limited to 'plugins/tests') diff --git a/plugins/tests/test_check_swap.c b/plugins/tests/test_check_swap.c index 86ab188f..319cadbf 100644 --- a/plugins/tests/test_check_swap.c +++ b/plugins/tests/test_check_swap.c @@ -10,7 +10,6 @@ void print_help(swap_config config) { const char *progname = "test_check_swap"; int main() { - swap_config config = swap_config_init(); swap_result test_data = getSwapFromProcMeminfo(config, "./var/proc_meminfo"); @@ -19,6 +18,6 @@ int main() { ok(test_data.errorcode == 0, "Test whether we manage to retrieve swap data"); ok(test_data.metrics.total == 34233905152, "Is the total Swap correct"); - ok(test_data.metrics.free == 34231021568, "Is the free Swap correct"); + ok(test_data.metrics.free == 34233905152, "Is the free Swap correct"); ok(test_data.metrics.used == 0, "Is the used Swap correct"); } diff --git a/plugins/tests/test_check_swap.t b/plugins/tests/test_check_swap.t old mode 100644 new mode 100755 index 97c651a8..826fae01 --- a/plugins/tests/test_check_swap.t +++ b/plugins/tests/test_check_swap.t @@ -1,6 +1,6 @@ #!/usr/bin/perl use Test::More; if (! -e "./test_check_swap") { - plan skip_all => "./test_swap not compiled - please enable libtap library to test"; + plan skip_all => "./test_check_swap not compiled - please enable libtap library to test"; } exec "./test_check_swap"; diff --git a/plugins/tests/var/proc_meminfo b/plugins/tests/var/proc_meminfo index 8c94c4e5..6c5a618d 100644 --- a/plugins/tests/var/proc_meminfo +++ b/plugins/tests/var/proc_meminfo @@ -3,7 +3,7 @@ MemFree: 1693508 kB MemAvailable: 23807480 kB Buffers: 438456 kB Cached: 19124976 kB -SwapCached: 136 kB +SwapCached: 0 kB Active: 7860680 kB Inactive: 18886776 kB Active(anon): 6108756 kB @@ -13,7 +13,7 @@ Inactive(file): 17522276 kB Unevictable: 8548 kB Mlocked: 8548 kB SwapTotal: 33431548 kB -SwapFree: 33428732 kB +SwapFree: 33431548 kB Zswap: 0 kB Zswapped: 0 kB Dirty: 784 kB -- cgit v1.2.3-74-g34f1