The way that nwfilterxml2firewalltest works is: it loads a
NWFilter XML from a file, parses it and then calls
ebiptablesApplyNewRules() recording all commands that would be
executed when instantiating the rule. This is then compared to
expected output.
But the very first thing that ebiptablesApplyNewRules() does, it
calls qsort() to sort the rules. But with new glibc, qsort() is
not stable anymore and thus the order in which two rules with
equal priorities are applied is not guaranteed.
Use qsort() from virqsortmock which produces stable results.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/nwfilterxml2firewalltest.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewalltest.c
index b78b1b7947..8dadc50054 100644
--- a/tests/nwfilterxml2firewalltest.c
+++ b/tests/nwfilterxml2firewalltest.c
@@ -461,7 +461,9 @@ mymain(void)
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
-VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virfirewall"))
+VIR_TEST_MAIN_PRELOAD(mymain,
+ VIR_TEST_MOCK("virqsort"),
+ VIR_TEST_MOCK("virfirewall"))
#else /* ! defined (__linux__) */
--
2.41.0