> On Feb. 9, 2014, 4:35 a.m., Mahadev Konar wrote: > > ambari-server/src/main/resources/custom_actions/nagios_update_ignore.py, > > line 10 > > <https://reviews.apache.org/r/17751/diff/2/?file=481028#file481028line10> > > > > Can we add unit tests for this file? A separate jira is fine as well. > > Nate Cole wrote: > Will add a separate JIRA, as will need to consult with Sumit on how we > test custom actions.
The tests have to be written in two parts (not unlike another commands): * Server side can test that a request is created with proper parameters. In this case, you can add the check to test that set PASSIVE state to check that an additional HostRoleCommand is created. * A python unit test similar to tests in ambari-server/src/test/python/ to test the custom action script - Sumit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/17751/#review34027 ----------------------------------------------------------- On Feb. 8, 2014, 2:32 p.m., Nate Cole wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/17751/ > ----------------------------------------------------------- > > (Updated Feb. 8, 2014, 2:32 p.m.) > > > Review request for Ambari, Mahadev Konar, Sumit Mohanty, and Sid Wagle. > > > Bugs: AMBARI-4528 > https://issues.apache.org/jira/browse/AMBARI-4528 > > > Repository: ambari > > > Description > ------- > > Change description: > * Added a custom action to create a "suppression list" on the Nagios server > when marking PASSIVE. > * Added a Nagios wrapper script to check return results against the > suppression list > * Return the actual return value for any script that is wrapped, using the > Nagios long_plugin_output format > * Change the nagios addon to support returning long_plugin_output > * In the alert structure, supply the actual_result for use in the UI > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java > c06c92c > > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java > 0efc935 > > ambari-server/src/main/java/org/apache/ambari/server/controller/PassiveAlertHelper.java > PRE-CREATION > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java > 1eb9a8a > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java > 1145b1b > > ambari-server/src/main/java/org/apache/ambari/server/controller/nagios/NagiosAlert.java > d456f78 > > ambari-server/src/main/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProvider.java > 0b05422 > > ambari-server/src/main/resources/custom_action_definitions/system_action_definitions.xml > ee07900 > ambari-server/src/main/resources/custom_actions/nagios_update_ignore.py > PRE-CREATION > > ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/files/check_aggregate.php > f4063fb > > ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/files/check_wrapper.sh > PRE-CREATION > > ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/nagios.py > 36f6622 > > ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/nagios_server_config.py > 9f6c884 > > ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-commands.cfg.j2 > 99870d0 > > ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-services.cfg.j2 > 793732e > > ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/files/check_aggregate.php > f4063fb > > ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/files/check_wrapper.sh > PRE-CREATION > > ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/nagios.py > 36f6622 > > ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/nagios_server_config.py > 9f6c884 > > ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-commands.cfg.j2 > 99870d0 > > ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2 > b9f0892 > > ambari-server/src/test/java/org/apache/ambari/server/controller/PassiveAlertHelperTest.java > PRE-CREATION > > ambari-server/src/test/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProviderTest.java > 0b8e6cc > ambari-server/src/test/resources/nagios_alerts.txt 196a2fd > contrib/addons/src/addOns/nagios/scripts/nagios_alerts.php 8ebf16c > > Diff: https://reviews.apache.org/r/17751/diff/ > > > Testing > ------- > > New test: > Running org.apache.ambari.server.controller.PassiveAlertHelperTest > Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.239 sec > > Server tests: > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 12:28.154s > [INFO] Finished at: Wed Feb 05 10:43:05 PST 2014 > [INFO] Final Memory: 19M/123M > [INFO] > ------------------------------------------------------------------------ > > > Thanks, > > Nate Cole > >
