@Test
  public void testTestStorageAvailability() throws Exception {
    assumeTrue(isLogSegmented);
    // When there is no error, the storage should be available
    assertTrue(store.testStorageAvailability());
    store.shutdown();
    // When the store is shutdown, it should return false
    assertFalse(store.testStorageAvailability());

    properties.put("store.io.error.count.to.trigger.shutdown", "2");
    BlobStore testStore =
        createBlobStore(getMockReplicaId(tempDirStr), new StoreConfig(new VerifiableProperties(properties)), null);
    testStore.start();
    assertTrue(testStore.testStorageAvailability());
    if (NativeIO.POSIX.fadvisePossible) {
      // Invalidate page cache for this file and remove all the log segment files, this would trigger testStorageAvailability
      // method to read data from disk, which is deleted already.
      LogSegment segment = testStore.getLog().getFirstSegment();
      while (segment != null) {
        Pair<File, FileChannel> view = segment.getView();
        FileChannel fileChannel = view.getSecond();
        FileDescriptor fd = getFileDescriptorFromFileChannel(fileChannel);
        NativeIO.POSIX.getCacheManipulator()
            .posixFadviseIfPossible("blobstoretest", fd, 0, view.getFirst().length(),
                NativeIO.POSIX.POSIX_FADV_DONTNEED);
        segment.closeView();
        segment = testStore.getLog().getNextSegment(segment);
      }
      Utils.deleteFileOrDirectory(tempDir);
      assertFalse(testStore.testStorageAvailability());
      assertFalse(testStore.isStarted());
    }
    testStore.shutdown();
  }
Test {@link BlobStore#testStorageAvailability()}. Create a blob store with the existing log segment files, it should
return true from the method. After deleting the log segment files and invalidate the page cache for log segment files,
it should return false.
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/BlobStoreTest.java