@Ignore
    @Test
    public void test() throws Exception {
        ProvisioningTester tester = tester(SystemName.Public, CloudName.AWS, Environment.prod, CloudAccount.empty, parseFlavors(Path.of("/tmp/node-flavors.xml")));
        initFromZk(tester.nodeRepository(), Path.of("/tmp/snapshot"));

        ApplicationId app = ApplicationId.from("tenant", "app", "default");
        Version version = Version.fromString("8.123.4");

        Capacity[] capacities = new Capacity[]{
                Capacity.from(new ClusterResources(1, 1, NodeResources.unspecified())),
                Capacity.from(new ClusterResources(3, 1, NodeResources.unspecified())),
                Capacity.from(new ClusterResources(4, 1, new NodeResources(8, 16, 100, 0.3, fast, remote))),
                Capacity.from(new ClusterResources(2, 1, new NodeResources(4, 8, 100, 0.3, fast, local)))
        };
        ClusterSpec[] specs = new ClusterSpec[]{
                ClusterSpec.request(ClusterSpec.Type.admin, ClusterSpec.Id.from("logserver")).vespaVersion(version).build(),
                ClusterSpec.request(ClusterSpec.Type.admin, ClusterSpec.Id.from("cluster-controllers")).vespaVersion(version).build(),
                ClusterSpec.request(ClusterSpec.Type.container, ClusterSpec.Id.from("container")).vespaVersion(version).build(),
                ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("content")).vespaVersion(version).build()
        };

        deploy(tester, app, specs, capacities);
        tester.nodeRepository().nodes().list().owner(app).cluster(specs[1].id()).forEach(System.out::println);

        // Perform a node move
        tester.clock().advance(Duration.ofHours(1)); // Enough time for deployment to not be considered deployed recently
        List<MockDeployer.ClusterContext> contexts = new ArrayList<>();
        for (int i = 0; i < specs.length; i++) {
            contexts.add(new MockDeployer.ClusterContext(app, specs[i], capacities[i]));
        }
        MockDeployer deployer = new MockDeployer(tester.provisioner(), tester.clock(), List.of(new MockDeployer.ApplicationContext(app, contexts)));
        SwitchRebalancer rebalancer = new SwitchRebalancer(tester.nodeRepository(), Duration.ofDays(1), new MockMetric(), deployer);
        rebalancer.run();
    }
Scenario tester with real node-repository data loaded from ZK snapshot file

How to use:

1. Copy /opt/vespa/conf/configserver-app/node-flavors.xml from config server to /tmp/node-flavors.xml
2. Copy /opt/vespa/var/zookeeper/version-2/snapshot.XXX from config server to /tmp/snapshot
3. Set capacities and specs according to the wanted scenario

@author valerijf
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/RealDataScenarioTest.java