diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-10-18 12:05:10 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-10-18 12:05:10 +0000 |
commit | 450ad346edcf2304087ffa74a46eef274336c16b (patch) | |
tree | 02855674d2d5c1f891095e25be4f8818e8bdfed8 /lib | |
parent | c56c42b9c999742ff3cfebf1cadc8c93ad68048c (diff) | |
download | monitoring-plugins-450ad346edcf2304087ffa74a46eef274336c16b.tar.gz |
Fix tests for exact matches when searching filesystems
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1497 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tests/test_disk.c | 13 | ||||
-rw-r--r-- | lib/utils_disk.h | 1 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/tests/test_disk.c b/lib/tests/test_disk.c index 8940236b..e48b30aa 100644 --- a/lib/tests/test_disk.c +++ b/lib/tests/test_disk.c @@ -36,7 +36,7 @@ main (int argc, char **argv) struct mount_entry *me; struct mount_entry **mtail = &dummy_mount_list; - plan_tests(17); + plan_tests(18); ok( np_find_name(exclude_filesystem, "/var/log") == FALSE, "/var/log not in list"); np_add_name(&exclude_filesystem, "/var/log"); @@ -105,17 +105,20 @@ main (int argc, char **argv) np_add_parameter(&paths, "/var"); np_add_parameter(&paths, "/tmp"); np_add_parameter(&paths, "/home/tonvoon"); + np_add_parameter(&paths, "/home"); np_set_best_match(paths, dummy_mount_list, TRUE); for (p = paths; p; p = p->name_next) { if (! strcmp(p->name, "/home/groups")) { - ok( p->found == 0, "/home/groups correctly not found"); + ok( ! p->best_match , "/home/groups correctly not found"); } else if (! strcmp(p->name, "/var")) { - ok( p->found == 1, "/var found"); + ok( p->best_match, "/var found"); } else if (! strcmp(p->name, "/tmp")) { - ok( p->found == 0, "/tmp correctly not found"); + ok(! p->best_match, "/tmp correctly not found"); } else if (! strcmp(p->name, "/home/tonvoon")) { - ok( p->found == 0, "/home/tonvoon not found"); + ok(! p->best_match, "/home/tonvoon not found"); + } else if (! strcmp(p->name, "/home")) { + ok( p->best_match, "/home found"); } } diff --git a/lib/utils_disk.h b/lib/utils_disk.h index 928fdbe5..700f5d26 100644 --- a/lib/utils_disk.h +++ b/lib/utils_disk.h @@ -12,7 +12,6 @@ struct name_list struct parameter_list { char *name; - int found; thresholds *freespace_bytes; thresholds *freespace_units; thresholds *freespace_percent; |