site_properties_test.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var App = require('app');
  19. require('utils/helper');
  20. var siteProperties = require('data/HDP2.2/site_properties').configProperties;
  21. describe('hdp2SiteProperties', function () {
  22. /**
  23. * @stackProperties: All the properties that are derived from stack definition
  24. */
  25. var stackProperties = siteProperties.filter(function(item){
  26. return (!(item.isRequiredByAgent === false || item.filename === 'alert_notification' || item.category === 'Ambari Principals' || item.name === 'oozie_hostname'))
  27. });
  28. stackProperties.forEach(function(siteProperty){
  29. /**
  30. * Following config attributes are stack driven and should be defined in the stack metainfo instead of ambari-web site-properties file
  31. * isVisible
  32. * isOverridable
  33. * value
  34. * recommendedValue
  35. * isReconfigurable
  36. * isRequired
  37. * displayName
  38. * description
  39. * showLabel
  40. * unit
  41. */
  42. it('Check attributes of "' + siteProperty.filename + '/' + siteProperty.name + '"' + '. Stack driven attributes should be undefined ', function () {
  43. expect(siteProperty.isVisible).to.equal(undefined);
  44. expect(siteProperty.value).to.equal(undefined);
  45. expect(siteProperty.recommendedValue).to.equal(undefined);
  46. expect(siteProperty.description).to.equal(undefined);
  47. expect(siteProperty.isReconfigurable).to.equal(undefined);
  48. expect(siteProperty.isRequired).to.equal(undefined);
  49. expect(siteProperty.displayName).to.equal(undefined);
  50. expect(siteProperty.showLabel).to.equal(undefined);
  51. expect(siteProperty.unit).to.equal(undefined);
  52. });
  53. /**
  54. * Following config attributes uniquely represent a config property
  55. * name
  56. * filename
  57. */
  58. it('Check primary attributes of "' + siteProperty.filename + '/' + siteProperty.name + '"' + '. Attributes that uniquely represent a property should be defined ', function () {
  59. expect(siteProperty.name).to.not.equal(undefined);
  60. expect(siteProperty.filename).to.not.equal(undefined);
  61. });
  62. });
  63. });