SaketaChalamchala commented on code in PR #6755:
URL: https://github.com/apache/ozone/pull/6755#discussion_r1623006677


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestNSSummaryAdmin.java:
##########
@@ -115,7 +115,25 @@ public void testNSSummaryCLIRoot() throws 
UnsupportedEncodingException {
     String path = "/";
     executeAdminCommands(path);
     // Should throw warning - only buckets can have bucket layout.
-    assertThat(getOutContentString()).contains("[Warning] Namespace CLI is not 
designed for OBS bucket layout.");
+    assertThat(getOutContentString()).doesNotContain("INVALID_VOLUME_NAME");
+    assertThat(getOutContentString()).doesNotContain(
+        "[Warning] Namespace CLI is not designed for OBS bucket layout.");
+    assertThat(getOutContentString()).contains("Put more files into it to 
visualize DU");
+    assertThat(getOutContentString()).contains("Put more files into it to 
visualize file size distribution");
+  }
+
+  /**
+   * Test NSSummaryCLI on volume.
+   */
+  @Test
+  public void testNSSummaryCLIVolume() throws UnsupportedEncodingException {
+    // Running on root path.
+    String path = "/" + volumeName;
+    executeAdminCommands(path);
+    // Should throw warning - only buckets can have bucket layout.
+    assertThat(getOutContentString()).doesNotContain("INVALID_BUCKET_NAME");
+    assertThat(getOutContentString()).doesNotContain(
+        "[Warning] Namespace CLI is not designed for OBS bucket layout.");

Review Comment:
   @devmadhuu If `du` is supported for all buckets should we just avoid doing 
the validation for bucket layout i.e., `isNotValidBucketOrOBSBucket` in 
`DiskUsageSubCommand` instead of changing the warning message? Because the 
warning message is also used by FileSizeDist, QuatUsage and Summary sub 
commands as well. 



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestNSSummaryAdmin.java:
##########
@@ -115,7 +115,25 @@ public void testNSSummaryCLIRoot() throws 
UnsupportedEncodingException {
     String path = "/";
     executeAdminCommands(path);
     // Should throw warning - only buckets can have bucket layout.
-    assertThat(getOutContentString()).contains("[Warning] Namespace CLI is not 
designed for OBS bucket layout.");
+    assertThat(getOutContentString()).doesNotContain("INVALID_VOLUME_NAME");
+    assertThat(getOutContentString()).doesNotContain(
+        "[Warning] Namespace CLI is not designed for OBS bucket layout.");
+    assertThat(getOutContentString()).contains("Put more files into it to 
visualize DU");
+    assertThat(getOutContentString()).contains("Put more files into it to 
visualize file size distribution");
+  }
+
+  /**
+   * Test NSSummaryCLI on volume.
+   */
+  @Test
+  public void testNSSummaryCLIVolume() throws UnsupportedEncodingException {
+    // Running on root path.
+    String path = "/" + volumeName;
+    executeAdminCommands(path);
+    // Should throw warning - only buckets can have bucket layout.
+    assertThat(getOutContentString()).doesNotContain("INVALID_BUCKET_NAME");
+    assertThat(getOutContentString()).doesNotContain(
+        "[Warning] Namespace CLI is not designed for OBS bucket layout.");

Review Comment:
   @devmadhuu If `du` is supported for all buckets should we just avoid doing 
the validation for bucket layout i.e., `isNotValidBucketOrOBSBucket` in 
`DiskUsageSubCommand` instead of changing the warning message? Because the 
warning message is also used by FileSizeDist, QuotaUsage and Summary sub 
commands as well. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to