# This is a legacy test; new tests shouldn't need to set a seed

load-example --seed test-basic
load-example --seed test-basic

show

sled-list
inventory-list
blueprint-list

sled-show 2eb69596-f081-4e2d-9425-9994926e0832
blueprint-show ade5749d-bdf3-4fab-a8ae-00bea01b3a5a

inventory-generate

wipe system
load-example --seed test-basic --nsleds 1 --ndisks-per-sled 4

sled-list
inventory-list
blueprint-list

sled-show 89d02b1b-478c-401a-8e28-7a26f74fa41b
blueprint-show ade5749d-bdf3-4fab-a8ae-00bea01b3a5a

# Exercise `blueprint-diff` arguments.
# We don't care about the actual content of these diffs here.
# The "from"/"to" that's printed at the top is enough to know that the command
# picked the right pair of blueprints.  So we also use a small system to keep
# the rest of the diff output small.

wipe all
load-example --seed test-basic --nsleds 1 --ndisks-per-sled 4

blueprint-list
blueprint-plan ade5749d-bdf3-4fab-a8ae-00bea01b3a5a
blueprint-list

# It's not okay to specify just one blueprint if it's the first one.
blueprint-diff 02697f74-b14a-4418-90f0-c28b2a3a6aa9
# It does work to specify just one blueprint if it's a later one.
blueprint-diff 86db3308-f817-4626-8838-4085949a6a41
# It also works to specify two blueprints.
blueprint-diff 02697f74-b14a-4418-90f0-c28b2a3a6aa9 86db3308-f817-4626-8838-4085949a6a41
# You can specify them in the reverse order and see the opposite changes.
blueprint-diff 86db3308-f817-4626-8838-4085949a6a41 02697f74-b14a-4418-90f0-c28b2a3a6aa9

# Load an example with a non-provisionable and an expunged sled.
wipe all
load-example --seed test-basic --nsleds 3 --sled-policy 1:non-provisionable --sled-policy 2:expunged --ndisks-per-sled 3

blueprint-list
blueprint-show latest
inventory-show latest all

# Plan a blueprint run -- this will cause zones and disks on the expunged
# sled to be expunged.
blueprint-plan latest
blueprint-diff ade5749d-bdf3-4fab-a8ae-00bea01b3a5a latest

# Sled index out of bounds, will error out.
wipe all
load-example --seed test-basic --nsleds 3 --sled-policy 3:non-provisionable

log
log --verbose

# Switch states with a full UUID.
switch 4a3b153b-fc8a-485a-baee-badaad53d2fc
log

# Switch states with a unique prefix.
switch 0a3
log

# Switch states with an ambiguous prefix (should fail).
switch 2

# Switch states with a non-existent prefix (should fail).
switch zzzz

# Make a new branch.
sled-add
sled-add

# Make an additional branch based on the previous branch.
switch 860f
sled-add

# Go back to the previous branch.
switch 4d8d6725

log
log --verbose
