예제 #1
0
  @Test
  public void testStatVFS() throws Exception, VolumeNotFoundException {
    final String VOLUME_NAME_1 = "foobar";
    client.createVolume(mrcAddress, auth, userCredentials, VOLUME_NAME_1);

    Volume volume = client.openVolume(VOLUME_NAME_1, null, options);

    StatVFS volumeVFS = volume.statFS(userCredentials);

    MRCServiceClient mrcClient = new MRCServiceClient(testEnv.getRpcClient(), null);

    StatVFS mrcClientVFS = null;
    RPCResponse<StatVFS> resp = null;
    try {
      statvfsRequest input =
          statvfsRequest.newBuilder().setVolumeName(VOLUME_NAME_1).setKnownEtag(0).build();
      resp = mrcClient.statvfs(testEnv.getMRCAddress(), auth, userCredentials, input);
      mrcClientVFS = resp.get();
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      if (resp != null) {
        resp.freeBuffers();
      }
    }
    assertNotNull(volumeVFS);
    assertEquals(mrcClientVFS, volumeVFS);
  }