[monitoring-plugins] Remove binary accident (#2305)
GitHub
git at monitoring-plugins.org
Wed Jul 29 15:00:13 CEST 2026
Module: monitoring-plugins
Branch: master
Commit: e186f28522992ac2e036f04bbd40faa8dec0982a
Author: Lorenz Kästle <12514511+RincewindsHat at users.noreply.github.com>
Committer: GitHub <noreply at github.com>
Date: Wed Jul 29 14:52:18 2026 +0200
URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=e186f285
Remove binary accident (#2305)
* Remove accidentaly git commited binary from repo.
* Repair and adapt the missing tests
---
.gitignore | 1 +
configure.ac | 2 +-
lib/output.c | 2 +-
lib/tests/test_generic_output | Bin 143808 -> 0 bytes
lib/tests/test_generic_output.c | 25 +++++++++++--------------
5 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/.gitignore b/.gitignore
index 4d49c220..da5b6970 100644
--- a/.gitignore
+++ b/.gitignore
@@ -125,6 +125,7 @@ NP-VERSION-FILE
/lib/tests/test_cmd
/lib/tests/test_tcp
/lib/tests/test_utils
+/lib/tests/test_generic_output
/lib/tests/utils_base.Po
/lib/tests/utils_cmd.Po
/lib/tests/utils_disk.Po
diff --git a/configure.ac b/configure.ac
index 7da7456f..7c2e0c79 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,7 +181,7 @@ fi
# Finally, define tests if we use libtap
if test "$enable_libtap" = "yes" ; then
- EXTRA_TEST="test_utils test_tcp test_cmd test_base64"
+ EXTRA_TEST="test_utils test_tcp test_cmd test_base64 test_generic_output"
AC_SUBST(EXTRA_TEST)
EXTRA_PLUGIN_TESTS="tests/test_check_swap tests/test_check_disk"
diff --git a/lib/output.c b/lib/output.c
index b1e91231..43a5d078 100644
--- a/lib/output.c
+++ b/lib/output.c
@@ -495,7 +495,7 @@ static inline char *fmt_subcheck_output(mp_output_format output_format, mp_subch
// add the rest (if any)
if (have_residual_chars) {
char *tmp = check.output;
- xasprintf(&check.output, "%s%s%s", intermediate_string,
+ asprintf(&check.output, "%s%s%s", intermediate_string,
generate_indentation_string(indentation + 1), tmp);
} else {
check.output = intermediate_string;
diff --git a/lib/tests/test_generic_output b/lib/tests/test_generic_output
deleted file mode 100755
index 51e299a0..00000000
Binary files a/lib/tests/test_generic_output and /dev/null differ
diff --git a/lib/tests/test_generic_output.c b/lib/tests/test_generic_output.c
index e4a78bcd..61bcf130 100644
--- a/lib/tests/test_generic_output.c
+++ b/lib/tests/test_generic_output.c
@@ -62,8 +62,8 @@ void test_one_subcheck(void) {
// diag("Formatted output");
// diag(output);
- char expected[] = "[WARNING] - ok=0, warning=1, critical=0, unknown=0\n"
- "\t\\_[WARNING] - foobar\n";
+ char expected[] = "[WARNING] - foobar\n"
+ "\t\\_[WARNING] - foobar";
// diag("Expected output");
// diag(expected);
@@ -88,7 +88,7 @@ void test_perfdata_formatting2(void) {
char *result = pd_list_to_string(*tmp);
- ok(strcmp(result, "foo=23;;; bar=1;;;") == 0, "Perfdata string formatting");
+ ok(strcmp(result, "'foo'=23;;; 'bar'=1;;;") == 0, "Perfdata string formatting, part two");
}
void test_perfdata_formatting(void) {
@@ -101,7 +101,7 @@ void test_perfdata_formatting(void) {
char *pd_string = pd_to_string(pd1);
- ok(strcmp(pd_string, "foo=23s;;;") == 0, "Perfdata string formatting");
+ ok(strcmp(pd_string, "'foo'=23s;;;") == 0, "Perfdata string formatting");
}
void test_two_subchecks(void) {
@@ -145,15 +145,14 @@ void test_two_subchecks(void) {
ok(output != NULL, "Output should not be NULL");
- char expected[] = "[WARNING] - ok=0, warning=1, critical=0, unknown=0\n"
+ char expected[] = "[WARNING] - foobar\n"
"\t\\_[WARNING] - foobar\n"
- "\t\t\\_[OK] - baz\n"
- "|foo=23s;;; \n";
+ "\t\t\\_[OK] - baz|'foo'=23s;;; ";
// diag("Expected output. Length: %u", strlen(expected));
// diag(expected);
- ok(strcmp(output, expected) == 0, "Output is as expected");
+ ok(strcmp(output, expected) == 0, "More complex example with two subchecks");
}
void test_deep_check_hierarchy(void) {
@@ -203,12 +202,11 @@ void test_deep_check_hierarchy(void) {
ok(output != NULL, "Output should not be NULL");
- char expected[] = "[WARNING] - ok=0, warning=1, critical=0, unknown=0\n"
+ char expected[] = "[WARNING] - foobar\n"
"\t\\_[WARNING] - foobar\n"
"\t\t\\_[OK] - baz\n"
"\t\t\t\\_[OK] - level3\n"
- "\t\t\t\t\\_[OK] - level4\n"
- "|foo=23s;;; \n";
+ "\t\t\t\t\\_[OK] - level4|'foo'=23s;;; ";
size_t expected_length = strlen(expected);
@@ -273,12 +271,11 @@ void test_deep_check_hierarchy2(void) {
ok(output != NULL, "Output should not be NULL");
- char expected[] = "[WARNING] - ok=0, warning=1, critical=0, unknown=0\n"
+ char expected[] = "[WARNING] - foobar\n"
"\t\\_[WARNING] - foobar\n"
"\t\t\\_[OK] - baz\n"
"\t\t\t\\_[OK] - level3\n"
- "\t\t\t\t\\_[OK] - level4\n"
- "|foo=23s;;; baz=1024B;;; floatMe=1024.102400;;; \n";
+ "\t\t\t\t\\_[OK] - level4|'foo'=23s;;; 'baz'=1024B;;; 'floatMe'=1024.102400;;; ";
// diag("Expected output of length: %i", strlen(expected));
// diag(expected);
More information about the Commits
mailing list