step9_test.js 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198
  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 Ember = require('ember');
  19. var App = require('app');
  20. require('models/stack_service_component');
  21. require('models/hosts');
  22. require('controllers/wizard/step9_controller');
  23. require('utils/helper');
  24. var modelSetup = require('test/init_model_test');
  25. describe('App.InstallerStep9Controller', function () {
  26. beforeEach(function(){
  27. modelSetup.setupStackServiceComponent()
  28. });
  29. afterEach(function(){
  30. modelSetup.cleanStackServiceComponent();
  31. })
  32. describe('#isSubmitDisabled', function () {
  33. var tests = Em.A([
  34. {controllerName: 'addHostController', state: 'STARTED', e: false},
  35. {controllerName: 'addHostController', state: 'START FAILED', e: false},
  36. {controllerName: 'addHostController', state: 'INSTALL FAILED', e: false},
  37. {controllerName: 'addHostController', state: 'PENDING', e: true},
  38. {controllerName: 'addHostController', state: 'INSTALLED', e: true},
  39. {controllerName: 'addServiceController', state: 'STARTED', e: false},
  40. {controllerName: 'addServiceController', state: 'START FAILED', e: false},
  41. {controllerName: 'addServiceController', state: 'INSTALL FAILED', e: false},
  42. {controllerName: 'addServiceController', state: 'PENDING', e: true},
  43. {controllerName: 'addServiceController', state: 'INSTALLED', e: true},
  44. {controllerName: 'installerController', state: 'STARTED', e: false},
  45. {controllerName: 'installerController', state: 'START FAILED', e: false},
  46. {controllerName: 'installerController', state: 'INSTALL FAILED', e: true},
  47. {controllerName: 'installerController', state: 'INSTALLED', e: true},
  48. {controllerName: 'installerController', state: 'PENDING', e: true}
  49. ]);
  50. tests.forEach(function (test) {
  51. var controller = App.WizardStep9Controller.create({
  52. content: {
  53. controllerName: test.controllerName,
  54. cluster: {
  55. status: test.state
  56. }
  57. }
  58. });
  59. it('controllerName is ' + test.controllerName + '; cluster status is ' + test.state + '; isSubmitDisabled should be ' + test.e, function () {
  60. expect(controller.get('isSubmitDisabled')).to.equal(test.e);
  61. });
  62. });
  63. });
  64. describe('#status', function () {
  65. var tests = Em.A([
  66. {
  67. hosts: [
  68. {status: 'failed'},
  69. {status: 'success'}
  70. ],
  71. isStepFailed: false,
  72. progress: '100',
  73. m: 'One host is failed',
  74. e: 'failed'
  75. },
  76. {
  77. hosts: [
  78. {status: 'warning'},
  79. {status: 'success'}
  80. ],
  81. m: 'One host is failed and step is not failed',
  82. isStepFailed: false,
  83. progress: '100',
  84. e: 'warning'
  85. },
  86. {
  87. hosts: [
  88. {status: 'warning'},
  89. {status: 'success'}
  90. ],
  91. m: 'One host is failed and step is failed',
  92. isStepFailed: true,
  93. progress: '100',
  94. e: 'failed'
  95. },
  96. {
  97. hosts: [
  98. {status: 'success'},
  99. {status: 'success'}
  100. ],
  101. m: 'All hosts are success and progress is 100',
  102. isStepFailed: false,
  103. progress: '100',
  104. e: 'success'
  105. },
  106. {
  107. hosts: [
  108. {status: 'success'},
  109. {status: 'success'}
  110. ],
  111. m: 'All hosts are success and progress is 50',
  112. isStepFailed: false,
  113. progress: '50',
  114. e: 'info'
  115. }
  116. ]);
  117. tests.forEach(function (test) {
  118. var controller = App.WizardStep9Controller.create({hosts: test.hosts, isStepFailed: function () {
  119. return test.isStepFailed
  120. }, progress: test.progress});
  121. controller.updateStatus();
  122. it(test.m, function () {
  123. expect(controller.get('status')).to.equal(test.e);
  124. });
  125. });
  126. });
  127. describe('#showRetry', function () {
  128. it('cluster status is not INSTALL FAILED', function () {
  129. var controller = App.WizardStep9Controller.create({content: {cluster: {status: 'INSTALLED'}}});
  130. expect(controller.get('showRetry')).to.equal(false);
  131. });
  132. it('cluster status is INSTALL FAILED', function () {
  133. var controller = App.WizardStep9Controller.create({content: {cluster: {status: 'INSTALL FAILED'}}});
  134. expect(controller.get('showRetry')).to.equal(true);
  135. });
  136. });
  137. describe('#resetHostsForRetry', function () {
  138. var hosts = {'host1': Em.Object.create({status: 'failed', message: 'Failed'}), 'host2': Em.Object.create({status: 'success', message: 'Success'})};
  139. var controller = App.WizardStep9Controller.create({content: {hosts: hosts}});
  140. it('All should have status "pending" and message "Waiting"', function () {
  141. controller.resetHostsForRetry();
  142. for (var name in hosts) {
  143. if (hosts.hasOwnProperty(name)) {
  144. expect(controller.get('content.hosts')[name].get('status', 'pending')).to.equal('pending');
  145. expect(controller.get('content.hosts')[name].get('message', 'Waiting')).to.equal('Waiting');
  146. }
  147. }
  148. });
  149. });
  150. var hosts_for_load_and_render = {
  151. 'host1': {
  152. message: 'message1',
  153. status: 'unknown',
  154. progress: '1',
  155. logTasks: [
  156. {},
  157. {}
  158. ],
  159. bootStatus: 'REGISTERED'
  160. },
  161. 'host2': {
  162. message: '',
  163. status: 'failed',
  164. progress: '1',
  165. logTasks: [
  166. {},
  167. {}
  168. ],
  169. bootStatus: ''
  170. },
  171. 'host3': {
  172. message: '',
  173. status: 'waiting',
  174. progress: null,
  175. logTasks: [
  176. {},
  177. {}
  178. ],
  179. bootStatus: ''
  180. },
  181. 'host4': {
  182. message: 'message4',
  183. status: null,
  184. progress: '10',
  185. logTasks: [
  186. {}
  187. ],
  188. bootStatus: 'REGISTERED'
  189. }
  190. };
  191. describe('#loadHosts', function () {
  192. var controller = App.WizardStep9Controller.create({content: {hosts: hosts_for_load_and_render}});
  193. controller.loadHosts();
  194. var loaded_hosts = controller.get('hosts');
  195. it('Only REGISTERED hosts', function () {
  196. expect(loaded_hosts.length).to.equal(2);
  197. });
  198. it('All hosts have progress 0', function () {
  199. expect(loaded_hosts.everyProperty('progress', 0)).to.equal(true);
  200. });
  201. it('All hosts have progress 0', function () {
  202. expect(loaded_hosts.everyProperty('progress', 0)).to.equal(true);
  203. });
  204. it('All host don\'t have logTasks', function () {
  205. expect(loaded_hosts.everyProperty('logTasks.length', 0)).to.equal(true);
  206. });
  207. });
  208. describe('#hostHasClientsOnly', function () {
  209. var tests = Em.A([
  210. {
  211. hosts: [
  212. Em.Object.create({
  213. hostName: 'host1',
  214. logTasks: [
  215. {Tasks: {role: 'HDFS_CLIENT'}},
  216. {Tasks: {role: 'DATANODE'}}
  217. ],
  218. status: 'old_status',
  219. progress: '10',
  220. e: {status: 'old_status', progress: '10'}
  221. }),
  222. Em.Object.create({
  223. hostName: 'host2',
  224. logTasks: [
  225. {Tasks: {role: 'HDFS_CLIENT'}}
  226. ],
  227. status: 'old_status',
  228. progress: '10',
  229. e: {status: 'success', progress: '100'}
  230. })
  231. ],
  232. jsonError: false
  233. },
  234. {
  235. hosts: [
  236. Em.Object.create({
  237. hostName: 'host1',
  238. logTasks: [
  239. {Tasks: {role: 'HDFS_CLIENT'}},
  240. {Tasks: {role: 'DATANODE'}}
  241. ],
  242. status: 'old_status',
  243. progress: '10',
  244. e: {status: 'success', progress: '100'}
  245. }),
  246. Em.Object.create({
  247. hostName: 'host2',
  248. logTasks: [
  249. {Tasks: {role: 'HDFS_CLIENT'}}
  250. ],
  251. status: 'old_status',
  252. progress: '10',
  253. e: {status: 'success', progress: '100'}
  254. })
  255. ],
  256. jsonError: true
  257. }
  258. ]);
  259. tests.forEach(function (test) {
  260. it('', function () {
  261. var controller = App.WizardStep9Controller.create({hosts: test.hosts});
  262. controller.hostHasClientsOnly(test.jsonError);
  263. test.hosts.forEach(function (host) {
  264. expect(controller.get('hosts').findProperty('hostName', host.hostName).get('status')).to.equal(host.e.status);
  265. expect(controller.get('hosts').findProperty('hostName', host.hostName).get('progress')).to.equal(host.e.progress);
  266. });
  267. });
  268. });
  269. });
  270. describe('#onSuccessPerHost', function () {
  271. var tests = Em.A([
  272. {
  273. cluster: {status: 'INSTALLED'},
  274. host: Em.Object.create({status: 'pending'}),
  275. actions: [],
  276. e: {status: 'success'},
  277. m: 'No tasks for host'
  278. },
  279. {
  280. cluster: {status: 'INSTALLED'},
  281. host: Em.Object.create({status: 'info'}),
  282. actions: [
  283. {Tasks: {status: 'COMPLETED'}},
  284. {Tasks: {status: 'COMPLETED'}}
  285. ],
  286. e: {status: 'success'},
  287. m: 'All Tasks COMPLETED and cluster status INSTALLED'
  288. },
  289. {
  290. cluster: {status: 'FAILED'},
  291. host: Em.Object.create({status: 'info'}),
  292. actions: [
  293. {Tasks: {status: 'COMPLETED'}},
  294. {Tasks: {status: 'COMPLETED'}}
  295. ],
  296. e: {status: 'info'},
  297. m: 'All Tasks COMPLETED and cluster status FAILED'
  298. },
  299. {
  300. cluster: {status: 'INSTALLED'},
  301. host: Em.Object.create({status: 'info'}),
  302. actions: [
  303. {Tasks: {status: 'FAILED'}},
  304. {Tasks: {status: 'COMPLETED'}}
  305. ],
  306. e: {status: 'info'},
  307. m: 'Not all Tasks COMPLETED and cluster status INSTALLED'
  308. },
  309. {
  310. cluster: {status: 'FAILED'},
  311. host: Em.Object.create({status: 'info'}),
  312. actions: [
  313. {Tasks: {status: 'FAILED'}},
  314. {Tasks: {status: 'COMPLETED'}}
  315. ],
  316. e: {status: 'info'},
  317. m: 'Not all Tasks COMPLETED and cluster status FAILED'
  318. }
  319. ]);
  320. tests.forEach(function (test) {
  321. var controller = App.WizardStep9Controller.create({content: {cluster: {status: test.cluster.status}}});
  322. controller.onSuccessPerHost(test.actions, test.host);
  323. it(test.m, function () {
  324. expect(test.host.status).to.equal(test.e.status);
  325. });
  326. });
  327. });
  328. describe('#onErrorPerHost', function () {
  329. var tests = Em.A([
  330. {
  331. cluster: {status: 'INSTALLED'},
  332. host: Em.Object.create({status: 'pending'}),
  333. actions: [],
  334. e: {status: 'pending'},
  335. isMasterFailed: false,
  336. m: 'No tasks for host'
  337. },
  338. {
  339. cluster: {status: 'INSTALLED'},
  340. host: Em.Object.create({status: 'info'}),
  341. actions: [
  342. {Tasks: {status: 'FAILED'}},
  343. {Tasks: {status: 'COMPLETED'}}
  344. ],
  345. e: {status: 'warning'},
  346. isMasterFailed: false,
  347. m: 'One Task FAILED and cluster status INSTALLED'
  348. },
  349. {
  350. cluster: {status: 'INSTALLED'},
  351. host: Em.Object.create({status: 'info'}),
  352. actions: [
  353. {Tasks: {status: 'ABORTED'}},
  354. {Tasks: {status: 'COMPLETED'}}
  355. ],
  356. e: {status: 'warning'},
  357. isMasterFailed: false,
  358. m: 'One Task ABORTED and cluster status INSTALLED'
  359. },
  360. {
  361. cluster: {status: 'INSTALLED'},
  362. host: Em.Object.create({status: 'info'}),
  363. actions: [
  364. {Tasks: {status: 'TIMEDOUT'}},
  365. {Tasks: {status: 'COMPLETED'}}
  366. ],
  367. e: {status: 'warning'},
  368. isMasterFailed: false,
  369. m: 'One Task TIMEDOUT and cluster status INSTALLED'
  370. },
  371. {
  372. cluster: {status: 'PENDING'},
  373. host: Em.Object.create({status: 'info'}),
  374. actions: [
  375. {Tasks: {status: 'FAILED'}},
  376. {Tasks: {status: 'COMPLETED'}}
  377. ],
  378. e: {status: 'failed'},
  379. isMasterFailed: true,
  380. m: 'One Task FAILED and cluster status PENDING isMasterFailed true'
  381. },
  382. {
  383. cluster: {status: 'PENDING'},
  384. host: Em.Object.create({status: 'info'}),
  385. actions: [
  386. {Tasks: {status: 'COMPLETED'}},
  387. {Tasks: {status: 'COMPLETED'}}
  388. ],
  389. e: {status: 'info'},
  390. isMasterFailed: false,
  391. m: 'One Task FAILED and cluster status PENDING isMasterFailed false'
  392. }
  393. ]);
  394. tests.forEach(function (test) {
  395. var controller = App.WizardStep9Controller.create({content: {cluster: {status: test.cluster.status}}, isMasterFailed: function () {
  396. return test.isMasterFailed;
  397. }});
  398. controller.onErrorPerHost(test.actions, test.host);
  399. it(test.m, function () {
  400. expect(test.host.status).to.equal(test.e.status);
  401. });
  402. });
  403. });
  404. describe('#isMasterFailed', function () {
  405. var tests = Em.A([
  406. {
  407. actions: [
  408. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'DATANODE'}},
  409. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'TASKTRACKER'}},
  410. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'HBASE_REGIONSERVER'}},
  411. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'GANGLIA_MONITOR'}},
  412. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'SUPERVISOR'}}
  413. ],
  414. e: false,
  415. m: 'No one Master is failed'
  416. },
  417. {
  418. actions: [
  419. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'NAMENODE'}},
  420. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'TASKTRACKER'}},
  421. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'HBASE_REGIONSERVER'}},
  422. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'GANGLIA_MONITOR'}},
  423. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'SUPERVISOR'}}
  424. ],
  425. e: true,
  426. m: 'One Master is failed'
  427. },
  428. {
  429. actions: [
  430. {Tasks: {command: 'PENDING', status: 'FAILED', role: 'NAMENODE'}},
  431. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'TASKTRACKER'}},
  432. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'HBASE_REGIONSERVER'}},
  433. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'GANGLIA_MONITOR'}},
  434. {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'SUPERVISOR'}}
  435. ],
  436. e: false,
  437. m: 'one Master is failed but command is not install'
  438. }
  439. ]);
  440. tests.forEach(function (test) {
  441. it(test.m, function () {
  442. var controller = App.WizardStep9Controller.create();
  443. expect(controller.isMasterFailed(test.actions)).to.equal(test.e);
  444. });
  445. });
  446. });
  447. describe('#onInProgressPerHost', function () {
  448. var tests = Em.A([
  449. {
  450. host: Em.Object.create({message: 'default_message'}),
  451. actions: [
  452. {Tasks: {status: 'COMPLETED'}},
  453. {Tasks: {status: 'COMPLETED'}}
  454. ],
  455. e: {message: 'default_message', b: true},
  456. m: 'All Tasks COMPLETED'
  457. },
  458. {
  459. host: Em.Object.create({message: 'default_message'}),
  460. actions: [
  461. {Tasks: {status: 'IN_PROGRESS'}},
  462. {Tasks: {status: 'COMPLETED'}}
  463. ],
  464. e: {message: 'default_message', b: false},
  465. m: 'One Task IN_PROGRESS'
  466. },
  467. {
  468. host: Em.Object.create({message: 'default_message'}),
  469. actions: [
  470. {Tasks: {status: 'QUEUED'}},
  471. {Tasks: {status: 'COMPLETED'}}
  472. ],
  473. e: {message: 'default_message', b: false},
  474. m: 'One Task QUEUED'
  475. },
  476. {
  477. host: Em.Object.create({message: 'default_message'}),
  478. actions: [
  479. {Tasks: {status: 'PENDING'}},
  480. {Tasks: {status: 'COMPLETED'}}
  481. ],
  482. e: {message: 'default_message', b: false},
  483. m: 'One Task PENDING'
  484. }
  485. ]);
  486. tests.forEach(function (test) {
  487. it(test.m, function () {
  488. var controller = App.WizardStep9Controller.create();
  489. controller.onInProgressPerHost(test.actions, test.host);
  490. expect(test.host.message == test.e.message).to.equal(test.e.b);
  491. });
  492. });
  493. });
  494. describe('#progressPerHost', function () {
  495. var tests = Em.A([
  496. {
  497. cluster: {status: 'PENDING'},
  498. host: Em.Object.create({progress: 0}),
  499. actions: [
  500. {Tasks: {status: 'COMPLETED'}},
  501. {Tasks: {status: 'COMPLETED'}},
  502. {Tasks: {status: 'QUEUED'}},
  503. {Tasks: {status: 'QUEUED'}},
  504. {Tasks: {status: 'IN_PROGRESS'}}
  505. ],
  506. e: {ret: 17, host: '17'},
  507. m: 'All types of status available. cluster status PENDING'
  508. },
  509. {
  510. cluster: {status: 'PENDING'},
  511. host: Em.Object.create({progress: 0}),
  512. actions: [],
  513. e: {ret: 33, host: '33'},
  514. m: 'No tasks available. cluster status PENDING'
  515. },
  516. {
  517. cluster: {status: 'INSTALLED'},
  518. host: Em.Object.create({progress: 0}),
  519. actions: [],
  520. e: {ret: 100, host: '100'},
  521. m: 'No tasks available. cluster status INSTALLED'
  522. },
  523. {
  524. cluster: {status: 'INSTALLED'},
  525. host: Em.Object.create({progress: 0}),
  526. actions: [
  527. {Tasks: {status: 'COMPLETED'}},
  528. {Tasks: {status: 'COMPLETED'}},
  529. {Tasks: {status: 'QUEUED'}},
  530. {Tasks: {status: 'QUEUED'}},
  531. {Tasks: {status: 'IN_PROGRESS'}}
  532. ],
  533. e: {ret: 68, host: '68'},
  534. m: 'All types of status available. cluster status INSTALLED'
  535. },
  536. {
  537. cluster: {status: 'FAILED'},
  538. host: Em.Object.create({progress: 0}),
  539. actions: [],
  540. e: {ret: 100, host: '100'},
  541. m: 'Cluster status is not PENDING or INSTALLED'
  542. }
  543. ]);
  544. tests.forEach(function (test) {
  545. it(test.m, function () {
  546. var controller = App.WizardStep9Controller.create({content: {cluster: {status: test.cluster.status}}});
  547. var progress = controller.progressPerHost(test.actions, test.host);
  548. expect(progress).to.equal(test.e.ret);
  549. expect(test.host.progress).to.equal(test.e.host);
  550. });
  551. });
  552. });
  553. describe('#clearStep', function () {
  554. var controller = App.WizardStep9Controller.create({hosts: [
  555. {},
  556. {},
  557. {}
  558. ]});
  559. it('All to default values', function () {
  560. controller.clearStep();
  561. expect(controller.get('hosts.length')).to.equal(0);
  562. expect(controller.get('status')).to.equal('info');
  563. expect(controller.get('progress')).to.equal('0');
  564. expect(controller.get('numPolls')).to.equal(1);
  565. });
  566. });
  567. describe('#replacePolledData', function () {
  568. var controller = App.WizardStep9Controller.create({polledData: [
  569. {},
  570. {},
  571. {}
  572. ]});
  573. var newPolledData = [
  574. {}
  575. ];
  576. controller.replacePolledData(newPolledData);
  577. it('replacing polled data', function () {
  578. expect(controller.get('polledData.length')).to.equal(newPolledData.length);
  579. });
  580. });
  581. describe('#isSuccess', function () {
  582. var tests = Em.A([
  583. {
  584. polledData: [
  585. {Tasks: {status: 'COMPLETED'}},
  586. {Tasks: {status: 'COMPLETED'}}
  587. ],
  588. e: true,
  589. m: 'All tasks are COMPLETED'
  590. },
  591. {
  592. polledData: [
  593. {Tasks: {status: 'COMPLETED'}},
  594. {Tasks: {status: 'FAILED'}}
  595. ],
  596. e: false,
  597. m: 'Not all tasks are COMPLETED'
  598. }
  599. ]);
  600. tests.forEach(function (test) {
  601. it(test.m, function () {
  602. var controller = App.WizardStep9Controller.create();
  603. expect(controller.isSuccess(test.polledData)).to.equal(test.e);
  604. });
  605. });
  606. });
  607. describe('#isStepFailed', function () {
  608. var tests = Em.A([
  609. {
  610. polledData: [
  611. {Tasks: {command: 'INSTALL', role: 'GANGLIA_MONITOR', status: 'TIMEDOUT'}},
  612. {Tasks: {command: 'INSTALL', role: 'GANGLIA_MONITOR', status: 'FAILED'}},
  613. {Tasks: {command: 'INSTALL', role: 'GANGLIA_MONITOR', status: 'PENDING'}}
  614. ],
  615. e: true,
  616. m: 'GANGLIA_MONITOR 2/3 failed'
  617. },
  618. {
  619. polledData: [
  620. {Tasks: {command: 'INSTALL', role: 'GANGLIA_MONITOR', status: 'TIMEDOUT'}},
  621. {Tasks: {command: 'INSTALL', role: 'GANGLIA_MONITOR', status: 'PENDING'}},
  622. {Tasks: {command: 'INSTALL', role: 'GANGLIA_MONITOR', status: 'PENDING'}}
  623. ],
  624. e: false,
  625. m: 'GANGLIA_MONITOR 1/3 failed'
  626. },
  627. {
  628. polledData: [
  629. {Tasks: {command: 'INSTALL', role: 'HBASE_REGIONSERVER', status: 'TIMEDOUT'}},
  630. {Tasks: {command: 'INSTALL', role: 'HBASE_REGIONSERVER', status: 'FAILED'}},
  631. {Tasks: {command: 'INSTALL', role: 'HBASE_REGIONSERVER', status: 'PENDING'}}
  632. ],
  633. e: true,
  634. m: 'HBASE_REGIONSERVER 2/3 failed'
  635. },
  636. {
  637. polledData: [
  638. {Tasks: {command: 'INSTALL', role: 'HBASE_REGIONSERVER', status: 'TIMEDOUT'}},
  639. {Tasks: {command: 'INSTALL', role: 'HBASE_REGIONSERVER', status: 'PENDING'}},
  640. {Tasks: {command: 'INSTALL', role: 'HBASE_REGIONSERVER', status: 'PENDING'}}
  641. ],
  642. e: false,
  643. m: 'HBASE_REGIONSERVER 1/3 failed'
  644. },
  645. {
  646. polledData: [
  647. {Tasks: {command: 'INSTALL', role: 'TASKTRACKER', status: 'TIMEDOUT'}},
  648. {Tasks: {command: 'INSTALL', role: 'TASKTRACKER', status: 'FAILED'}},
  649. {Tasks: {command: 'INSTALL', role: 'TASKTRACKER', status: 'PENDING'}}
  650. ],
  651. e: true,
  652. m: 'TASKTRACKER 2/3 failed'
  653. },
  654. {
  655. polledData: [
  656. {Tasks: {command: 'INSTALL', role: 'TASKTRACKER', status: 'TIMEDOUT'}},
  657. {Tasks: {command: 'INSTALL', role: 'TASKTRACKER', status: 'PENDING'}},
  658. {Tasks: {command: 'INSTALL', role: 'TASKTRACKER', status: 'PENDING'}}
  659. ],
  660. e: false,
  661. m: 'TASKTRACKER 1/3 failed'
  662. },
  663. {
  664. polledData: [
  665. {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'TIMEDOUT'}},
  666. {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'FAILED'}},
  667. {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}}
  668. ],
  669. e: true,
  670. m: 'DATANODE 2/3 failed'
  671. },
  672. {
  673. polledData: [
  674. {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'TIMEDOUT'}},
  675. {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}},
  676. {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}}
  677. ],
  678. e: false,
  679. m: 'DATANODE 1/3 failed'
  680. },
  681. {
  682. polledData: [
  683. {Tasks: {command: 'INSTALL', role: 'NAMENODE', status: 'TIMEDOUT'}},
  684. {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}},
  685. {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}}
  686. ],
  687. e: true,
  688. m: 'NAMENODE failed'
  689. },
  690. {
  691. polledData: [
  692. {Tasks: {command: 'INSTALL', role: 'NAMENODE', status: 'PENDING'}},
  693. {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}},
  694. {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}}
  695. ],
  696. e: false,
  697. m: 'Nothing failed failed'
  698. }
  699. ]);
  700. tests.forEach(function (test) {
  701. var controller = App.WizardStep9Controller.create({polledData: test.polledData});
  702. it(test.m, function () {
  703. expect(controller.isStepFailed()).to.equal(test.e);
  704. });
  705. });
  706. });
  707. describe('#finishState', function () {
  708. var statuses = Em.A(['INSTALL FAILED', 'START FAILED', 'STARTED']);
  709. it('Installer is finished', function () {
  710. statuses.forEach(function (status) {
  711. var controller = App.WizardStep9Controller.create({content: {cluster: {status: status}}});
  712. var result = controller.finishState();
  713. expect(result).to.equal(true);
  714. });
  715. });
  716. it('Unknown cluster status ', function () {
  717. var controller = App.WizardStep9Controller.create({content: {cluster: {status: 'FAKE_STATUS'}}});
  718. var result = controller.finishState();
  719. expect(result).to.equal(false);
  720. });
  721. });
  722. describe('#setLogTasksStatePerHost', function () {
  723. var tests = Em.A([
  724. {
  725. tasksPerHost: [
  726. {Tasks: {id: 1, status: 'COMPLETED'}},
  727. {Tasks: {id: 2, status: 'COMPLETED'}}
  728. ],
  729. tasks: [],
  730. e: {m: 'COMPLETED', l: 2},
  731. m: 'host didn\'t have tasks and got 2 new'
  732. },
  733. {
  734. tasksPerHost: [
  735. {Tasks: {id: 1, status: 'COMPLETED'}},
  736. {Tasks: {id: 2, status: 'COMPLETED'}}
  737. ],
  738. tasks: [
  739. {Tasks: {id: 1, status: 'IN_PROGRESS'}},
  740. {Tasks: {id: 2, status: 'IN_PROGRESS'}}
  741. ],
  742. e: {m: 'COMPLETED', l: 2},
  743. m: 'host had 2 tasks and got both updated'
  744. },
  745. {
  746. tasksPerHost: [],
  747. tasks: [
  748. {Tasks: {id: 1, status: 'IN_PROGRESS'}},
  749. {Tasks: {id: 2, status: 'IN_PROGRESS'}}
  750. ],
  751. e: {m: 'IN_PROGRESS', l: 2},
  752. m: 'host had 2 tasks and didn\'t get updates'
  753. },
  754. {
  755. tasksPerHost: [
  756. {Tasks: {id: 1, status: 'COMPLETED'}},
  757. {Tasks: {id: 2, status: 'COMPLETED'}},
  758. {Tasks: {id: 3, status: 'COMPLETED'}}
  759. ],
  760. tasks: [
  761. {Tasks: {id: 1, status: 'IN_PROGRESS'}},
  762. {Tasks: {id: 2, status: 'IN_PROGRESS'}}
  763. ],
  764. e: {m: 'COMPLETED', l: 3},
  765. m: 'host had 2 tasks and got both updated and 1 new'
  766. }
  767. ]);
  768. tests.forEach(function (test) {
  769. it(test.m, function () {
  770. var controller = App.WizardStep9Controller.create({hosts: [Em.Object.create({logTasks: test.tasks})]});
  771. controller.setLogTasksStatePerHost(test.tasksPerHost, controller.get('hosts')[0]);
  772. expect(controller.get('hosts')[0].get('logTasks').everyProperty('Tasks.status', test.e.m)).to.equal(true);
  773. expect(controller.get('hosts')[0].get('logTasks.length')).to.equal(test.e.l);
  774. });
  775. });
  776. });
  777. describe('#parseHostInfo', function () {
  778. var tests = Em.A([
  779. {
  780. cluster: {status: 'PENDING'},
  781. hosts: Em.A([
  782. Em.Object.create({name: 'host1', status: '', message: '', progress: '', logTasks: []}),
  783. Em.Object.create({name: 'host2', status: '', message: '', progress: '', logTasks: []})
  784. ]),
  785. polledData: {
  786. tasks: [
  787. {Tasks: {host_name: 'host2', status: 'COMPLETED'}},
  788. {Tasks: {host_name: 'host2', status: 'COMPLETED'}}
  789. ]
  790. },
  791. e: {
  792. hosts: {
  793. host1: {progress: '33'},
  794. host2: {progress: '33'}
  795. },
  796. progress: '33'
  797. },
  798. m: 'Two hosts. One host without tasks. Second host has all tasks COMPLETED. Cluster status is PENDING'
  799. },
  800. {
  801. cluster: {status: 'PENDING'},
  802. hosts: Em.A([
  803. Em.Object.create({name: 'host1', status: '', message: '', progress: '', logTasks: []}),
  804. Em.Object.create({name: 'host2', status: '', message: '', progress: '', logTasks: []})
  805. ]),
  806. polledData: {
  807. tasks: [
  808. {Tasks: {host_name: 'host1', status: 'IN_PROGRESS'}},
  809. {Tasks: {host_name: 'host2', status: 'IN_PROGRESS'}}
  810. ]
  811. },
  812. e: {hosts: {host1: {progress: '12'}, host2: {progress: '12'}}, progress: '12'},
  813. m: 'Two hosts. Each host has one task IN_PROGRESS. Cluster status is PENDING'
  814. },
  815. {
  816. cluster: {status: 'PENDING'},
  817. hosts: Em.A([
  818. Em.Object.create({name: 'host1', status: '', message: '', progress: '', logTasks: []}),
  819. Em.Object.create({name: 'host2', status: '', message: '', progress: '', logTasks: []})
  820. ]),
  821. polledData: {
  822. tasks: [
  823. {Tasks: {host_name: 'host1', status: 'QUEUED'}},
  824. {Tasks: {host_name: 'host2', status: 'QUEUED'}}
  825. ]
  826. },
  827. e: {
  828. hosts: {
  829. host1: {progress: '3'},
  830. host2: {progress: '3'}
  831. },
  832. progress: '3'
  833. },
  834. m: 'Two hosts. Each host has one task QUEUED. Cluster status is PENDING'
  835. },
  836. {
  837. cluster: {status: 'INSTALLED'},
  838. hosts: Em.A([
  839. Em.Object.create({name: 'host1', status: '', message: '', progress: '', logTasks: []}),
  840. Em.Object.create({name: 'host2', status: '', message: '', progress: '', logTasks: []})
  841. ]),
  842. polledData: {
  843. tasks: [
  844. {Tasks: {host_name: 'host2', status: 'COMPLETED'}},
  845. {Tasks: {host_name: 'host2', status: 'COMPLETED'}}
  846. ]
  847. },
  848. e: {
  849. hosts: {
  850. host1: {progress: '100'},
  851. host2: {progress: '100'}
  852. },
  853. progress: '100'
  854. },
  855. m: 'Two hosts. One host without tasks. Second host has all tasks COMPLETED. Cluster status is INSTALLED'
  856. },
  857. {
  858. cluster: {status: 'INSTALLED'},
  859. hosts: Em.A([
  860. Em.Object.create({name: 'host1', status: '', message: '', progress: '', logTasks: []}),
  861. Em.Object.create({name: 'host2', status: '', message: '', progress: '', logTasks: []})
  862. ]),
  863. polledData: {
  864. tasks: [
  865. {Tasks: {host_name: 'host1', status: 'IN_PROGRESS'}},
  866. {Tasks: {host_name: 'host2', status: 'IN_PROGRESS'}}
  867. ]
  868. },
  869. e: {
  870. hosts: {
  871. host1: {progress: '58'},
  872. host2: {progress: '58'}
  873. },
  874. progress: '58'
  875. },
  876. m: 'Two hosts. Each host has one task IN_PROGRESS. Cluster status is INSTALLED'
  877. },
  878. {
  879. cluster: {status: 'INSTALLED'},
  880. hosts: Em.A([
  881. Em.Object.create({name: 'host1', status: '', message: '', progress: '', logTasks: []}),
  882. Em.Object.create({name: 'host2', status: '', message: '', progress: '', logTasks: []})
  883. ]),
  884. polledData: {
  885. tasks: [
  886. {Tasks: {host_name: 'host1', status: 'QUEUED'}},
  887. {Tasks: {host_name: 'host2', status: 'QUEUED'}}
  888. ]
  889. },
  890. e: {
  891. hosts: {
  892. host1: {progress: '40'},
  893. host2: {progress: '40'}
  894. },
  895. progress: '40'
  896. },
  897. m: 'Two hosts. Each host has one task QUEUED. Cluster status is INSTALLED'
  898. }
  899. ]);
  900. tests.forEach(function (test) {
  901. it(test.m, function () {
  902. var controller = App.WizardStep9Controller.create({hosts: test.hosts, content: {cluster: {status: test.cluster.status}}, finishState: function () {
  903. return false;
  904. }});
  905. var logTasksChangesCounter = controller.get('logTasksChangesCounter');
  906. controller.parseHostInfo(test.polledData);
  907. expect(controller.get('logTasksChangesCounter')).to.equal(logTasksChangesCounter + 1);
  908. for (var name in test.e.hosts) {
  909. if (test.e.hosts.hasOwnProperty(name)) {
  910. expect(controller.get('hosts').findProperty('name', name).get('progress')).to.equal(test.e.hosts[name].progress);
  911. }
  912. }
  913. expect(controller.get('progress')).to.equal(test.e.progress);
  914. });
  915. });
  916. });
  917. describe('#isAllComponentsInstalledSuccessCallback', function () {
  918. describe('', function() {
  919. var hosts = Em.A([
  920. Em.Object.create({name: 'host1', status: 'failed', expectedStatus: 'heartbeat_lost'}),
  921. Em.Object.create({name: 'host2', status: 'info', expectedStatus: 'heartbeat_lost'}),
  922. Em.Object.create({name: 'host3', status: 'warning', expectedStatus: 'warning'}),
  923. Em.Object.create({name: 'host4', status: 'info', expectedStatus: 'info'})
  924. ]);
  925. var heartbeatLostData = {
  926. "items": [
  927. {
  928. "Hosts": {
  929. "cluster_name": "c1",
  930. "host_name": "host1",
  931. "host_state": "HEARTBEAT_LOST"
  932. },
  933. "host_components": [
  934. {
  935. "HostRoles": {
  936. "cluster_name": "c1",
  937. "component_name": "NAMENODE",
  938. "host_name": "host1",
  939. "state": "INSTALL_FAILED"
  940. }
  941. }
  942. ]
  943. },
  944. {
  945. "Hosts": {
  946. "cluster_name": "c1",
  947. "host_name": "host2",
  948. "host_state": "HEARTBEAT_LOST"
  949. },
  950. "host_components": [
  951. {
  952. "HostRoles": {
  953. "cluster_name": "c1",
  954. "component_name": "ZOOKEEPER_SERVER",
  955. "host_name": "host2",
  956. "state": "UNKNOWN"
  957. }
  958. }
  959. ]
  960. },
  961. {
  962. "Hosts": {
  963. "cluster_name": "c1",
  964. "host_name": "host3",
  965. "host_state": "HEALTHY"
  966. },
  967. "host_components": [
  968. {
  969. "HostRoles": {
  970. "cluster_name": "c1",
  971. "component_name": "DATANODE",
  972. "host_name": "host3",
  973. "state": "INSTALL_FAILED"
  974. }
  975. }
  976. ]
  977. },
  978. {
  979. "Hosts": {
  980. "cluster_name": "c1",
  981. "host_name": "host4",
  982. "host_state": "HEALTHY"
  983. },
  984. "host_components": [
  985. {
  986. "HostRoles": {
  987. "cluster_name": "c1",
  988. "component_name": "PIG",
  989. "host_name": "host4",
  990. "state": "INSTALLED"
  991. }
  992. },
  993. {
  994. "HostRoles": {
  995. "cluster_name": "c1",
  996. "component_name": "DATANODE",
  997. "host_name": "host3",
  998. "state": "INSTALLED"
  999. }
  1000. }
  1001. ]
  1002. }
  1003. ]
  1004. };
  1005. var controller = App.WizardStep9Controller.create({hosts: hosts, content: {controllerName: 'installerController'}});
  1006. App.testMode = true;
  1007. // Action
  1008. controller.isAllComponentsInstalledSuccessCallback(heartbeatLostData);
  1009. // Validation for the status of all hosts.
  1010. controller.get('hosts').forEach(function (test) {
  1011. var status = heartbeatLostData.items.findProperty('Hosts.host_name', test.get('name')).Hosts.host_state;
  1012. it('Host "' + test.get('name') + '"' + ' with status "' + status + '" ', function () {
  1013. expect(test.get('status')).to.equal(test.get('expectedStatus'));
  1014. });
  1015. });
  1016. });
  1017. describe('', function() {
  1018. var noHeartbeatLostData = {
  1019. "items": [
  1020. {
  1021. "Hosts": {
  1022. "cluster_name": "c1",
  1023. "host_name": "host1",
  1024. "host_state": "HEALTHY"
  1025. },
  1026. "host_components": [
  1027. {
  1028. "HostRoles": {
  1029. "cluster_name": "c1",
  1030. "component_name": "NAMENODE",
  1031. "host_name": "host1",
  1032. "state": "INSTALL_FAILED"
  1033. }
  1034. }
  1035. ]
  1036. }
  1037. ]
  1038. };
  1039. var hosts = Em.A([Em.Object.create({name: 'host1', status: 'failed'})]);
  1040. // When there is no heartbeat lost for any host and cluster failed install task, Refreshing the page should not launch start all services request.
  1041. // Below transitions are possibilities in this function
  1042. // PENDING -> INSTALL or PENDING. This transition happens when install all services request is completed successfully.
  1043. // INSTALL FAILED -> INSTALL FAILED. No transition should happen when install all services request fails and then user hits refresh
  1044. // Cluster is not expected to enter this function in other states: INSTALLED, START FAILED, STARTED
  1045. var statuses = Em.A(['INSTALL FAILED', 'INSTALLED','START FAILED', 'STARTED']); // Cluster in any of this states should have no effect on the state from this function
  1046. statuses.forEach(function (priorStatus) {
  1047. var controller = App.WizardStep9Controller.create({hosts: hosts, content: {controllerName: 'installerController', cluster: {status: priorStatus}},togglePreviousSteps: function(){}});
  1048. // Action
  1049. controller.isAllComponentsInstalledSuccessCallback(noHeartbeatLostData);
  1050. // Validation for the cluster state.
  1051. var actualStatus = controller.get('content.cluster.status');
  1052. it('Cluster state before entering the function "' + priorStatus + '"', function () {
  1053. expect(actualStatus).to.equal(priorStatus);
  1054. });
  1055. });
  1056. });
  1057. });
  1058. // isServicesInstalled is called after every poll for "Install All Services" request.
  1059. // This function should result into a call to "Start All Services" request only if install request completed successfully.
  1060. describe('#isServicesInstalled', function () {
  1061. var hostStateJsonData = {
  1062. "items" : [
  1063. {
  1064. "Hosts" : {
  1065. "cluster_name" : "c1",
  1066. "host_name" : "ambari-1.c.apache.internal",
  1067. "host_state" : "HEALTHY"
  1068. },
  1069. "host_components" : [
  1070. {
  1071. "HostRoles" : {
  1072. "cluster_name" : "c1",
  1073. "component_name" : "GANGLIA_MONITOR",
  1074. "host_name" : "ambari-1.c.apache.internal",
  1075. "state" : "STARTED"
  1076. }
  1077. }
  1078. ]
  1079. }
  1080. ]
  1081. };
  1082. var hosts = Em.A([Em.Object.create({name: 'host1', progress: '33', status: 'info'}),
  1083. Em.Object.create({name: 'host2', progress: '33', status: 'info'})]);
  1084. // polledData has all hosts with status completed to trigger transition from install->start request.
  1085. var polledData = Em.A([Em.Object.create({Tasks: {name: 'host1', status: 'COMPLETED'}}),
  1086. Em.Object.create({Tasks: {name: 'host2', status: 'COMPLETED'}})]);
  1087. var controller = App.WizardStep9Controller.create({hosts: hosts, content: {controllerName: 'installerController',
  1088. cluster: {status: 'PENDING',name: 'c1'}},launchStartServices: function() {return true;}});
  1089. var tests = Em.A([
  1090. // controller has "status" value as "info" initially. If no errors are encountered then wizard stages
  1091. // transition info->success, on error info->error, on warning info->warning
  1092. {status: 'info' , e:{startServicesCalled:true}, m:'If no failed tasks then start services request should be called'},
  1093. {status: 'failed', e:{startServicesCalled:false}, m: 'If install request has failed tasks then start services call should not be called'}
  1094. ]);
  1095. beforeEach(function() {
  1096. App.testMode = true;
  1097. sinon.spy(controller, 'launchStartServices');
  1098. sinon.stub($, 'ajax').yieldsTo('success', hostStateJsonData);
  1099. });
  1100. afterEach(function() {
  1101. App.testMode = false;
  1102. controller.launchStartServices.restore();
  1103. $.ajax.restore();
  1104. });
  1105. tests.forEach(function(test){
  1106. it(test.m, function() {
  1107. controller.set('status',test.status);
  1108. //Action
  1109. controller.isServicesInstalled(polledData);
  1110. //Validation
  1111. expect(controller.launchStartServices.called).to.equal(test.e.startServicesCalled);
  1112. });
  1113. });
  1114. });
  1115. // On completion of Start all services error callback function,
  1116. // Cluster Status should be INSTALL FAILED
  1117. // All progress bar on the screen should be finished (100%) with blue color.
  1118. // Retry button should be enabled, next button should be disabled
  1119. describe('#launchStartServicesErrorCallback', function () {
  1120. App.testMode = true;
  1121. // override the actual function
  1122. App.popup = {
  1123. setErrorPopup: function() {
  1124. return true;
  1125. }
  1126. };
  1127. var hosts = Em.A([Em.Object.create({name: 'host1', progress: '33', status: 'info'}),Em.Object.create({name: 'host2', progress: '33', status: 'info'})]);
  1128. var controller = App.WizardStep9Controller.create({hosts: hosts, content: {controllerName: 'installerController', cluster: {status: 'PENDING',name: 'c1'}},togglePreviousSteps: function(){}});
  1129. //Action
  1130. controller.launchStartServicesErrorCallback({status:500, statusTesxt: 'Server Error'}, {}, '', {});
  1131. it('Cluster Status should be INSTALL FAILED', function () {
  1132. expect(controller.get('content.cluster.status')).to.equal('INSTALL FAILED');
  1133. });
  1134. it('Main progress bar on the screen should be finished (100%) with red color', function () {
  1135. expect(controller.get('progress')).to.equal('100');
  1136. expect(controller.get('status')).to.equal('failed');
  1137. });
  1138. it('All Host progress bars on the screen should be finished (100%) with blue color', function () {
  1139. controller.get('hosts').forEach(function(host){
  1140. expect(host.get('progress')).to.equal('100');
  1141. expect(host.get('status')).to.equal('info');
  1142. });
  1143. });
  1144. it('Next button should be disabled', function () {
  1145. expect(controller.get('isSubmitDisabled')).to.equal(true);
  1146. });
  1147. it('Retry button should be visible', function () {
  1148. expect(controller.get('showRetry')).to.equal(true);
  1149. })
  1150. });
  1151. });