summaryrefslogtreecommitdiffstats
path: root/plugins/tests
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2024-01-04 02:37:26 +0100
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2024-01-04 02:37:26 +0100
commit735b04eff721a28e791714c0da4c8ac5726bfbcf (patch)
tree2514aeacf0ad70a3ffe3918a1e349b9014fd105e /plugins/tests
parent1d669e47eb9e6971b266d451274c02c5203b1906 (diff)
downloadmonitoring-plugins-735b04eff721a28e791714c0da4c8ac5726bfbcf.tar.gz
Fix tests
Diffstat (limited to 'plugins/tests')
-rw-r--r--plugins/tests/test_check_swap.c3
-rwxr-xr-x[-rw-r--r--]plugins/tests/test_check_swap.t2
-rw-r--r--plugins/tests/var/proc_meminfo4
3 files changed, 4 insertions, 5 deletions
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) {
10const char *progname = "test_check_swap"; 10const char *progname = "test_check_swap";
11 11
12int main() { 12int main() {
13
14 swap_config config = swap_config_init(); 13 swap_config config = swap_config_init();
15 14
16 swap_result test_data = getSwapFromProcMeminfo(config, "./var/proc_meminfo"); 15 swap_result test_data = getSwapFromProcMeminfo(config, "./var/proc_meminfo");
@@ -19,6 +18,6 @@ int main() {
19 18
20 ok(test_data.errorcode == 0, "Test whether we manage to retrieve swap data"); 19 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"); 20 ok(test_data.metrics.total == 34233905152, "Is the total Swap correct");
22 ok(test_data.metrics.free == 34231021568, "Is the free Swap correct"); 21 ok(test_data.metrics.free == 34233905152, "Is the free Swap correct");
23 ok(test_data.metrics.used == 0, "Is the used Swap correct"); 22 ok(test_data.metrics.used == 0, "Is the used Swap correct");
24} 23}
diff --git a/plugins/tests/test_check_swap.t b/plugins/tests/test_check_swap.t
index 97c651a8..826fae01 100644..100755
--- a/plugins/tests/test_check_swap.t
+++ b/plugins/tests/test_check_swap.t
@@ -1,6 +1,6 @@
1#!/usr/bin/perl 1#!/usr/bin/perl
2use Test::More; 2use Test::More;
3if (! -e "./test_check_swap") { 3if (! -e "./test_check_swap") {
4 plan skip_all => "./test_swap not compiled - please enable libtap library to test"; 4 plan skip_all => "./test_check_swap not compiled - please enable libtap library to test";
5} 5}
6exec "./test_check_swap"; 6exec "./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
3MemAvailable: 23807480 kB 3MemAvailable: 23807480 kB
4Buffers: 438456 kB 4Buffers: 438456 kB
5Cached: 19124976 kB 5Cached: 19124976 kB
6SwapCached: 136 kB 6SwapCached: 0 kB
7Active: 7860680 kB 7Active: 7860680 kB
8Inactive: 18886776 kB 8Inactive: 18886776 kB
9Active(anon): 6108756 kB 9Active(anon): 6108756 kB
@@ -13,7 +13,7 @@ Inactive(file): 17522276 kB
13Unevictable: 8548 kB 13Unevictable: 8548 kB
14Mlocked: 8548 kB 14Mlocked: 8548 kB
15SwapTotal: 33431548 kB 15SwapTotal: 33431548 kB
16SwapFree: 33428732 kB 16SwapFree: 33431548 kB
17Zswap: 0 kB 17Zswap: 0 kB
18Zswapped: 0 kB 18Zswapped: 0 kB
19Dirty: 784 kB 19Dirty: 784 kB