You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2013/05/20 19:44:28 UTC

svn commit: r1484539 - in /incubator/ambari/trunk: ./ ambari-web/app/controllers/main/admin/security/ ambari-web/app/controllers/main/admin/security/add/ ambari-web/app/data/ ambari-web/app/templates/main/service/ ambari-web/app/views/main/service/

Author: jaimin
Date: Mon May 20 17:44:28 2013
New Revision: 1484539

URL: http://svn.apache.org/r1484539
Log:
AMBARI-2163. Add smoke tests as part of starting all services in security wizard. (jaimin)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step3.js
    incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/disable.js
    incubator/ambari/trunk/ambari-web/app/data/secure_properties.js
    incubator/ambari/trunk/ambari-web/app/templates/main/service/reconfigure.hbs
    incubator/ambari/trunk/ambari-web/app/views/main/service/reconfigure.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1484539&r1=1484538&r2=1484539&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Mon May 20 17:44:28 2013
@@ -12,6 +12,9 @@ Trunk (unreleased changes):
 
  NEW FEATURES
 
+ AMBARI-2163. Add smoke tests as part of starting all services in
+ security wizard. (jaimin)
+
  AMBARI-2140. Improve Ambari-agent test coverage. (swagle)
 
  AMBARI-2133. Add Nagios alerts for Hadoop 2.0 in Ambari. (swagle)

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step3.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step3.js?rev=1484539&r1=1484538&r2=1484539&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step3.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step3.js Mon May 20 17:44:28 2013
@@ -77,7 +77,7 @@ App.MainAdminSecurityAddStep3Controller 
         newService.hosts.push({
           name: name,
           publicName: name,
-          logTasks: stages.polledData.filterProperty("Tasks.host_name",name)
+          logTasks: stages.polledData.filterProperty("Tasks.host_name", name)
         });
       });
       services.push(newService);
@@ -102,13 +102,8 @@ App.MainAdminSecurityAddStep3Controller 
       } else if (currentStage && currentStage.get('stage') === 'stage3') {
         if (App.testMode) {
           currentStage.set('isSuccess', true);
-          currentStage.set('isCompleted', true);
-          this.moveToNextStage();
         } else {
-          var self = this;
-          window.setTimeout(function () {
-            self.loadClusterConfigs();
-          }, 12000);
+          this.loadClusterConfigs();
         }
       }
     }
@@ -117,12 +112,9 @@ App.MainAdminSecurityAddStep3Controller 
   onCompleteStage: function () {
     var index = this.get('stages').filterProperty('isCompleted', true).length;
     if (index > 0) {
-      var self = this;
       var lastCompletedStageResult = this.get('stages').objectAt(index - 1).get('isSuccess');
       if (lastCompletedStageResult) {
-        window.setTimeout(function () {
-          self.moveToNextStage();
-        }, 50);
+        this.moveToNextStage();
       }
     }
   }.observes('stages.@each.isCompleted'),
@@ -136,7 +128,6 @@ App.MainAdminSecurityAddStep3Controller 
 
   addInfoToStages: function () {
     this.addInfoToStage2();
-    this.addInfoToStage3();
     this.addInfoToStage4();
   },
 
@@ -157,13 +148,9 @@ App.MainAdminSecurityAddStep3Controller 
     stage2.set('data', data);
   },
 
-  addInfoToStage3: function () {
-
-  },
-
   addInfoToStage4: function () {
     var stage4 = this.get('stages').findProperty('stage', 'stage4');
-    var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
+    var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services?params/run_smoke_test=true';
     var data = '{"RequestInfo": {"context": "' + Em.I18n.t('requestInfo.startAllServices') + '"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}';
     stage4.set('url', url);
     stage4.set('data', data);
@@ -343,7 +330,7 @@ App.MainAdminSecurityAddStep3Controller 
       serviceUsers.pushObject({id: 'puppet var', name: 'hbase_user', value: 'hbase'});
       serviceUsers.pushObject({id: 'puppet var', name: 'hive_user', value: 'hive'});
     } else {
-      App.router.get('mainAdminSecurityController').getSecurityStatusFromServer();
+      App.router.get('mainAdminSecurityController').setSecurityStatus();
     }
   },
 
@@ -425,7 +412,6 @@ App.MainAdminSecurityAddStep3Controller 
     if (this.get('noOfWaitingAjaxCalls') == 0) {
       var currentStage = this.get('stages').findProperty('stage', 'stage3');
       currentStage.set('isSuccess', true);
-      currentStage.set('isCompleted', true);
     }
   },
 

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/disable.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/disable.js?rev=1484539&r1=1484538&r2=1484539&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/disable.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/disable.js Mon May 20 17:44:28 2013
@@ -84,10 +84,7 @@ App.MainAdminSecurityDisableController =
           currentStage.set('isCompleted', true);
           this.moveToNextStage();
         } else {
-          var self = this;
-          window.setTimeout(function () {
-            self.loadClusterConfigs();
-          }, 12000);
+          this.loadClusterConfigs();
         }
       }
     }
@@ -96,10 +93,9 @@ App.MainAdminSecurityDisableController =
   onCompleteStage: function () {
     var index = this.get('stages').filterProperty('isCompleted', true).length;
     if (index > 0) {
-      var self = this;
       var lastCompletedStageResult = this.get('stages').objectAt(index - 1).get('isSuccess');
       if (lastCompletedStageResult) {
-        self.moveToNextStage();
+        this.moveToNextStage();
       }
     }
   }.observes('stages.@each.isCompleted'),
@@ -127,7 +123,6 @@ App.MainAdminSecurityDisableController =
 
   addInfoToStages: function () {
     this.addInfoToStage2();
-    this.addInfoToStage3();
     this.addInfoToStage4();
   },
 
@@ -148,13 +143,9 @@ App.MainAdminSecurityDisableController =
     stage2.set('data', data);
   },
 
-  addInfoToStage3: function () {
-
-  },
-
   addInfoToStage4: function () {
     var stage4 = this.get('stages').findProperty('stage', 'stage4');
-    var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
+    var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services?params/run_smoke_test=true';
     var data = '{"RequestInfo": {"context": "' + Em.I18n.t('requestInfo.startAllServices') + '"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}';
     stage4.set('url', url);
     stage4.set('data', data);
@@ -277,7 +268,6 @@ App.MainAdminSecurityDisableController =
     if (this.get('noOfWaitingAjaxCalls') == 0) {
       var currentStage = this.get('stages').findProperty('stage', 'stage3');
       currentStage.set('isSuccess', true);
-      currentStage.set('isCompleted', true);
     }
   },
 
@@ -322,9 +312,6 @@ App.MainAdminSecurityDisableController =
               case 'zookeeper.znode.parent':
                 _serviceConfigTags.configs[configName] = '/hbase-unsecure';
                 break;
-              case 'oozie.service.AuthorizationService.authorization.enabled':
-                _serviceConfigTags.configs[configName] = 'false';
-                break;
               default:
                 delete _serviceConfigTags.configs[configName];
             }

Modified: incubator/ambari/trunk/ambari-web/app/data/secure_properties.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/secure_properties.js?rev=1484539&r1=1484538&r2=1484539&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/secure_properties.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/secure_properties.js Mon May 20 17:44:28 2013
@@ -23,7 +23,7 @@ module.exports =
       "name": "security_enabled",
       "displayName": "Enable security",
       "value": "",
-      "defaultValue": "true",
+      "defaultValue":true,
       "description": "Enable kerberos security for the cluster",
       "isVisible": false,
       "isOverridable": false,

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/service/reconfigure.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/service/reconfigure.hbs?rev=1484539&r1=1484538&r2=1484539&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/service/reconfigure.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/service/reconfigure.hbs Mon May 20 17:44:28 2013
@@ -21,11 +21,11 @@
     {{#each stage in controller.stages}}
       {{#view App.StageStatusView}}
       <td>
-        {{#if controller.hasHostPopup}}
+        {{#if stage.isPolling}}
           <a  href="javascript:void(0)" {{action "showHostPopup" stage.label target="view"}}>
         {{/if}}
         <p {{bindAttr class="stage.hasStarted::faintText"}}>{{stage.label}}</p>
-        {{#if controller.hasHostPopup}}
+        {{#if stage.isPolling}}
           </a>
         {{/if}}
       </td>

Modified: incubator/ambari/trunk/ambari-web/app/views/main/service/reconfigure.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/reconfigure.js?rev=1484539&r1=1484538&r2=1484539&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/service/reconfigure.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/service/reconfigure.js Mon May 20 17:44:28 2013
@@ -19,7 +19,7 @@ var App = require('app');
 
 App.MainServiceReconfigureView = Em.View.extend({
 
-  templateName: require('templates/main/service/reconfigure'),
+  templateName: require('templates/main/service/reconfigure')
 
 });