@@ -30,6 +30,7 @@ const azureClient = getAzureClient();
3030const containerName = getAzureContainerName ( azureLocation ) ;
3131
3232const ipAddress = process . env . IP ? process . env . IP : '127.0.0.1' ;
33+ const isNullVersionCompatMode = process . env . ENABLE_NULL_VERSION_COMPAT_MODE === 'true' ;
3334
3435const { accessKeyId, secretAccessKey } = getCredentials ( ) ;
3536
@@ -379,6 +380,9 @@ describe('backbeat routes', () => {
379380 const objMDAfter = JSON . parse ( getMetadataAfterRes . body ) . Body ;
380381 const expectedMd = JSON . parse ( objMD ) ;
381382 expectedMd . isNull = true ; // TODO remove the line once CLDSRV-509 is fixed
383+ if ( ! isNullVersionCompatMode ) {
384+ expectedMd . isNull2 = true ; // TODO remove the line once CLDSRV-509 is fixed
385+ }
382386 assert . deepStrictEqual ( JSON . parse ( objMDAfter ) , expectedMd ) ;
383387
384388 const listObjectVersionsRes = results . listObjectVersions ;
@@ -1447,8 +1451,7 @@ describe('backbeat routes', () => {
14471451 } ) ;
14481452 } ) ;
14491453
1450- // TODO: CLDSRV-394 unskip routeBackbeat tests
1451- describe . skip ( 'backbeat PUT routes' , ( ) => {
1454+ describe ( 'backbeat PUT routes' , ( ) => {
14521455 describe ( 'PUT data + metadata should create a new complete object' ,
14531456 ( ) => {
14541457 [ {
@@ -1644,11 +1647,9 @@ describe('backbeat routes', () => {
16441647 } ) ;
16451648 } ) ;
16461649
1647- it ( 'should PUT tags for a non-versioned bucket' , function test ( done ) {
1650+ itSkipCeph ( 'should PUT tags for a non-versioned bucket' , function test ( done ) {
16481651 this . timeout ( 10000 ) ;
16491652 const bucket = NONVERSIONED_BUCKET ;
1650- const awsBucket =
1651- config . locationConstraints [ awsLocation ] . details . bucketName ;
16521653 const awsKey = uuidv4 ( ) ;
16531654 async . waterfall ( [
16541655 next =>
@@ -2153,7 +2154,7 @@ describe('backbeat routes', () => {
21532154 } ) ;
21542155 } ) ;
21552156 } ) ;
2156- describe . skip ( 'backbeat authorization checks' , ( ) => {
2157+ describe ( 'backbeat authorization checks' , ( ) => {
21572158 [ { method : 'PUT' , resourceType : 'metadata' } ,
21582159 { method : 'PUT' , resourceType : 'data' } ] . forEach ( test => {
21592160 const queryObj = test . resourceType === 'data' ? { v2 : '' } : { } ;
@@ -2271,7 +2272,7 @@ describe('backbeat routes', () => {
22712272 } ) ;
22722273 } ) ;
22732274
2274- describe . skip ( 'GET Metadata route' , ( ) => {
2275+ describe ( 'GET Metadata route' , ( ) => {
22752276 beforeEach ( done => makeBackbeatRequest ( {
22762277 method : 'PUT' , bucket : TEST_BUCKET ,
22772278 objectKey : TEST_KEY ,
@@ -2329,14 +2330,12 @@ describe('backbeat routes', () => {
23292330 } ) ;
23302331 } ) ;
23312332 } ) ;
2332- describe . skip ( 'backbeat multipart upload operations' , function test ( ) {
2333+ describe ( 'backbeat multipart upload operations' , function test ( ) {
23332334 this . timeout ( 10000 ) ;
23342335
23352336 // The ceph image does not support putting tags during initiate MPU.
23362337 itSkipCeph ( 'should put tags if the source is AWS and tags are ' +
2337- 'provided when initiating the multipart upload' , done => {
2338- const awsBucket =
2339- config . locationConstraints [ awsLocation ] . details . bucketName ;
2338+ 'provided when initiating the multipart upload' , done => {
23402339 const awsKey = uuidv4 ( ) ;
23412340 const multipleBackendPath =
23422341 `/_/backbeat/multiplebackenddata/${ awsBucket } /${ awsKey } ` ;
@@ -2478,19 +2477,16 @@ describe('backbeat routes', () => {
24782477 jsonResponse : true ,
24792478 } , next ) ,
24802479 next =>
2481- azureClient . getBlobProperties (
2482- containerName , blob , ( err , result ) => {
2483- if ( err ) {
2484- return next ( err ) ;
2485- }
2480+ azureClient . getContainerClient ( containerName ) . getBlobClient ( blob ) . getProperties ( )
2481+ . then ( result => {
24862482 const tags = JSON . parse ( result . metadata . tags ) ;
24872483 assert . deepStrictEqual ( tags , { key1 : 'value1' } ) ;
24882484 return next ( ) ;
2489- } ) ,
2485+ } , next ) ,
24902486 ] , done ) ;
24912487 } ) ;
24922488 } ) ;
2493- describe . skip ( 'Batch Delete Route' , function test ( ) {
2489+ describe ( 'Batch Delete Route' , function test ( ) {
24942490 this . timeout ( 30000 ) ;
24952491 it ( 'should batch delete a local location' , done => {
24962492 let versionId ;
@@ -2549,7 +2545,8 @@ describe('backbeat routes', () => {
25492545 } ) ,
25502546 ] , done ) ;
25512547 } ) ;
2552- it ( 'should batch delete a versioned AWS location' , done => {
2548+
2549+ itSkipCeph ( 'should batch delete a versioned AWS location' , done => {
25532550 let versionId ;
25542551 const awsKey = `${ TEST_BUCKET } /batch-delete-test-key-${ makeid ( 8 ) } ` ;
25552552
@@ -2689,7 +2686,7 @@ describe('backbeat routes', () => {
26892686 ] , done ) ;
26902687 } ) ;
26912688
2692- it ( 'should not put tags if the source is not Azure and ' +
2689+ itSkipCeph ( 'should not put tags if the source is not Azure and ' +
26932690 'if-unmodified-since condition is not met' , done => {
26942691 const awsKey = uuidv4 ( ) ;
26952692 async . series ( [
@@ -2734,7 +2731,7 @@ describe('backbeat routes', () => {
27342731 ] , done ) ;
27352732 } ) ;
27362733
2737- it ( 'should put tags if the source is not Azure and ' +
2734+ itSkipCeph ( 'should put tags if the source is not Azure and ' +
27382735 'if-unmodified-since condition is met' , done => {
27392736 const awsKey = uuidv4 ( ) ;
27402737 let lastModified ;
@@ -2809,8 +2806,8 @@ describe('backbeat routes', () => {
28092806 const blob = uuidv4 ( ) ;
28102807 async . series ( [
28112808 next =>
2812- azureClient . createBlockBlobFromText (
2813- containerName , blob , 'a' , null , next ) ,
2809+ azureClient . getContainerClient ( containerName ) . uploadBlockBlob ( blob , 'a' , 1 )
2810+ . then ( ( ) => next ( ) , next ) ,
28142811 next =>
28152812 makeRequest ( {
28162813 authCredentials : backbeatAuthCredentials ,
@@ -2842,14 +2839,11 @@ describe('backbeat routes', () => {
28422839 return next ( err ) ;
28432840 } ) ,
28442841 next =>
2845- azureClient . getBlobProperties (
2846- containerName , blob , ( err , result ) => {
2847- if ( err ) {
2848- return next ( err ) ;
2849- }
2842+ azureClient . getContainerClient ( containerName ) . getBlobClient ( blob ) . getProperties ( )
2843+ . then ( result => {
28502844 assert ( result ) ;
28512845 return next ( ) ;
2852- } ) ,
2846+ } , next ) ,
28532847 ] , done ) ;
28542848 } ) ;
28552849
@@ -2859,17 +2853,14 @@ describe('backbeat routes', () => {
28592853 let lastModified ;
28602854 async . series ( [
28612855 next =>
2862- azureClient . createBlockBlobFromText (
2863- containerName , blob , 'a' , null , next ) ,
2856+ azureClient . getContainerClient ( containerName ) . uploadBlockBlob ( blob , 'a' , 1 )
2857+ . then ( ( ) => next ( ) , next ) ,
28642858 next =>
2865- azureClient . getBlobProperties (
2866- containerName , blob , ( err , result ) => {
2867- if ( err ) {
2868- return next ( err ) ;
2869- }
2859+ azureClient . getContainerClient ( containerName ) . getBlobClient ( blob ) . getProperties ( )
2860+ . then ( result => {
28702861 lastModified = result . lastModified ;
28712862 return next ( ) ;
2872- } ) ,
2863+ } , next ) ,
28732864 next =>
28742865 makeRequest ( {
28752866 authCredentials : backbeatAuthCredentials ,
@@ -2895,10 +2886,11 @@ describe('backbeat routes', () => {
28952886 jsonResponse : true ,
28962887 } , next ) ,
28972888 next =>
2898- azureClient . getBlobProperties ( containerName , blob , err => {
2899- assert ( err . statusCode === 404 ) ;
2900- return next ( ) ;
2901- } ) ,
2889+ azureClient . getContainerClient ( containerName ) . getBlobClient ( blob ) . getProperties ( )
2890+ . then ( ( ) => assert . fail ( 'Expected error' ) , err => {
2891+ assert . strictEqual ( err . statusCode , 404 ) ;
2892+ return next ( ) ;
2893+ } ) ,
29022894 ] , done ) ;
29032895 } ) ;
29042896 } ) ;
0 commit comments