@@ -102,8 +102,8 @@ public class TestOzoneTenantShell {
102
102
private static OzoneShell ozoneSh = null ;
103
103
private static TenantShell tenantShell = null ;
104
104
105
- private static final StringWriter out = new StringWriter ();
106
- private static final StringWriter err = new StringWriter ();
105
+ private static final StringWriter OUT = new StringWriter ();
106
+ private static final StringWriter ERR = new StringWriter ();
107
107
108
108
private static String omServiceId ;
109
109
private static int numOfOMs ;
@@ -171,10 +171,10 @@ public static void shutdown() {
171
171
172
172
@ BeforeEach
173
173
public void setup () throws UnsupportedEncodingException {
174
- tenantShell .getCmd ().setOut (new PrintWriter (out ));
175
- tenantShell .getCmd ().setErr (new PrintWriter (err ));
176
- ozoneSh .getCmd ().setOut (new PrintWriter (out ));
177
- ozoneSh .getCmd ().setErr (new PrintWriter (err ));
174
+ tenantShell .getCmd ().setOut (new PrintWriter (OUT ));
175
+ tenantShell .getCmd ().setErr (new PrintWriter (ERR ));
176
+ ozoneSh .getCmd ().setOut (new PrintWriter (OUT ));
177
+ ozoneSh .getCmd ().setErr (new PrintWriter (ERR ));
178
178
// Suppress OMNotLeaderException in the log
179
179
GenericTestUtils .setLogLevel (RetryInvocationHandler .LOG , Level .WARN );
180
180
// Enable debug logging for interested classes
@@ -189,8 +189,8 @@ public void setup() throws UnsupportedEncodingException {
189
189
@ AfterEach
190
190
public void reset () {
191
191
// reset stream after each unit test
192
- out .getBuffer ().setLength (0 );
193
- err .getBuffer ().setLength (0 );
192
+ OUT .getBuffer ().setLength (0 );
193
+ ERR .getBuffer ().setLength (0 );
194
194
}
195
195
196
196
/**
@@ -201,7 +201,7 @@ private int execute(GenericCli shell, String[] args) {
201
201
CommandLine cmd = shell .getCmd ();
202
202
CommandLine .IExecutionExceptionHandler exceptionHandler =
203
203
(ex , commandLine , parseResult ) -> {
204
- new PrintWriter (err ).println (ex .getMessage ());
204
+ new PrintWriter (ERR ).println (ex .getMessage ());
205
205
return commandLine .getCommandSpec ().exitCodeOnExecutionException ();
206
206
};
207
207
@@ -336,8 +336,8 @@ private void checkOutput(String str, String stringToMatch,
336
336
337
337
private void deleteVolume (String volumeName ) throws IOException {
338
338
int exitC = execute (ozoneSh , new String [] {"volume" , "delete" , volumeName });
339
- checkOutput (out , "Volume " + volumeName + " is deleted\n " , true );
340
- checkOutput (err , "" , true );
339
+ checkOutput (OUT , "Volume " + volumeName + " is deleted\n " , true );
340
+ checkOutput (ERR , "" , true );
341
341
// Exit code should be 0
342
342
assertEquals (0 , exitC );
343
343
}
@@ -349,48 +349,48 @@ public void testAssignAdmin() throws IOException {
349
349
final String userName = "alice" ;
350
350
351
351
executeHA (tenantShell , new String [] {"create" , tenantName });
352
- checkOutput (out , "" , true );
353
- checkOutput (err , "" , true );
352
+ checkOutput (OUT , "" , true );
353
+ checkOutput (ERR , "" , true );
354
354
355
355
// Loop assign-revoke 4 times
356
356
for (int i = 0 ; i < 4 ; i ++) {
357
357
executeHA (tenantShell , new String [] {
358
358
"user" , "assign" , userName , "--tenant=" + tenantName });
359
- checkOutput (out , "export AWS_ACCESS_KEY_ID=" , false );
360
- checkOutput (err , "" , true );
359
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID=" , false );
360
+ checkOutput (ERR , "" , true );
361
361
362
362
executeHA (tenantShell , new String [] {"--verbose" , "user" , "assign-admin" ,
363
363
tenantName + "$" + userName , "--tenant=" + tenantName ,
364
364
"--delegated=true" });
365
- checkOutput (out , "{\n " + " \" accessId\" : \" devaa$alice\" ,\n "
365
+ checkOutput (OUT , "{\n " + " \" accessId\" : \" devaa$alice\" ,\n "
366
366
+ " \" tenantId\" : \" devaa\" ,\n " + " \" isAdmin\" : true,\n "
367
367
+ " \" isDelegatedAdmin\" : true\n " + "}\n " , true , true );
368
- checkOutput (err , "" , true );
368
+ checkOutput (ERR , "" , true );
369
369
370
370
// Clean up
371
371
executeHA (tenantShell , new String [] {"--verbose" , "user" , "revoke-admin" ,
372
372
tenantName + "$" + userName , "--tenant=" + tenantName });
373
- checkOutput (out , "{\n " + " \" accessId\" : \" devaa$alice\" ,\n "
373
+ checkOutput (OUT , "{\n " + " \" accessId\" : \" devaa$alice\" ,\n "
374
374
+ " \" tenantId\" : \" devaa\" ,\n " + " \" isAdmin\" : false,\n "
375
375
+ " \" isDelegatedAdmin\" : false\n " + "}\n " , true , true );
376
- checkOutput (err , "" , true );
376
+ checkOutput (ERR , "" , true );
377
377
378
378
executeHA (tenantShell , new String [] {
379
379
"user" , "revoke" , tenantName + "$" + userName });
380
- checkOutput (out , "" , true );
381
- checkOutput (err , "" , true );
380
+ checkOutput (OUT , "" , true );
381
+ checkOutput (ERR , "" , true );
382
382
}
383
383
384
384
// Clean up
385
385
executeHA (tenantShell , new String [] {"delete" , tenantName });
386
- checkOutput (out , "" , true );
387
- checkOutput (err , "Deleted tenant '" + tenantName + "'.\n " , false );
386
+ checkOutput (OUT , "" , true );
387
+ checkOutput (ERR , "Deleted tenant '" + tenantName + "'.\n " , false );
388
388
deleteVolume (tenantName );
389
389
390
390
// Sanity check: tenant list should be empty
391
391
executeHA (tenantShell , new String [] {"list" });
392
- checkOutput (out , "" , true );
393
- checkOutput (err , "" , true );
392
+ checkOutput (OUT , "" , true );
393
+ checkOutput (ERR , "" , true );
394
394
}
395
395
396
396
/**
@@ -405,19 +405,19 @@ public void testOzoneTenantBasicOperations() throws IOException {
405
405
assertEquals (0 , lines .size ());
406
406
407
407
executeHA (tenantShell , new String [] {"list" });
408
- checkOutput (out , "" , true );
409
- checkOutput (err , "" , true );
408
+ checkOutput (OUT , "" , true );
409
+ checkOutput (ERR , "" , true );
410
410
411
411
// Create tenants
412
412
// Equivalent to `ozone tenant create finance`
413
413
executeHA (tenantShell , new String [] {"create" , "finance" });
414
- checkOutput (out , "" , true );
415
- checkOutput (err , "" , true );
414
+ checkOutput (OUT , "" , true );
415
+ checkOutput (ERR , "" , true );
416
416
417
417
executeHA (tenantShell , new String [] {"list" });
418
- String test = out .toString ();
419
- checkOutput (out , "finance\n " , true );
420
- checkOutput (err , "" , true );
418
+ String test = OUT .toString ();
419
+ checkOutput (OUT , "finance\n " , true );
420
+ checkOutput (ERR , "" , true );
421
421
422
422
lines = FileUtils .readLines (AUDIT_LOG_FILE , (String )null );
423
423
assertThat (lines .size ()).isGreaterThan (0 );
@@ -429,93 +429,93 @@ public void testOzoneTenantBasicOperations() throws IOException {
429
429
430
430
// Creating the tenant with the same name again should fail
431
431
executeHA (tenantShell , new String [] {"create" , "finance" });
432
- checkOutput (out , "" , true );
433
- checkOutput (err , "Tenant 'finance' already exists\n " , true );
432
+ checkOutput (OUT , "" , true );
433
+ checkOutput (ERR , "Tenant 'finance' already exists\n " , true );
434
434
435
435
executeHA (tenantShell , new String [] {"create" , "research" });
436
- checkOutput (out , "" , true );
437
- checkOutput (err , "" , true );
436
+ checkOutput (OUT , "" , true );
437
+ checkOutput (ERR , "" , true );
438
438
439
439
executeHA (tenantShell , new String [] {"create" , "dev" });
440
- checkOutput (out , "" , true );
441
- checkOutput (err , "" , true );
440
+ checkOutput (OUT , "" , true );
441
+ checkOutput (ERR , "" , true );
442
442
443
443
executeHA (tenantShell , new String [] {"ls" });
444
- checkOutput (out , "dev\n finance\n research\n " , true );
445
- checkOutput (err , "" , true );
444
+ checkOutput (OUT , "dev\n finance\n research\n " , true );
445
+ checkOutput (ERR , "" , true );
446
446
447
447
executeHA (tenantShell , new String [] {"list" , "--json" });
448
448
// Not checking the full output here
449
- checkOutput (out , "\" tenantId\" : \" dev\" ," , false );
450
- checkOutput (err , "" , true );
449
+ checkOutput (OUT , "\" tenantId\" : \" dev\" ," , false );
450
+ checkOutput (ERR , "" , true );
451
451
452
452
// Attempt user getsecret before assignment, should fail
453
453
executeHA (tenantShell , new String [] {
454
454
"user" , "getsecret" , "finance$bob" });
455
- checkOutput (out , "" , false );
456
- checkOutput (err , "accessId 'finance$bob' doesn't exist\n " ,
455
+ checkOutput (OUT , "" , false );
456
+ checkOutput (ERR , "accessId 'finance$bob' doesn't exist\n " ,
457
457
true );
458
458
459
459
// Assign user accessId
460
460
// Equivalent to `ozone tenant user assign bob --tenant=finance`
461
461
executeHA (tenantShell , new String [] {
462
462
"--verbose" , "user" , "assign" , "bob" , "--tenant=finance" });
463
- checkOutput (out , "export AWS_ACCESS_KEY_ID='finance$bob'\n "
463
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='finance$bob'\n "
464
464
+ "export AWS_SECRET_ACCESS_KEY='" , false );
465
- checkOutput (err , "Assigned 'bob' to 'finance' with accessId"
465
+ checkOutput (ERR , "Assigned 'bob' to 'finance' with accessId"
466
466
+ " 'finance$bob'.\n " , true );
467
467
468
468
// Try user getsecret again after assignment, should succeed
469
469
executeHA (tenantShell , new String [] {
470
470
"user" , "getsecret" , "finance$bob" });
471
- checkOutput (out , "export AWS_ACCESS_KEY_ID='finance$bob'\n " ,
471
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='finance$bob'\n " ,
472
472
false );
473
- checkOutput (err , "" , true );
473
+ checkOutput (ERR , "" , true );
474
474
475
475
executeHA (tenantShell , new String [] {
476
476
"--verbose" , "user" , "assign" , "bob" , "--tenant=research" });
477
- checkOutput (out , "export AWS_ACCESS_KEY_ID='research$bob'\n "
477
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='research$bob'\n "
478
478
+ "export AWS_SECRET_ACCESS_KEY='" , false );
479
- checkOutput (err , "Assigned 'bob' to 'research' with accessId"
479
+ checkOutput (ERR , "Assigned 'bob' to 'research' with accessId"
480
480
+ " 'research$bob'.\n " , true );
481
481
482
482
executeHA (tenantShell , new String [] {
483
483
"user" , "assign" , "bob" , "--tenant=dev" });
484
- checkOutput (out , "export AWS_ACCESS_KEY_ID='dev$bob'\n "
484
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='dev$bob'\n "
485
485
+ "export AWS_SECRET_ACCESS_KEY='" , false );
486
- checkOutput (err , "" , true );
486
+ checkOutput (ERR , "" , true );
487
487
488
488
// accessId length exceeding limit, should fail
489
489
executeHA (tenantShell , new String [] {
490
490
"user" , "assign" , StringUtils .repeat ('a' , 100 ), "--tenant=dev" });
491
- checkOutput (out , "" , true );
492
- checkOutput (err , "accessId length (104) exceeds the maximum length "
491
+ checkOutput (OUT , "" , true );
492
+ checkOutput (ERR , "accessId length (104) exceeds the maximum length "
493
493
+ "allowed (100)\n " , true );
494
494
495
495
// Get user info
496
496
// Equivalent to `ozone tenant user info bob`
497
497
executeHA (tenantShell , new String [] {
498
498
"user" , "info" , "bob" });
499
- checkOutput (out , "User 'bob' is assigned to:\n "
499
+ checkOutput (OUT , "User 'bob' is assigned to:\n "
500
500
+ "- Tenant 'research' with accessId 'research$bob'\n "
501
501
+ "- Tenant 'finance' with accessId 'finance$bob'\n "
502
502
+ "- Tenant 'dev' with accessId 'dev$bob'\n " , true );
503
- checkOutput (err , "" , true );
503
+ checkOutput (ERR , "" , true );
504
504
505
505
// Assign admin
506
506
executeHA (tenantShell , new String [] {
507
507
"user" , "assign-admin" , "dev$bob" , "--tenant=dev" , "--delegated" });
508
- checkOutput (out , "" , true );
509
- checkOutput (err , "" , true );
508
+ checkOutput (OUT , "" , true );
509
+ checkOutput (ERR , "" , true );
510
510
511
511
executeHA (tenantShell , new String [] {
512
512
"user" , "info" , "bob" });
513
- checkOutput (out , "Tenant 'dev' delegated admin with accessId" , false );
514
- checkOutput (err , "" , true );
513
+ checkOutput (OUT , "Tenant 'dev' delegated admin with accessId" , false );
514
+ checkOutput (ERR , "" , true );
515
515
516
516
executeHA (tenantShell , new String [] {
517
517
"user" , "info" , "--json" , "bob" });
518
- checkOutput (out ,
518
+ checkOutput (OUT ,
519
519
"{\n " +
520
520
" \" user\" : \" bob\" ,\n " +
521
521
" \" tenants\" : [ {\n " +
@@ -536,97 +536,97 @@ public void testOzoneTenantBasicOperations() throws IOException {
536
536
" } ]\n " +
537
537
"}\n " ,
538
538
true , true );
539
- checkOutput (err , "" , true );
539
+ checkOutput (ERR , "" , true );
540
540
541
541
// Revoke admin
542
542
executeHA (tenantShell , new String [] {
543
543
"user" , "revoke-admin" , "dev$bob" , "--tenant=dev" });
544
- checkOutput (out , "" , true );
545
- checkOutput (err , "" , true );
544
+ checkOutput (OUT , "" , true );
545
+ checkOutput (ERR , "" , true );
546
546
547
547
executeHA (tenantShell , new String [] {
548
548
"user" , "info" , "bob" });
549
- checkOutput (out , "User 'bob' is assigned to:\n "
549
+ checkOutput (OUT , "User 'bob' is assigned to:\n "
550
550
+ "- Tenant 'research' with accessId 'research$bob'\n "
551
551
+ "- Tenant 'finance' with accessId 'finance$bob'\n "
552
552
+ "- Tenant 'dev' with accessId 'dev$bob'\n " , true );
553
- checkOutput (err , "" , true );
553
+ checkOutput (ERR , "" , true );
554
554
555
555
// Revoke user accessId
556
556
executeHA (tenantShell , new String [] {
557
557
"user" , "revoke" , "research$bob" });
558
- checkOutput (out , "" , true );
559
- checkOutput (err , "" , true );
558
+ checkOutput (OUT , "" , true );
559
+ checkOutput (ERR , "" , true );
560
560
561
561
executeHA (tenantShell , new String [] {
562
562
"user" , "info" , "bob" });
563
- checkOutput (out , "User 'bob' is assigned to:\n "
563
+ checkOutput (OUT , "User 'bob' is assigned to:\n "
564
564
+ "- Tenant 'finance' with accessId 'finance$bob'\n "
565
565
+ "- Tenant 'dev' with accessId 'dev$bob'\n " , true );
566
- checkOutput (err , "" , true );
566
+ checkOutput (ERR , "" , true );
567
567
568
568
// Assign user again
569
569
executeHA (tenantShell , new String [] {
570
570
"user" , "assign" , "bob" , "--tenant=research" });
571
- checkOutput (out , "export AWS_ACCESS_KEY_ID='research$bob'\n "
571
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='research$bob'\n "
572
572
+ "export AWS_SECRET_ACCESS_KEY='" , false );
573
- checkOutput (err , "" , true );
573
+ checkOutput (ERR , "" , true );
574
574
575
575
// Attempt to assign the user to the tenant again
576
576
executeHA (tenantShell , new String [] {
577
577
"user" , "assign" , "bob" , "--tenant=research" ,
578
578
"--accessId=research$bob" });
579
- checkOutput (out , "" , false );
580
- checkOutput (err , "accessId 'research$bob' already exists!\n " , true );
579
+ checkOutput (OUT , "" , false );
580
+ checkOutput (ERR , "accessId 'research$bob' already exists!\n " , true );
581
581
582
582
// Attempt to assign the user to the tenant with a custom accessId
583
583
executeHA (tenantShell , new String [] {
584
584
"user" , "assign" , "bob" , "--tenant=research" ,
585
585
"--accessId=research$bob42" });
586
- checkOutput (out , "" , false );
586
+ checkOutput (OUT , "" , false );
587
587
// HDDS-6366: Disallow specifying custom accessId.
588
- checkOutput (err , "Invalid accessId 'research$bob42'. "
588
+ checkOutput (ERR , "Invalid accessId 'research$bob42'. "
589
589
+ "Specifying a custom access ID disallowed. "
590
590
+ "Expected accessId to be assigned is 'research$bob'\n " , true );
591
591
592
592
executeHA (tenantShell , new String [] {"list" });
593
- checkOutput (out , "dev\n finance\n research\n " , true );
594
- checkOutput (err , "" , true );
593
+ checkOutput (OUT , "dev\n finance\n research\n " , true );
594
+ checkOutput (ERR , "" , true );
595
595
596
596
// Clean up
597
597
executeHA (tenantShell , new String [] {
598
598
"user" , "revoke" , "research$bob" });
599
- checkOutput (out , "" , true );
600
- checkOutput (err , "" , true );
599
+ checkOutput (OUT , "" , true );
600
+ checkOutput (ERR , "" , true );
601
601
602
602
executeHA (tenantShell , new String [] {"delete" , "research" });
603
- checkOutput (out , "" , true );
604
- checkOutput (err , "Deleted tenant 'research'.\n " , false );
603
+ checkOutput (OUT , "" , true );
604
+ checkOutput (ERR , "Deleted tenant 'research'.\n " , false );
605
605
deleteVolume ("research" );
606
606
607
607
executeHA (tenantShell , new String [] {
608
608
"user" , "revoke" , "finance$bob" });
609
- checkOutput (out , "" , true );
610
- checkOutput (err , "" , true );
609
+ checkOutput (OUT , "" , true );
610
+ checkOutput (ERR , "" , true );
611
611
612
612
executeHA (tenantShell , new String [] {"list" });
613
- checkOutput (out , "dev\n finance\n " , true );
614
- checkOutput (err , "" , true );
613
+ checkOutput (OUT , "dev\n finance\n " , true );
614
+ checkOutput (ERR , "" , true );
615
615
616
616
executeHA (tenantShell , new String [] {"delete" , "finance" });
617
- checkOutput (out , "" , true );
618
- checkOutput (err , "Deleted tenant 'finance'.\n " , false );
617
+ checkOutput (OUT , "" , true );
618
+ checkOutput (ERR , "Deleted tenant 'finance'.\n " , false );
619
619
deleteVolume ("finance" );
620
620
621
621
executeHA (tenantShell , new String [] {"list" });
622
- checkOutput (out , "dev\n " , true );
623
- checkOutput (err , "" , true );
622
+ checkOutput (OUT , "dev\n " , true );
623
+ checkOutput (ERR , "" , true );
624
624
625
625
// Attempt to delete tenant with accessIds still assigned to it, should fail
626
626
int exitCode = executeHA (tenantShell , new String [] {"delete" , "dev" });
627
627
assertNotEquals (0 , exitCode , "Tenant delete should fail!" );
628
- checkOutput (out , "" , true );
629
- checkOutput (err , "Tenant 'dev' is not empty. All accessIds associated "
628
+ checkOutput (OUT , "" , true );
629
+ checkOutput (ERR , "Tenant 'dev' is not empty. All accessIds associated "
630
630
+ "to this tenant must be revoked before the tenant can be deleted. "
631
631
+ "See `ozone tenant user revoke`\n " , true );
632
632
@@ -643,113 +643,113 @@ public void testOzoneTenantBasicOperations() throws IOException {
643
643
// Delete dev volume should fail because the volume reference count > 0L
644
644
exitCode = execute (ozoneSh , new String [] {"volume" , "delete" , "dev" });
645
645
assertNotEquals (0 , exitCode , "Volume delete should fail!" );
646
- checkOutput (out , "" , true );
647
- checkOutput (err , "Volume reference count is not zero (1). "
646
+ checkOutput (OUT , "" , true );
647
+ checkOutput (ERR , "Volume reference count is not zero (1). "
648
648
+ "Ozone features are enabled on this volume. "
649
649
+ "Try `ozone tenant delete <tenantId>` first.\n " , true );
650
650
651
651
executeHA (tenantShell , new String [] {"list" });
652
- checkOutput (out , "dev\n " , true );
653
- checkOutput (err , "" , true );
652
+ checkOutput (OUT , "dev\n " , true );
653
+ checkOutput (ERR , "" , true );
654
654
655
655
// Revoke accessId first
656
656
executeHA (tenantShell , new String [] {
657
657
"user" , "revoke" , "dev$bob" });
658
- checkOutput (out , "" , true );
659
- checkOutput (err , "" , true );
658
+ checkOutput (OUT , "" , true );
659
+ checkOutput (ERR , "" , true );
660
660
661
661
// Then delete tenant, should succeed
662
662
executeHA (tenantShell , new String [] {"--verbose" , "delete" , "dev" });
663
- checkOutput (out , "{\n " + " \" tenantId\" : \" dev\" ,\n "
663
+ checkOutput (OUT , "{\n " + " \" tenantId\" : \" dev\" ,\n "
664
664
+ " \" volumeName\" : \" dev\" ,\n " + " \" volumeRefCount\" : 0\n " + "}\n " ,
665
665
true , true );
666
- checkOutput (err , "Deleted tenant 'dev'.\n " , false );
666
+ checkOutput (ERR , "Deleted tenant 'dev'.\n " , false );
667
667
deleteVolume ("dev" );
668
668
669
669
// Sanity check: tenant list should be empty
670
670
executeHA (tenantShell , new String [] {"list" });
671
- checkOutput (out , "" , true );
672
- checkOutput (err , "" , true );
671
+ checkOutput (OUT , "" , true );
672
+ checkOutput (ERR , "" , true );
673
673
}
674
674
675
675
@ Test
676
676
public void testListTenantUsers () throws IOException {
677
677
executeHA (tenantShell , new String [] {"--verbose" , "create" , "tenant1" });
678
- checkOutput (out , "{\n " +
678
+ checkOutput (OUT , "{\n " +
679
679
" \" tenantId\" : \" tenant1\" \n " + "}\n " , true , true );
680
- checkOutput (err , "" , true );
680
+ checkOutput (ERR , "" , true );
681
681
682
682
executeHA (tenantShell , new String [] {
683
683
"--verbose" , "user" , "assign" , "alice" , "--tenant=tenant1" });
684
- checkOutput (out , "export AWS_ACCESS_KEY_ID='tenant1$alice'\n "
684
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='tenant1$alice'\n "
685
685
+ "export AWS_SECRET_ACCESS_KEY='" , false );
686
- checkOutput (err , "Assigned 'alice' to 'tenant1'" +
686
+ checkOutput (ERR , "Assigned 'alice' to 'tenant1'" +
687
687
" with accessId 'tenant1$alice'.\n " , true );
688
688
689
689
executeHA (tenantShell , new String [] {
690
690
"user" , "assign" , "bob" , "--tenant=tenant1" });
691
- checkOutput (out , "export AWS_ACCESS_KEY_ID='tenant1$bob'\n "
691
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='tenant1$bob'\n "
692
692
+ "export AWS_SECRET_ACCESS_KEY='" , false );
693
- checkOutput (err , "" , true );
693
+ checkOutput (ERR , "" , true );
694
694
695
695
executeHA (tenantShell , new String [] {
696
696
"user" , "list" , "tenant1" });
697
- checkOutput (out , "- User 'bob' with accessId 'tenant1$bob'\n " +
697
+ checkOutput (OUT , "- User 'bob' with accessId 'tenant1$bob'\n " +
698
698
"- User 'alice' with accessId 'tenant1$alice'\n " , true );
699
- checkOutput (err , "" , true );
699
+ checkOutput (ERR , "" , true );
700
700
701
701
executeHA (tenantShell , new String [] {
702
702
"user" , "list" , "tenant1" , "--json" });
703
- checkOutput (out ,
703
+ checkOutput (OUT ,
704
704
"[ {\n " +
705
705
" \" user\" : \" bob\" ,\n " +
706
706
" \" accessId\" : \" tenant1$bob\" \n " +
707
707
"}, {\n " +
708
708
" \" user\" : \" alice\" ,\n " +
709
709
" \" accessId\" : \" tenant1$alice\" \n " +
710
710
"} ]\n " , true );
711
- checkOutput (err , "" , true );
711
+ checkOutput (ERR , "" , true );
712
712
713
713
executeHA (tenantShell , new String [] {
714
714
"user" , "list" , "tenant1" , "--prefix=b" });
715
- checkOutput (out , "- User 'bob' with accessId " +
715
+ checkOutput (OUT , "- User 'bob' with accessId " +
716
716
"'tenant1$bob'\n " , true );
717
- checkOutput (err , "" , true );
717
+ checkOutput (ERR , "" , true );
718
718
719
719
executeHA (tenantShell , new String [] {
720
720
"user" , "list" , "tenant1" , "--prefix=b" , "--json" });
721
- checkOutput (out , "[ {\n " +
721
+ checkOutput (OUT , "[ {\n " +
722
722
" \" user\" : \" bob\" ,\n " +
723
723
" \" accessId\" : \" tenant1$bob\" \n " +
724
724
"} ]\n " , true );
725
- checkOutput (err , "" , true );
725
+ checkOutput (ERR , "" , true );
726
726
727
727
int exitCode = executeHA (tenantShell , new String [] {
728
728
"user" , "list" , "unknown" });
729
729
assertNotEquals (0 , exitCode , "Expected non-zero exit code" );
730
- checkOutput (out , "" , true );
731
- checkOutput (err , "Tenant 'unknown' doesn't exist.\n " , true );
730
+ checkOutput (OUT , "" , true );
731
+ checkOutput (ERR , "Tenant 'unknown' doesn't exist.\n " , true );
732
732
733
733
// Clean up
734
734
executeHA (tenantShell , new String [] {
735
735
"user" , "revoke" , "tenant1$alice" });
736
- checkOutput (out , "" , true );
737
- checkOutput (err , "" , true );
736
+ checkOutput (OUT , "" , true );
737
+ checkOutput (ERR , "" , true );
738
738
739
739
executeHA (tenantShell , new String [] {
740
740
"--verbose" , "user" , "revoke" , "tenant1$bob" });
741
- checkOutput (out , "" , true );
742
- checkOutput (err , "Revoked accessId" , false );
741
+ checkOutput (OUT , "" , true );
742
+ checkOutput (ERR , "Revoked accessId" , false );
743
743
744
744
executeHA (tenantShell , new String [] {"delete" , "tenant1" });
745
- checkOutput (out , "" , true );
746
- checkOutput (err , "Deleted tenant 'tenant1'.\n " , false );
745
+ checkOutput (OUT , "" , true );
746
+ checkOutput (ERR , "Deleted tenant 'tenant1'.\n " , false );
747
747
deleteVolume ("tenant1" );
748
748
749
749
// Sanity check: tenant list should be empty
750
750
executeHA (tenantShell , new String [] {"list" });
751
- checkOutput (out , "" , true );
752
- checkOutput (err , "" , true );
751
+ checkOutput (OUT , "" , true );
752
+ checkOutput (ERR , "" , true );
753
753
}
754
754
755
755
@ Test
@@ -759,44 +759,44 @@ public void testTenantSetSecret() throws IOException, InterruptedException {
759
759
760
760
// Create test tenant
761
761
executeHA (tenantShell , new String [] {"create" , tenantName });
762
- checkOutput (out , "" , true );
763
- checkOutput (err , "" , true );
762
+ checkOutput (OUT , "" , true );
763
+ checkOutput (ERR , "" , true );
764
764
765
765
// Set secret for non-existent accessId. Expect failure
766
766
executeHA (tenantShell , new String [] {
767
767
"user" , "set-secret" , tenantName + "$alice" , "--secret=somesecret0" });
768
- checkOutput (out , "" , true );
769
- checkOutput (err , "accessId '" + tenantName + "$alice' not found.\n " , true );
768
+ checkOutput (OUT , "" , true );
769
+ checkOutput (ERR , "accessId '" + tenantName + "$alice' not found.\n " , true );
770
770
771
771
// Assign a user to the tenant so that we have an accessId entry
772
772
executeHA (tenantShell , new String [] {
773
773
"user" , "assign" , "alice" , "--tenant=" + tenantName });
774
- checkOutput (out , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
774
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
775
775
"export AWS_SECRET_ACCESS_KEY='" , false );
776
- checkOutput (err , "" , true );
776
+ checkOutput (ERR , "" , true );
777
777
778
778
// Set secret as OM admin should succeed
779
779
executeHA (tenantShell , new String [] {
780
780
"user" , "setsecret" , tenantName + "$alice" ,
781
781
"--secret=somesecret1" });
782
- checkOutput (out , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
782
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
783
783
"export AWS_SECRET_ACCESS_KEY='somesecret1'\n " , true );
784
- checkOutput (err , "" , true );
784
+ checkOutput (ERR , "" , true );
785
785
786
786
// Set empty secret key should fail
787
787
int exitCode = executeHA (tenantShell , new String [] {
788
788
"user" , "setsecret" , tenantName + "$alice" ,
789
789
"--secret=short" });
790
790
assertNotEquals (0 , exitCode , "Expected non-zero exit code" );
791
- checkOutput (out , "" , true );
792
- checkOutput (err , "Secret key length should be at least 8 characters\n " ,
791
+ checkOutput (OUT , "" , true );
792
+ checkOutput (ERR , "Secret key length should be at least 8 characters\n " ,
793
793
true );
794
794
795
795
// Get secret should still give the previous secret key
796
796
executeHA (tenantShell , new String [] {
797
797
"user" , "getsecret" , tenantName + "$alice" });
798
- checkOutput (out , "somesecret1" , false );
799
- checkOutput (err , "" , true );
798
+ checkOutput (OUT , "somesecret1" , false );
799
+ checkOutput (ERR , "" , true );
800
800
801
801
// Set secret as alice should succeed
802
802
final UserGroupInformation ugiAlice = UserGroupInformation
@@ -806,18 +806,18 @@ public void testTenantSetSecret() throws IOException, InterruptedException {
806
806
executeHA (tenantShell , new String [] {
807
807
"user" , "setsecret" , tenantName + "$alice" ,
808
808
"--secret=somesecret2" });
809
- checkOutput (out , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
809
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
810
810
"export AWS_SECRET_ACCESS_KEY='somesecret2'\n " , true );
811
- checkOutput (err , "" , true );
811
+ checkOutput (ERR , "" , true );
812
812
return null ;
813
813
});
814
814
815
815
// Set secret as bob should fail
816
816
executeHA (tenantShell , new String [] {
817
817
"user" , "assign" , "bob" , "--tenant=" + tenantName });
818
- checkOutput (out , "export AWS_ACCESS_KEY_ID='" + tenantName + "$bob'\n " +
818
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='" + tenantName + "$bob'\n " +
819
819
"export AWS_SECRET_ACCESS_KEY='" , false );
820
- checkOutput (err , "" , true );
820
+ checkOutput (ERR , "" , true );
821
821
822
822
final UserGroupInformation ugiBob = UserGroupInformation
823
823
.createUserForTesting ("bob" , new String [] {"usergroup" });
@@ -827,8 +827,8 @@ public void testTenantSetSecret() throws IOException, InterruptedException {
827
827
"user" , "setsecret" , tenantName + "$alice" ,
828
828
"--secret=somesecret2" });
829
829
assertNotEquals (0 , exitC , "Should return non-zero exit code!" );
830
- checkOutput (out , "" , true );
831
- checkOutput (err , "Requested accessId 'tenant-test-set-secret$alice'"
830
+ checkOutput (OUT , "" , true );
831
+ checkOutput (ERR , "Requested accessId 'tenant-test-set-secret$alice'"
832
832
+ " doesn't belong to current user 'bob', nor does current user"
833
833
+ " have Ozone or tenant administrator privilege\n " , true );
834
834
return null ;
@@ -839,45 +839,45 @@ public void testTenantSetSecret() throws IOException, InterruptedException {
839
839
executeHA (tenantShell , new String [] {"user" , "assign-admin" ,
840
840
tenantName + "$" + ugiBob .getShortUserName (),
841
841
"--tenant=" + tenantName , "--delegated=false" });
842
- checkOutput (out , "" , true );
843
- checkOutput (err , "" , true );
842
+ checkOutput (OUT , "" , true );
843
+ checkOutput (ERR , "" , true );
844
844
845
845
// Set secret should succeed now
846
846
ugiBob .doAs ((PrivilegedExceptionAction <Void >) () -> {
847
847
executeHA (tenantShell , new String [] {
848
848
"user" , "setsecret" , tenantName + "$alice" ,
849
849
"--secret=somesecret2" });
850
- checkOutput (out , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
850
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
851
851
"export AWS_SECRET_ACCESS_KEY='somesecret2'\n " , true );
852
- checkOutput (err , "" , true );
852
+ checkOutput (ERR , "" , true );
853
853
return null ;
854
854
});
855
855
856
856
// Clean up
857
857
executeHA (tenantShell , new String [] {"user" , "revoke-admin" ,
858
858
tenantName + "$" + ugiBob .getShortUserName ()});
859
- checkOutput (out , "" , true );
860
- checkOutput (err , "" , true );
859
+ checkOutput (OUT , "" , true );
860
+ checkOutput (ERR , "" , true );
861
861
862
862
executeHA (tenantShell , new String [] {
863
863
"user" , "revoke" , tenantName + "$bob" });
864
- checkOutput (out , "" , true );
865
- checkOutput (err , "" , true );
864
+ checkOutput (OUT , "" , true );
865
+ checkOutput (ERR , "" , true );
866
866
867
867
executeHA (tenantShell , new String [] {
868
868
"user" , "revoke" , tenantName + "$alice" });
869
- checkOutput (out , "" , true );
870
- checkOutput (err , "" , true );
869
+ checkOutput (OUT , "" , true );
870
+ checkOutput (ERR , "" , true );
871
871
872
872
executeHA (tenantShell , new String [] {"delete" , tenantName });
873
- checkOutput (out , "" , true );
874
- checkOutput (err , "Deleted tenant '" + tenantName + "'.\n " , false );
873
+ checkOutput (OUT , "" , true );
874
+ checkOutput (ERR , "Deleted tenant '" + tenantName + "'.\n " , false );
875
875
deleteVolume (tenantName );
876
876
877
877
// Sanity check: tenant list should be empty
878
878
executeHA (tenantShell , new String [] {"list" });
879
- checkOutput (out , "" , true );
880
- checkOutput (err , "" , true );
879
+ checkOutput (OUT , "" , true );
880
+ checkOutput (ERR , "" , true );
881
881
}
882
882
883
883
@ Test
@@ -895,35 +895,35 @@ public void testTenantAdminOperations()
895
895
896
896
// Create test tenant
897
897
executeHA (tenantShell , new String [] {"create" , tenantName });
898
- checkOutput (out , "" , true );
899
- checkOutput (err , "" , true );
898
+ checkOutput (OUT , "" , true );
899
+ checkOutput (ERR , "" , true );
900
900
901
901
// Assign alice and bob as tenant users
902
902
executeHA (tenantShell , new String [] {
903
903
"user" , "assign" , "alice" , "--tenant=" + tenantName });
904
- checkOutput (out , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
904
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
905
905
"export AWS_SECRET_ACCESS_KEY='" , false );
906
- checkOutput (err , "" , true );
906
+ checkOutput (ERR , "" , true );
907
907
908
908
executeHA (tenantShell , new String [] {
909
909
"user" , "assign" , "bob" , "--tenant=" + tenantName });
910
- checkOutput (out , "export AWS_ACCESS_KEY_ID='" + tenantName + "$bob'\n " +
910
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='" + tenantName + "$bob'\n " +
911
911
"export AWS_SECRET_ACCESS_KEY='" , false );
912
- checkOutput (err , "" , true );
912
+ checkOutput (ERR , "" , true );
913
913
914
914
// Make alice a delegated tenant admin
915
915
executeHA (tenantShell , new String [] {"user" , "assign-admin" ,
916
916
tenantName + "$" + ugiAlice .getShortUserName (),
917
917
"--tenant=" + tenantName , "--delegated=true" });
918
- checkOutput (out , "" , true );
919
- checkOutput (err , "" , true );
918
+ checkOutput (OUT , "" , true );
919
+ checkOutput (ERR , "" , true );
920
920
921
921
// Make bob a non-delegated tenant admin
922
922
executeHA (tenantShell , new String [] {"user" , "assign-admin" ,
923
923
tenantName + "$" + ugiBob .getShortUserName (),
924
924
"--tenant=" + tenantName , "--delegated=false" });
925
- checkOutput (out , "" , true );
926
- checkOutput (err , "" , true );
925
+ checkOutput (OUT , "" , true );
926
+ checkOutput (ERR , "" , true );
927
927
928
928
// Start test matrix
929
929
@@ -935,49 +935,49 @@ public void testTenantAdminOperations()
935
935
// Assign carol as a new tenant user
936
936
executeHA (tenantShell , new String [] {
937
937
"user" , "assign" , "carol" , "--tenant=" + tenantName });
938
- checkOutput (out , "export AWS_ACCESS_KEY_ID='" + tenantName + "$carol'\n "
938
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='" + tenantName + "$carol'\n "
939
939
+ "export AWS_SECRET_ACCESS_KEY='" , false );
940
- checkOutput (err , "" , true );
940
+ checkOutput (ERR , "" , true );
941
941
942
942
// Set secret should work
943
943
executeHA (tenantShell , new String [] {
944
944
"user" , "setsecret" , tenantName + "$alice" ,
945
945
"--secret=somesecret2" });
946
- checkOutput (out , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
946
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
947
947
"export AWS_SECRET_ACCESS_KEY='somesecret2'\n " , true );
948
- checkOutput (err , "" , true );
948
+ checkOutput (ERR , "" , true );
949
949
950
950
// Make carol a tenant delegated tenant admin
951
951
executeHA (tenantShell , new String [] {"user" , "assign-admin" ,
952
952
tenantName + "$carol" ,
953
953
"--tenant=" + tenantName , "--delegated=true" });
954
- checkOutput (out , "" , true );
955
- checkOutput (err , "" , true );
954
+ checkOutput (OUT , "" , true );
955
+ checkOutput (ERR , "" , true );
956
956
957
957
// Revoke carol's tenant admin privilege
958
958
executeHA (tenantShell , new String [] {"user" , "revoke-admin" ,
959
959
tenantName + "$carol" });
960
- checkOutput (out , "" , true );
961
- checkOutput (err , "" , true );
960
+ checkOutput (OUT , "" , true );
961
+ checkOutput (ERR , "" , true );
962
962
963
963
// Make carol a tenant non-delegated tenant admin
964
964
executeHA (tenantShell , new String [] {"user" , "assign-admin" ,
965
965
tenantName + "$carol" ,
966
966
"--tenant=" + tenantName , "--delegated=false" });
967
- checkOutput (out , "" , true );
968
- checkOutput (err , "" , true );
967
+ checkOutput (OUT , "" , true );
968
+ checkOutput (ERR , "" , true );
969
969
970
970
// Revoke carol's tenant admin privilege
971
971
executeHA (tenantShell , new String [] {"user" , "revoke-admin" ,
972
972
tenantName + "$carol" });
973
- checkOutput (out , "" , true );
974
- checkOutput (err , "" , true );
973
+ checkOutput (OUT , "" , true );
974
+ checkOutput (ERR , "" , true );
975
975
976
976
// Revoke carol's accessId from this tenant
977
977
executeHA (tenantShell , new String [] {
978
978
"user" , "revoke" , tenantName + "$carol" });
979
- checkOutput (out , "" , true );
980
- checkOutput (err , "" , true );
979
+ checkOutput (OUT , "" , true );
980
+ checkOutput (ERR , "" , true );
981
981
return null ;
982
982
});
983
983
@@ -991,73 +991,73 @@ public void testTenantAdminOperations()
991
991
// Assign carol as a new tenant user
992
992
executeHA (tenantShell , new String [] {
993
993
"user" , "assign" , "carol" , "--tenant=" + tenantName });
994
- checkOutput (out , "export AWS_ACCESS_KEY_ID='" + tenantName + "$carol'\n "
994
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='" + tenantName + "$carol'\n "
995
995
+ "export AWS_SECRET_ACCESS_KEY='" , false );
996
- checkOutput (err , "" , true );
996
+ checkOutput (ERR , "" , true );
997
997
998
998
// Set secret should work, even for a non-delegated admin
999
999
executeHA (tenantShell , new String [] {
1000
1000
"user" , "setsecret" , tenantName + "$alice" ,
1001
1001
"--secret=somesecret2" });
1002
- checkOutput (out , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
1002
+ checkOutput (OUT , "export AWS_ACCESS_KEY_ID='" + tenantName + "$alice'\n " +
1003
1003
"export AWS_SECRET_ACCESS_KEY='somesecret2'\n " , true );
1004
- checkOutput (err , "" , true );
1004
+ checkOutput (ERR , "" , true );
1005
1005
1006
1006
// Attempt to make carol a tenant delegated tenant admin, should fail
1007
1007
executeHA (tenantShell , new String [] {"user" , "assign-admin" ,
1008
1008
tenantName + "$carol" ,
1009
1009
"--tenant=" + tenantName , "--delegated=true" });
1010
- checkOutput (out , "" , true );
1011
- checkOutput (err , "User 'bob' is neither an Ozone admin "
1010
+ checkOutput (OUT , "" , true );
1011
+ checkOutput (ERR , "User 'bob' is neither an Ozone admin "
1012
1012
+ "nor a delegated admin of tenant" , false );
1013
1013
1014
1014
// Attempt to make carol a tenant non-delegated tenant admin, should fail
1015
1015
executeHA (tenantShell , new String [] {"user" , "assign-admin" ,
1016
1016
tenantName + "$carol" ,
1017
1017
"--tenant=" + tenantName , "--delegated=false" });
1018
- checkOutput (out , "" , true );
1019
- checkOutput (err , "User 'bob' is neither an Ozone admin "
1018
+ checkOutput (OUT , "" , true );
1019
+ checkOutput (ERR , "User 'bob' is neither an Ozone admin "
1020
1020
+ "nor a delegated admin of tenant" , false );
1021
1021
1022
1022
// Attempt to revoke tenant admin, should fail at the permission check
1023
1023
executeHA (tenantShell , new String [] {"user" , "revoke-admin" ,
1024
1024
tenantName + "$carol" });
1025
- checkOutput (out , "" , true );
1026
- checkOutput (err , "User 'bob' is neither an Ozone admin "
1025
+ checkOutput (OUT , "" , true );
1026
+ checkOutput (ERR , "User 'bob' is neither an Ozone admin "
1027
1027
+ "nor a delegated admin of tenant" , false );
1028
1028
1029
1029
// Revoke carol's accessId from this tenant
1030
1030
executeHA (tenantShell , new String [] {
1031
1031
"user" , "revoke" , tenantName + "$carol" });
1032
- checkOutput (out , "" , true );
1033
- checkOutput (err , "" , true );
1032
+ checkOutput (OUT , "" , true );
1033
+ checkOutput (ERR , "" , true );
1034
1034
return null ;
1035
1035
});
1036
1036
1037
1037
// Clean up
1038
1038
executeHA (tenantShell , new String [] {"user" , "revoke-admin" ,
1039
1039
tenantName + "$" + ugiAlice .getShortUserName ()});
1040
- checkOutput (out , "" , true );
1041
- checkOutput (err , "" , true );
1040
+ checkOutput (OUT , "" , true );
1041
+ checkOutput (ERR , "" , true );
1042
1042
1043
1043
executeHA (tenantShell , new String [] {
1044
1044
"user" , "revoke" , tenantName + "$" + ugiAlice .getShortUserName ()});
1045
- checkOutput (out , "" , true );
1046
- checkOutput (err , "" , true );
1045
+ checkOutput (OUT , "" , true );
1046
+ checkOutput (ERR , "" , true );
1047
1047
1048
1048
executeHA (tenantShell , new String [] {"user" , "revoke-admin" ,
1049
1049
tenantName + "$" + ugiBob .getShortUserName ()});
1050
- checkOutput (out , "" , true );
1051
- checkOutput (err , "" , true );
1050
+ checkOutput (OUT , "" , true );
1051
+ checkOutput (ERR , "" , true );
1052
1052
1053
1053
executeHA (tenantShell , new String [] {
1054
1054
"user" , "revoke" , tenantName + "$" + ugiBob .getShortUserName ()});
1055
- checkOutput (out , "" , true );
1056
- checkOutput (err , "" , true );
1055
+ checkOutput (OUT , "" , true );
1056
+ checkOutput (ERR , "" , true );
1057
1057
1058
1058
executeHA (tenantShell , new String [] {"delete" , tenantName });
1059
- checkOutput (out , "" , true );
1060
- checkOutput (err , "Deleted tenant '" + tenantName + "'.\n " , false );
1059
+ checkOutput (OUT , "" , true );
1060
+ checkOutput (ERR , "Deleted tenant '" + tenantName + "'.\n " , false );
1061
1061
deleteVolume (tenantName );
1062
1062
}
1063
1063
@@ -1067,29 +1067,29 @@ public void testCreateTenantOnExistingVolume() throws IOException {
1067
1067
int exitC = execute (ozoneSh , new String [] {"volume" , "create" , testVolume });
1068
1068
// Volume create should succeed
1069
1069
assertEquals (0 , exitC );
1070
- checkOutput (out , "" , true );
1071
- checkOutput (err , "" , true );
1070
+ checkOutput (OUT , "" , true );
1071
+ checkOutput (ERR , "" , true );
1072
1072
1073
1073
// Try to create tenant on the same volume, should fail by default
1074
1074
executeHA (tenantShell , new String [] {"create" , testVolume });
1075
- checkOutput (out , "" , true );
1076
- checkOutput (err , "Volume already exists\n " , true );
1075
+ checkOutput (OUT , "" , true );
1076
+ checkOutput (ERR , "Volume already exists\n " , true );
1077
1077
1078
1078
// Try to create tenant on the same volume with --force, should work
1079
1079
executeHA (tenantShell , new String [] {"create" , testVolume , "--force" });
1080
- checkOutput (out , "" , true );
1081
- checkOutput (err , "" , true );
1080
+ checkOutput (OUT , "" , true );
1081
+ checkOutput (ERR , "" , true );
1082
1082
1083
1083
// Try to create the same tenant one more time, should fail even
1084
1084
// with --force because the tenant already exists.
1085
1085
executeHA (tenantShell , new String [] {"create" , testVolume , "--force" });
1086
- checkOutput (out , "" , true );
1087
- checkOutput (err , "Tenant '" + testVolume + "' already exists\n " , true );
1086
+ checkOutput (OUT , "" , true );
1087
+ checkOutput (ERR , "Tenant '" + testVolume + "' already exists\n " , true );
1088
1088
1089
1089
// Clean up
1090
1090
executeHA (tenantShell , new String [] {"delete" , testVolume });
1091
- checkOutput (out , "" , true );
1092
- checkOutput (err , "Deleted tenant '" + testVolume + "'.\n " , false );
1091
+ checkOutput (OUT , "" , true );
1092
+ checkOutput (ERR , "Deleted tenant '" + testVolume + "'.\n " , false );
1093
1093
deleteVolume (testVolume );
1094
1094
}
1095
1095
}
0 commit comments