Package org.apache.hadoop.nfs

Examples of org.apache.hadoop.nfs.NfsExports


 
  private static final int CacheSize = Nfs3Constant.EXPORTS_CACHE_SIZE_DEFAULT;

  @Test
  public void testWildcardRW() {
    NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod, "* rw");
    Assert.assertEquals(AccessPrivilege.READ_WRITE,
        matcher.getAccessPrivilege(address1, hostname1));
  }
View Full Code Here


        matcher.getAccessPrivilege(address1, hostname1));
  }

  @Test
  public void testWildcardRO() {
    NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod, "* ro");
    Assert.assertEquals(AccessPrivilege.READ_ONLY,
        matcher.getAccessPrivilege(address1, hostname1));
  }
View Full Code Here

        matcher.getAccessPrivilege(address1, hostname1));
  }

  @Test
  public void testExactAddressRW() {
    NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod, address1
        + " rw");
    Assert.assertEquals(AccessPrivilege.READ_WRITE,
        matcher.getAccessPrivilege(address1, hostname1));
    Assert.assertFalse(AccessPrivilege.READ_WRITE == matcher
        .getAccessPrivilege(address2, hostname1));
  }
View Full Code Here

        .getAccessPrivilege(address2, hostname1));
  }

  @Test
  public void testExactAddressRO() {
    NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod, address1);
    Assert.assertEquals(AccessPrivilege.READ_ONLY,
        matcher.getAccessPrivilege(address1, hostname1));
    Assert.assertEquals(AccessPrivilege.NONE,
        matcher.getAccessPrivilege(address2, hostname1));
  }
View Full Code Here

        matcher.getAccessPrivilege(address2, hostname1));
  }

  @Test
  public void testExactHostRW() {
    NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod, hostname1
        + " rw");
    Assert.assertEquals(AccessPrivilege.READ_WRITE,
        matcher.getAccessPrivilege(address1, hostname1));
  }
View Full Code Here

        matcher.getAccessPrivilege(address1, hostname1));
  }

  @Test
  public void testExactHostRO() {
    NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod, hostname1);
    Assert.assertEquals(AccessPrivilege.READ_ONLY,
        matcher.getAccessPrivilege(address1, hostname1));
  }
View Full Code Here

        matcher.getAccessPrivilege(address1, hostname1));
  }

  @Test
  public void testCidrShortRW() {
    NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod,
        "192.168.0.0/22 rw");
    Assert.assertEquals(AccessPrivilege.READ_WRITE,
        matcher.getAccessPrivilege(address1, hostname1));
    Assert.assertEquals(AccessPrivilege.NONE,
        matcher.getAccessPrivilege(address2, hostname1));
  }
View Full Code Here

        matcher.getAccessPrivilege(address2, hostname1));
  }

  @Test
  public void testCidrShortRO() {
    NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod,
        "192.168.0.0/22");
    Assert.assertEquals(AccessPrivilege.READ_ONLY,
        matcher.getAccessPrivilege(address1, hostname1));
    Assert.assertEquals(AccessPrivilege.NONE,
        matcher.getAccessPrivilege(address2, hostname1));
  }
View Full Code Here

        matcher.getAccessPrivilege(address2, hostname1));
  }

  @Test
  public void testCidrLongRW() {
    NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod,
        "192.168.0.0/255.255.252.0 rw");
    Assert.assertEquals(AccessPrivilege.READ_WRITE,
        matcher.getAccessPrivilege(address1, hostname1));
    Assert.assertEquals(AccessPrivilege.NONE,
        matcher.getAccessPrivilege(address2, hostname1));
  }
View Full Code Here

        matcher.getAccessPrivilege(address2, hostname1));
  }

  @Test
  public void testCidrLongRO() {
    NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod,
        "192.168.0.0/255.255.252.0");
    Assert.assertEquals(AccessPrivilege.READ_ONLY,
        matcher.getAccessPrivilege(address1, hostname1));
    Assert.assertEquals(AccessPrivilege.NONE,
        matcher.getAccessPrivilege(address2, hostname1));
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.nfs.NfsExports

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.