@Test
    public void testBootstrapBetweenVersions() throws Exception {
        ConfigserverConfig configserverConfig = createConfigserverConfigNonHosted(temporaryFolder);
        String oldVespaVersion = "8.100.1";
        Curator curator = new MockCurator();
        DeployTester tester = new DeployTester.Builder(temporaryFolder)
                .modelFactory(DeployTester.createModelFactory(Version.fromString(oldVespaVersion)))
                .configserverConfig(configserverConfig)
                .curator(curator)
                .build();
        RpcServer rpcServer = createRpcServer(configserverConfig);

        assertUpgradeWorks("7,.594.36", "8.110.1", tester, rpcServer);
        assertUpgradeWorks("8.100.1", "8.110.1", tester, rpcServer);

        assertUpgradeFails("8.100.1", "8.131.1", tester, rpcServer,
                           "Cannot upgrade from 8.100.1 to 8.131.1. Please upgrade to an older version first, " +
                                   "the interval between the two versions is too large (> 30 releases)." +
                                   " Setting VESPA_SKIP_UPGRADE_CHECK=true will skip this check at your own risk," +
                                   " see https://vespa.ai/releases.html#versions");
        assertUpgradeFails("7.99.1", "8.100.1", tester, rpcServer,
                           "Cannot upgrade from 7.99.1 to 8.100.1 (new major version). Please upgrade to 7.594.36 first." +
                                   " Setting VESPA_SKIP_UPGRADE_CHECK=true will skip this check at your own risk," +
                                   " see https://vespa.ai/releases.html#versions");
        assertUpgradeFails("7.594.36", "8.121.1", tester, rpcServer,
                           "Cannot upgrade from 7.594.36 to 8.121.1. Please upgrade to an older version first," +
                                   " the interval between the two versions is too large (> 30 releases)." +
                                   " Setting VESPA_SKIP_UPGRADE_CHECK=true will skip this check at your own risk," +
                                   " see https://vespa.ai/releases.html#versions");
        assertUpgradeFails("6.11.11", "8.121.1", tester, rpcServer,
                           "Cannot upgrade from 6.11.11 to 8.121.1 (upgrade across 2 major versions not supported)." +
                                   " Please upgrade to 7.594.36 first." +
                                   " Setting VESPA_SKIP_UPGRADE_CHECK=true will skip this check at your own risk," +
                                   " see https://vespa.ai/releases.html#versions");

        Version versionToUpgradeTo = Version.fromString("8.131.1");
        boolean skipUpgradeCheck = true;
        VersionState versionState = createVersionState(tester.curator(), versionToUpgradeTo, skipUpgradeCheck);
        assertUpgradeWorks("7.594.36", tester, rpcServer, versionState);
        assertUpgradeWorks("8.100.1", tester, rpcServer, versionState);
    }
@author Ulf Lilleengen
@author Harald Musum
configserver/src/test/java/com/yahoo/vespa/config/server/ConfigServerBootstrapTest.java