summaryrefslogtreecommitdiffstats
path: root/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/NoZooKeeperTest.java
blob: 2191819858c2f2e554e353bd4a9b15c9e8439ea9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.core;

import org.junit.Test;
import static org.junit.Assert.assertEquals;

public class NoZooKeeperTest extends FleetControllerTest {

    @Test
    public void testWantedStatesInZooKeeper() throws Exception {
        startingTest("NoZooKeeperTest::testWantedStatesInZooKeeper");
        FleetControllerOptions options = new FleetControllerOptions("mycluster");
        options.zooKeeperServerAddress = null;
        setUpFleetController(true, options);
        setUpVdsNodes(true, new DummyVdsNodeOptions());
        waitForStableSystem();

        assertEquals(true, nodes.get(0).isDistributor());
        nodes.get(0).disconnect();
        waitForState("version:\\d+ distributor:10 .0.s:d storage:10");

        nodes.get(0).connect();
        waitForState("version:\\d+ distributor:10 storage:10");
    }
}