@@ -380,6 +380,13 @@ describe('Master tests', function() {
380380 . times ( 100 )
381381 . reply ( 204 , '' ) ;
382382
383+ // List blobs
384+ nock ( 'https://testappo365.blob.core.windows.net:443' , { 'encodedQueryParams' :true } )
385+ . get ( '/alertlogic-dl' )
386+ . query ( true )
387+ . times ( 5 )
388+ . reply ( 200 , mock . LIST_CONTAINER_BLOBS ( ) ) ;
389+
383390 // Mock Alert Logic HTTP calls
384391 fakePost = sinon . stub ( alcollector . AlServiceC . prototype , 'post' ) . callsFake (
385392 function fakeFn ( path , extraOptions ) {
@@ -402,6 +409,7 @@ describe('Master tests', function() {
402409 process . env . APP_AZCOLLECT_ENDPOINT = 'existing-azcollect-endpoint' ;
403410 process . env . COLLECTOR_HOST_ID = 'existing-host-id' ;
404411 process . env . COLLECTOR_SOURCE_ID = 'existing-source-id' ;
412+ process . env . APP_DL_CONTAINER_NAME = 'alertlogic-dl' ;
405413
406414 // Expected Azure parameters
407415 process . env . WEBSITE_SITE_NAME = 'kktest11-name' ;
@@ -434,6 +442,7 @@ describe('Master tests', function() {
434442 host_id : 'existing-host-id' ,
435443 source_id : 'existing-source-id' ,
436444 statistics : [ { 'Master' : { 'errors' : 0 , 'invocations' : 2 } } , { 'Collector' : { 'errors' : 1 , 'invocations' : 10 } } , { 'Updater' : { 'errors' : 0 , 'invocations' : 0 } } ] ,
445+ dl_stats : { dl_count : 6 , max_dl_size : 4257 } ,
437446 status : 'ok' ,
438447 details : [ ]
439448 }
@@ -466,6 +475,7 @@ describe('Master tests', function() {
466475 host_id : 'existing-host-id' ,
467476 source_id : 'existing-source-id' ,
468477 statistics : [ { 'Master' : { 'errors' : 0 , 'invocations' : 2 } } , { 'Collector' : { 'errors' : 1 , 'invocations' : 10 } } , { 'Updater' : { 'errors' : 0 , 'invocations' : 0 } } ] ,
478+ dl_stats : { dl_count : 6 , max_dl_size : 4257 } ,
469479 status : 'error' ,
470480 details : [ 'Azure Web Application status is not OK. {\"availabilityState\":\"Limited\"}' ] ,
471481 error_code : 'ALAZU00001'
@@ -498,6 +508,7 @@ describe('Master tests', function() {
498508 host_id : 'existing-host-id' ,
499509 source_id : 'existing-source-id' ,
500510 statistics : [ { 'Master' : { 'errors' : 0 , 'invocations' : 2 } } , { 'Collector' : { 'errors' : 1 , 'invocations' : 10 } } , { 'Updater' : { 'errors' : 0 , 'invocations' : 0 } } ] ,
511+ dl_stats : { dl_count : 6 , max_dl_size : 4257 } ,
501512 status : 'ok' ,
502513 details : [ ]
503514 }
@@ -528,6 +539,7 @@ describe('Master tests', function() {
528539 host_id : 'existing-host-id' ,
529540 source_id : 'existing-source-id' ,
530541 statistics : [ { 'Master' : { 'errors' : 0 , 'invocations' : 2 } } , { 'Collector' : { 'errors' : 1 , 'invocations' : 10 } } , { 'Updater' : { 'errors' : 0 , 'invocations' : 0 } } ] ,
542+ dl_stats : { dl_count : 6 , max_dl_size : 4257 } ,
531543 status : 'error' ,
532544 details : [ 'Custom Error' ] ,
533545 error_code : 'ALAZU000004'
0 commit comments