[svn-commits] kmoore: trunk r371396 - in /trunk: ./ main/loader.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 16 17:45:37 CDT 2012


Author: kmoore
Date: Thu Aug 16 17:45:33 2012
New Revision: 371396

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=371396
Log:
Add module reload instrumentation for TEST_FRAMEWORK

This adds AMI events for module reloads when Asterisk is built with
TEST_FRAMEWORK enabled and corrects generation of the module load AMI
event.

(issue PQ-1126)
........

Merged revisions 371393 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 371394 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 371395 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/main/loader.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-11-merged (original)
+++ branch-11-merged Thu Aug 16 17:45:33 2012
@@ -1,1 +1,1 @@
-/branches/11:1-371121,371143,371146,371200,371227,371258,371272,371295,371324,371355,371382
+/branches/11:1-371121,371143,371146,371200,371227,371258,371272,371295,371324,371355,371382,371395

Modified: trunk/main/loader.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/loader.c?view=diff&rev=371396&r1=371395&r2=371396
==============================================================================
--- trunk/main/loader.c (original)
+++ trunk/main/loader.c Thu Aug 16 17:45:33 2012
@@ -750,6 +750,8 @@
 		}
 
 		if (!info->reload) {	/* cannot be reloaded */
+			/* Nothing to reload, so reload is successful */
+			ast_test_suite_event_notify("MODULE_RELOAD", "Message: %s", cur->resource);
 			if (res < 1)	/* store result if possible */
 				res = 1;	/* 1 = no reload() method */
 			continue;
@@ -757,7 +759,9 @@
 
 		res = 2;
 		ast_verb(3, "Reloading module '%s' (%s)\n", cur->resource, info->description);
-		info->reload();
+		if (!info->reload()) {
+			ast_test_suite_event_notify("MODULE_RELOAD", "Message: %s", cur->resource);
+		}
 	}
 	AST_LIST_UNLOCK(&module_list);
 
@@ -910,7 +914,9 @@
 	int res;
 	AST_LIST_LOCK(&module_list);
 	res = load_resource(resource_name, 0, NULL, 0);
-	ast_test_suite_event_notify("MODULE_LOAD", "Message: %s", resource_name);
+	if (!res) {
+		ast_test_suite_event_notify("MODULE_LOAD", "Message: %s", resource_name);
+	}
 	AST_LIST_UNLOCK(&module_list);
 
 	return res;




More information about the svn-commits mailing list