Skip to content

Commit d38f64b

Browse files
authored
[reconfigurator-cli] Populate simulated caboose and test RoT update (#8835)
Related: #8798
1 parent 0fac181 commit d38f64b

File tree

6 files changed

+1719
-139
lines changed

6 files changed

+1719
-139
lines changed

dev-tools/reconfigurator-cli/tests/input/cmds-target-release.txt

Lines changed: 81 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,46 +31,108 @@ sled-list
3131
blueprint-list
3232
inventory-list
3333

34-
# First step: upgrade one SP.
35-
blueprint-plan dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21 f45ba181-4b56-42cc-a762-874d90184a43
36-
blueprint-diff dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1
34+
# First step: upgrade one RoT bootloader.
35+
blueprint-plan latest latest
36+
blueprint-diff latest
3737

3838
# If we generate another plan, there should be no change.
39-
blueprint-plan 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1 f45ba181-4b56-42cc-a762-874d90184a43
40-
blueprint-diff 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1 58d5e830-0884-47d8-a7cd-b2b3751adeb4
39+
blueprint-plan latest latest
40+
blueprint-diff latest
4141

42-
# Now, update the simulated SP to reflect that the update completed.
42+
# Now, update the simulated RoT bootloader to reflect that the update completed.
4343
# Collect inventory from it and use that collection for another planning step.
4444
# This should report that the update completed, remove that update, and add one
45+
# for an SP on the same sled.
46+
sled-update-rot-bootloader 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6 --stage0 1.0.0
47+
inventory-generate
48+
blueprint-plan latest latest
49+
blueprint-diff latest
50+
51+
# After the RoT bootloader update has completed, we update the simulated RoT to
52+
# reflect that update has completed as well.
53+
# Like before, collect inventory from it and use that collection for the next
54+
# step.
55+
# This should report that the update completed, remove that update, and add one
4556
# for another sled.
57+
sled-update-rot 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6 --slot-a 1.0.0
58+
inventory-generate
59+
blueprint-plan latest latest
60+
blueprint-diff latest
61+
62+
# We repeat the same procedure with the SP
4663
sled-update-sp 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6 --active 1.0.0
4764
inventory-generate
48-
blueprint-plan 58d5e830-0884-47d8-a7cd-b2b3751adeb4 eb0796d5-ab8a-4f7b-a884-b4aeacb8ab51
49-
blueprint-diff 58d5e830-0884-47d8-a7cd-b2b3751adeb4 af934083-59b5-4bf6-8966-6fb5292c29e1
65+
blueprint-plan latest latest
66+
blueprint-diff latest
5067

5168
# This time, make it more interesting. Change the inactive slot contents of
52-
# the simulated SP. This should make the configured update impossible and cause
53-
# the planner to fix it. To test this, we also need to tell the planner not to
54-
# ignore this update even though it's quite new.
69+
# the simulated RoT bootloader. This should make the configured update
70+
# impossible and cause the planner to fix it. To test this, we also need to tell
71+
# the planner not to ignore this update even though it's quite new.
5572
set ignore-impossible-mgs-updates-since now
56-
sled-update-sp 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c --inactive 0.5.0
73+
sled-update-rot-bootloader 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c --stage0-next 0.5.0
74+
inventory-generate
75+
blueprint-plan latest latest
76+
blueprint-diff latest
77+
78+
# Now simulate the update completing successfully.
79+
# Like before, we should see a pending RoT update for this sled.
80+
sled-update-rot-bootloader 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c --stage0 1.0.0
81+
inventory-generate
82+
blueprint-plan latest latest
83+
blueprint-diff latest
84+
85+
# Now we'll change the inactive slot contents of the simulated RoT. Like with
86+
# the RoT bootloader, this should make the update impossible and cause the
87+
# planner to fix it.
88+
set ignore-impossible-mgs-updates-since now
89+
sled-update-rot 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c --slot-b 0.5.0
5790
inventory-generate
58-
blueprint-plan af934083-59b5-4bf6-8966-6fb5292c29e1 61f451b3-2121-4ed6-91c7-a550054f6c21
59-
blueprint-diff af934083-59b5-4bf6-8966-6fb5292c29e1 df06bb57-ad42-4431-9206-abff322896c7
91+
blueprint-plan latest latest
92+
blueprint-diff latest
6093

6194
# Now simulate the update completing successfully.
62-
# Another planning step should try to update the last sled.
95+
# Like before, we should see a pending SP update for this sled.
96+
sled-update-rot 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c --slot-a 1.0.0
97+
inventory-generate
98+
blueprint-plan latest latest
99+
blueprint-diff latest
100+
101+
# We repeat the same procedure with the SP. Like with the RoT, this should make
102+
# the update impossible and cause the planner to fix it.
103+
set ignore-impossible-mgs-updates-since now
104+
sled-update-sp 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c --inactive 0.5.0
105+
inventory-generate
106+
blueprint-plan latest latest
107+
blueprint-diff latest
108+
109+
# Let's simulate the successful SP update as well.
110+
# A few more planning steps should try to update the last sled.
63111
sled-update-sp 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c --active 1.0.0
64112
inventory-generate
65-
blueprint-plan df06bb57-ad42-4431-9206-abff322896c7 b1bda47d-2c19-4fba-96e3-d9df28db7436
66-
blueprint-diff df06bb57-ad42-4431-9206-abff322896c7 7f976e0d-d2a5-4eeb-9e82-c82bc2824aba
113+
blueprint-plan latest latest
114+
blueprint-diff latest
115+
116+
# Update the RoT bootloader on the last sled.
117+
# There should be a pending RoT update.
118+
sled-update-rot-bootloader d81c6a84-79b8-4958-ae41-ea46c9b19763 --stage0 1.0.0
119+
inventory-generate
120+
blueprint-plan latest latest
121+
blueprint-diff latest
122+
123+
# Update the RoT on the last sled.
124+
# There should be one last pending SP update.
125+
sled-update-rot d81c6a84-79b8-4958-ae41-ea46c9b19763 --slot-a 1.0.0
126+
inventory-generate
127+
blueprint-plan latest latest
128+
blueprint-diff latest
67129

68130
# Finish updating the last sled and do one more planning run.
69131
# This should update one control plane zone.
70132
sled-update-sp d81c6a84-79b8-4958-ae41-ea46c9b19763 --active 1.0.0
71133
inventory-generate
72-
blueprint-plan 7f976e0d-d2a5-4eeb-9e82-c82bc2824aba a71f7a73-35a6-45e8-acbe-f1c5925eed69
73-
blueprint-diff 7f976e0d-d2a5-4eeb-9e82-c82bc2824aba 9034c710-3e57-45f3-99e5-4316145e87ac
134+
blueprint-plan latest latest
135+
blueprint-diff latest
74136

75137
# We should continue walking through the update. We need to build out a
76138
# reconfigurator-cli subcommand to simulate updated zone image sources (just

dev-tools/reconfigurator-cli/tests/output/cmds-example-stdout

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,10 +1058,10 @@ Sled serial0
10581058
A 0101010101010101010101010101010101010101010101010101010101010101
10591059
B 0202020202020202020202020202020202020202020202020202020202020202
10601060
cabooses:
1061-
SLOT BOARD NAME VERSION GIT_COMMIT SIGN
1062-
SpSlot0 SimGimletSp SimGimletSp 0.0.1 unknown n/a
1063-
RotSlotA SimRot SimRot 0.0.2 unknown n/a
1064-
Stage0 SimRotStage0 SimRotStage0 0.0.1 unknown n/a
1061+
SLOT BOARD NAME VERSION GIT_COMMIT SIGN
1062+
SpSlot0 SimGimletSp SimGimletSp 0.0.1 unknown n/a
1063+
RotSlotA SimRot SimRot 0.0.2 unknown SimRot
1064+
Stage0 SimRotStage0 SimRotStage0 0.0.1 unknown SimRotStage0
10651065
RoT pages:
10661066
SLOT DATA_BASE64
10671067
RoT: active slot: slot A
@@ -1083,10 +1083,10 @@ Sled serial1
10831083
A 0101010101010101010101010101010101010101010101010101010101010101
10841084
B 0202020202020202020202020202020202020202020202020202020202020202
10851085
cabooses:
1086-
SLOT BOARD NAME VERSION GIT_COMMIT SIGN
1087-
SpSlot0 SimGimletSp SimGimletSp 0.0.1 unknown n/a
1088-
RotSlotA SimRot SimRot 0.0.2 unknown n/a
1089-
Stage0 SimRotStage0 SimRotStage0 0.0.1 unknown n/a
1086+
SLOT BOARD NAME VERSION GIT_COMMIT SIGN
1087+
SpSlot0 SimGimletSp SimGimletSp 0.0.1 unknown n/a
1088+
RotSlotA SimRot SimRot 0.0.2 unknown SimRot
1089+
Stage0 SimRotStage0 SimRotStage0 0.0.1 unknown SimRotStage0
10901090
RoT pages:
10911091
SLOT DATA_BASE64
10921092
RoT: active slot: slot A
@@ -1108,10 +1108,10 @@ Sled serial2
11081108
A 0101010101010101010101010101010101010101010101010101010101010101
11091109
B 0202020202020202020202020202020202020202020202020202020202020202
11101110
cabooses:
1111-
SLOT BOARD NAME VERSION GIT_COMMIT SIGN
1112-
SpSlot0 SimGimletSp SimGimletSp 0.0.1 unknown n/a
1113-
RotSlotA SimRot SimRot 0.0.2 unknown n/a
1114-
Stage0 SimRotStage0 SimRotStage0 0.0.1 unknown n/a
1111+
SLOT BOARD NAME VERSION GIT_COMMIT SIGN
1112+
SpSlot0 SimGimletSp SimGimletSp 0.0.1 unknown n/a
1113+
RotSlotA SimRot SimRot 0.0.2 unknown SimRot
1114+
Stage0 SimRotStage0 SimRotStage0 0.0.1 unknown SimRotStage0
11151115
RoT pages:
11161116
SLOT DATA_BASE64
11171117
RoT: active slot: slot A

dev-tools/reconfigurator-cli/tests/output/cmds-mupdate-update-flow-stdout

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,16 +2182,16 @@ generated inventory collection 0b5efbb3-0b1b-4bbf-b7d8-a2d6fca074c6 from configu
21822182
INFO performed noop image source checks on sled, sled_id: 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c, num_total: 7, num_already_artifact: 0, num_eligible: 0, num_ineligible: 7
21832183
INFO performed noop image source checks on sled, sled_id: 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6, num_total: 6, num_already_artifact: 6, num_eligible: 0, num_ineligible: 0
21842184
INFO performed noop image source checks on sled, sled_id: d81c6a84-79b8-4958-ae41-ea46c9b19763, num_total: 6, num_already_artifact: 6, num_eligible: 0, num_ineligible: 0
2185-
WARN cannot configure RoT bootloader update for board (missing sign in stage0 caboose from inventory), serial_number: serial0, part_number: model0
2186-
WARN cannot configure RoT update for board (missing sign in caboose from inventory), serial_number: serial0, part_number: model0
2185+
WARN cannot configure RoT bootloader update for board (no matching artifact), serial_number: serial0, part_number: model0
2186+
WARN cannot configure RoT update for board (no matching artifact), serial_number: serial0, part_number: model0
21872187
WARN cannot configure SP update for board (no matching artifact), serial_number: serial0, part_number: model0
21882188
INFO skipping board for MGS-driven update, serial_number: serial0, part_number: model0
2189-
WARN cannot configure RoT bootloader update for board (missing sign in stage0 caboose from inventory), serial_number: serial1, part_number: model1
2190-
WARN cannot configure RoT update for board (missing sign in caboose from inventory), serial_number: serial1, part_number: model1
2189+
WARN cannot configure RoT bootloader update for board (no matching artifact), serial_number: serial1, part_number: model1
2190+
WARN cannot configure RoT update for board (no matching artifact), serial_number: serial1, part_number: model1
21912191
WARN cannot configure SP update for board (no matching artifact), serial_number: serial1, part_number: model1
21922192
INFO skipping board for MGS-driven update, serial_number: serial1, part_number: model1
2193-
WARN cannot configure RoT bootloader update for board (missing sign in stage0 caboose from inventory), serial_number: serial2, part_number: model2
2194-
WARN cannot configure RoT update for board (missing sign in caboose from inventory), serial_number: serial2, part_number: model2
2193+
WARN cannot configure RoT bootloader update for board (no matching artifact), serial_number: serial2, part_number: model2
2194+
WARN cannot configure RoT update for board (no matching artifact), serial_number: serial2, part_number: model2
21952195
WARN cannot configure SP update for board (no matching artifact), serial_number: serial2, part_number: model2
21962196
INFO skipping board for MGS-driven update, serial_number: serial2, part_number: model2
21972197
INFO ran out of boards for MGS-driven update

0 commit comments

Comments
 (0)