# Load an example system.
load-example --nsleds 3 --ndisks-per-sled 1

sled-list

# Create a TUF repository from a fake manifest. (The output TUF repo is
# written to a temporary directory that this invocation of `reconfigurator-cli`
# is running out of as its working directory.)
generate-fake-repo 1.0.0

# Load the target release from the first TUF repository.
set target-release repo-1.0.0.zip

# On all three sleds, update the install dataset.
# The blueprints should start with the measurements in an 'unknown' state
sled-update-install-dataset serial0 --to-target-release
sled-update-install-dataset serial1 --to-target-release
sled-update-install-dataset serial2 --to-target-release

# Generate an inventory
inventory-generate
# Run a planning step. This should show the `noop` conversion skipping
# measurements and the planner modifying the measurements on all three
# sleds
blueprint-plan latest latest

# This diff should show all sleds with measurements as artifacts.
# This is matching what we expect to happen from R18 (no measurements)
# to R19 (measurements) with an online update. This is explicitly
# _not_ a MUPdate override case because we are expecting an online
# update from R18 -> R19
blueprint-diff latest

# The previous plan bumped each sled's sled-agent generation, but inventory
# hasn't been advanced via `sled-set ... omicron-config latest` yet. The next
# plan should therefore mark each sled's noop check as ineligible due to
# stale inventory, and the planning report should still show that we're
# waiting on measurements to converge.
inventory-generate
blueprint-plan latest latest
blueprint-diff latest

# Actually set the inventory to have the measurements we expect
sled-set serial0 omicron-config latest
sled-set serial1 omicron-config latest
sled-set serial2 omicron-config latest

# Inventory should show a pending MGS update
inventory-generate
blueprint-plan latest latest
blueprint-show latest


