@Test
  public void testNotEnoughZones() throws Exception {
    Host host = Host.getHost(0);
    VM vm0 = host.getVM(0);
    VM vm1 = host.getVM(1);
    VM vm2 = host.getVM(2);

    setRedundancyZone(vm0, "A");
    setRedundancyZone(vm1, "A");
    setRedundancyZone(vm2, "B");

    createPR(vm0, 2);
    createPR(vm1, 2);
    createPR(vm2, 2);
    createData(vm0, 0, 6, "A");

    int vm0Count = getBucketCount(vm0);
    int vm1Count = getBucketCount(vm1);
    int vm2Count = getBucketCount(vm2);

    String counts = "vm0=" + vm0Count + ",vm1=" + vm1Count + ",vm2=" + vm2Count;
    // assert zone A has only 1 copy of each bucket and zone B has
    // only one copy of each bucket.
    assertEquals(counts, 6, vm0Count + vm1Count);
    assertEquals(counts, 6, vm2Count);

    // Ideally, vm0 and vm1 would each have three buckets. However, due
    // to the way we place buckets, they may be off by one. The problem is that
    // we try to balance primaries first, rather than bucket counts, during bucket placement
    // When trying place the last primary bucket, we may have already placed 2 redundant
    // buckets on vm0 or vm1. At that point we will add another bucket to that
    // member to bring it's primary count up to two.
    assertTrue(counts, vm0Count >= 2 && vm1Count >= 2);
  }
Test that we don't try to put buckets in the same zone when we don't have enough zones.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java