[tests] False-negative results of test `statschannel`
System tests statschannel
are conditional and depend on build
options, e.g. they may require libxml2
or libjson-c
. Those
conditions are checked with the help of feature-test
tool which
exits with 0
code in case of enabled feature and 1
otherwise.
Pytest markers have_libxml2
and have_json_c
have wrong skip
condition, i.e. a test will be skipped if the build has feature.
Thereby,
- upstream unintentionally skip these tests
- xml/json test false-negatively fail against builds without corresponging feature
Example of the fix:
--- a/bin/tests/system/pytest_custom_markers.py
+++ b/bin/tests/system/pytest_custom_markers.py
@@ -34,9 +34,9 @@ def feature_test(feature):
have_libxml2 = pytest.mark.skipif(
- feature_test("--have-libxml2"), reason="libxml2 support disabled in the build"
+ not feature_test("--have-libxml2"), reason="libxml2 support disabled in the build"
)
have_json_c = pytest.mark.skipif(
- feature_test("--have-json-c"), reason="json-c support disabled in the build"
+ not feature_test("--have-json-c"), reason="json-c support disabled in the build"
)