public List<Node> makeProvisionedNodes(int n, Function<Integer, String> nodeNamer, Flavor flavor, Optional<TenantName> reservedTo, NodeType type, int ipAddressPoolSize, boolean dualStack, CloudAccount cloudAccount) {
        if (ipAddressPoolSize == 0 && type == NodeType.host) {
            ipAddressPoolSize = 1; // Tenant hosts must have at least one IP in their pool
        }
        List<Node> nodes = new ArrayList<>(n);

        for (int i = 0; i < n; i++) {
            nextHost++;
            nextIP++;

            // One test involves two provision testers - to detect this we check if the
            // name resolver already contains the next host - if this is the case - bump the indices and move on
            String testIp = String.format("127.0.%d.%d", nextIP / 256, nextIP % 256);
            MockNameResolver nameResolver = (MockNameResolver)nodeRepository().nameResolver();
            if (nameResolver.resolveHostname(testIp).isPresent()) {
                nextHost += 100;
                nextIP += 100;
            }

            String hostname = nodeNamer.apply(nextHost);
            String[] hostnameParts = hostname.split("\\.", 2);
            String ipv4 = String.format("127.0.%d.%d", nextIP / 256, nextIP % 256);
            String ipv6 = String.format("::%x", nextIP);

            nameResolver.addRecord(hostname, ipv4, ipv6);
            List<String> hostIps = new ArrayList<>();
            hostIps.add(ipv4);
            hostIps.add(ipv6);

            List<String> ipAddressPool = new ArrayList<>();
            List<HostName> nodeHostnames = new ArrayList<>();
            for (int poolIp = 1; poolIp <= ipAddressPoolSize; poolIp++) {
                nextIP++;
                String nodeHostname = hostnameParts[0] + "-" + poolIp + (hostnameParts.length > 1 ? "." + hostnameParts[1] : "");
                nodeHostnames.add(HostName.of(nodeHostname));
                String ipv6Addr = String.format("::%x", nextIP);
                ipAddressPool.add(ipv6Addr);
                nameResolver.addRecord(nodeHostname, ipv6Addr);
                if (dualStack) {
                    String ipv4Addr = String.format("127.0.%d.%d", (127 + (nextIP / 256)), nextIP % 256);
                    ipAddressPool.add(ipv4Addr);
                    nameResolver.addRecord(nodeHostname, ipv4Addr);
                }
            }
            Node.Builder builder = Node.create(hostname, IP.Config.of(hostIps, ipAddressPool, nodeHostnames), hostname, flavor, type)
                    .cloudAccount(cloudAccount);
            reservedTo.ifPresent(builder::reservedTo);
            nodes.add(builder.build());
        }
        nodes = nodeRepository.nodes().addNodes(nodes, Agent.system);
        return nodes;
    }
Call {@link this#activateTenantHosts()} after this before deploying applications
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java