private void simulateOsUpgrade(NodeRepository nodeRepository) {
        var wantedOsVersion = nodeRepository.osVersions().targetFor(NodeType.host);
        if (wantedOsVersion.isEmpty()) return;
        for (Node node : nodeRepository.nodes().list(Node.State.ready, Node.State.active)) {
            if (wantedOsVersion.get().isAfter(node.status().osVersion().current().orElse(Version.emptyVersion)))
                nodeRepository.nodes().write(node.withCurrentOsVersion(wantedOsVersion.get(), nodeRepository.clock().instant()),
                                             () -> {});
        }
    }
Simulate completion of an OS upgrade
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRebooterTest.java