From eac6f2b0a2b0efec6faa847c4e3c8044defa1774 Mon Sep 17 00:00:00 2001 From: Chris-Savinovich Date: Wed, 4 Sep 2019 16:19:55 -0500 Subject: [PATCH] test_utils.c: Skip test adsi_loaded_test if module not loaded. Module res_adsi.so is deprecated, therefore it does not load by default. Module not loaded causes it to yield a FAIL when tested by tests/test_utils.c. This fix checks if the corresponding module is loaded at the start of the test, and if not, it passes the test and exits with a message. This fix is applied to all versions where the module is marked deprecated. Change-Id: I52be64c8f6af222e15148a856d1f10cb113e1e94 --- tests/CI/buildAsterisk.sh | 2 -- tests/test_utils.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/CI/buildAsterisk.sh b/tests/CI/buildAsterisk.sh index adbc3b0964..8582d0489f 100755 --- a/tests/CI/buildAsterisk.sh +++ b/tests/CI/buildAsterisk.sh @@ -123,8 +123,6 @@ if [ $NO_MENUSELECT -eq 0 ] ; then cat_enables+=" MENUSELECT_BRIDGES MENUSELECT_CEL MENUSELECT_CDR" cat_enables+=" MENUSELECT_CHANNELS MENUSELECT_CODECS MENUSELECT_FORMATS MENUSELECT_FUNCS" cat_enables+=" MENUSELECT_PBX MENUSELECT_RES MENUSELECT_UTILS" - else - mod_disables+="test_utils" fi runner menuselect/menuselect `gen_cats enable $cat_enables` menuselect.makeopts diff --git a/tests/test_utils.c b/tests/test_utils.c index f5586d3f70..1005f2334e 100644 --- a/tests/test_utils.c +++ b/tests/test_utils.c @@ -343,6 +343,11 @@ AST_TEST_DEFINE(adsi_loaded_test) break; } + if (!ast_module_check("res_adsi.so")) { + ast_test_status_update(test, "This test skipped because deprecated module res_adsi.so is not built by default.\n"); + return AST_TEST_PASS; + } + if (!(c = ast_dummy_channel_alloc())) { return AST_TEST_FAIL; }