File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -330,6 +330,8 @@ podman push quay.io/${QUAY_USERNAME}/greenboot-bootc:${TEST_UUID}
330330# # Bootc upgrade and check if greenboot can rollback
331331# #
332332# ##########################################################
333+ greenprint " Get /boot mount status"
334+ BOOT_MOUNT_STATUS=$( ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " ${EDGE_USER} @${GUEST_ADDRESS} " findmnt -r -o OPTIONS -n /boot | awk -F ',' '{print \$ 1}'" )
333335greenprint " Bootc upgrade and reboot"
334336sudo ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " ${EDGE_USER} @${GUEST_ADDRESS} " echo ${EDGE_USER_PASSWORD} |sudo -S bootc upgrade"
335337sudo ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " ${EDGE_USER} @${GUEST_ADDRESS} " echo ${EDGE_USER_PASSWORD} |nohup sudo -S systemctl reboot &>/dev/null & exit"
@@ -365,7 +367,7 @@ ansible_become_pass=${EDGE_USER_PASSWORD}
365367EOF
366368
367369# Test greenboot functionality
368- ansible-playbook -v -i /${TEMPDIR} /inventory greenboot-bootc.yaml || RESULTS=0
370+ ansible-playbook -v -i /${TEMPDIR} /inventory -e boot_mount_status= " ${BOOT_MOUNT_STATUS} " greenboot-bootc.yaml || RESULTS=0
369371
370372# Test result checking
371373check_result
Original file line number Diff line number Diff line change @@ -298,6 +298,8 @@ podman push quay.io/${QUAY_USERNAME}/greenboot-bootc:${TEST_UUID}
298298# # Bootc upgrade and check if greenboot can rollback
299299# #
300300# ##########################################################
301+ greenprint " Get /boot mount status"
302+ BOOT_MOUNT_STATUS=$( ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " ${EDGE_USER} @${GUEST_ADDRESS} " findmnt -r -o OPTIONS -n /boot | awk -F ',' '{print \$ 1}'" )
301303greenprint " Bootc upgrade and reboot"
302304sudo ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " ${EDGE_USER} @${GUEST_ADDRESS} " echo ${EDGE_USER_PASSWORD} |sudo -S bootc upgrade"
303305sudo ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " ${EDGE_USER} @${GUEST_ADDRESS} " echo ${EDGE_USER_PASSWORD} |nohup sudo -S systemctl reboot &>/dev/null & exit"
@@ -333,7 +335,7 @@ ansible_become_pass=${EDGE_USER_PASSWORD}
333335EOF
334336
335337# Test greenboot functionality
336- ansible-playbook -v -i ${TEMPDIR} /inventory greenboot-bootc.yaml || RESULTS=0
338+ ansible-playbook -v -i ${TEMPDIR} /inventory -e boot_mount_status= " ${BOOT_MOUNT_STATUS} " greenboot-bootc.yaml || RESULTS=0
337339
338340# Test result checking
339341check_result
Original file line number Diff line number Diff line change 22- hosts : greenboot_guest
33 become : no
44 vars :
5+ boot_mount_status : " "
56 total_counter : " 0"
67 failed_counter : " 0"
78
8-
99 tasks :
1010 # current target host's IP address
1111 - debug : var=ansible_all_ipv4_addresses
279279 set_fact :
280280 failed_counter : " {{ failed_counter | int + 1 }}"
281281
282+ - name : check /boot mount status after rollback
283+ shell : findmnt -r -o OPTIONS -n /boot | awk -F "," '{print $1}'
284+ register : result_boot_mount_after_rollback
285+
286+ - name : /boot status should be preserved
287+ block :
288+ - assert :
289+ that :
290+ - boot_mount_status == result_boot_mount_after_rollback.stdout
291+ fail_msg : " /boot status is not preserved"
292+ success_msg : " /boot status is preserved"
293+ always :
294+ - set_fact :
295+ total_counter : " {{ total_counter | int + 1 }}"
296+ rescue :
297+ - name : failed count + 1
298+ set_fact :
299+ failed_counter : " {{ failed_counter | int + 1 }}"
300+
282301 - assert :
283302 that :
284303 - failed_counter == "0"
Original file line number Diff line number Diff line change 110110 set_fact :
111111 failed_counter : " {{ failed_counter | int + 1 }}"
112112
113+ - name : check /boot mount status
114+ shell : findmnt -r -o OPTIONS -n /boot | awk -F "," '{print $1}'
115+ register : result_boot_mount_before
116+
113117 # case: check rollback function if boot error found
114118 - name : install sanely failing health check unit to test red boot status behavior
115119 block :
231235 set_fact :
232236 failed_counter : " {{ failed_counter | int + 1 }}"
233237
238+ - name : check /boot mount status
239+ shell : findmnt -r -o OPTIONS -n /boot | awk -F "," '{print $1}'
240+ register : result_boot_mount_after
241+
242+ - name : /boot status should be preserved
243+ block :
244+ - assert :
245+ that :
246+ - result_boot_mount_before.stdout == result_boot_mount_after.stdout
247+ fail_msg : " /boot status is not preserved"
248+ success_msg : " /boot status is preserved"
249+ always :
250+ - set_fact :
251+ total_counter : " {{ total_counter | int + 1 }}"
252+ rescue :
253+ - name : failed count + 1
254+ set_fact :
255+ failed_counter : " {{ failed_counter | int + 1 }}"
256+
234257 - assert :
235258 that :
236259 - failed_counter == "0"
You can’t perform that action at this time.
0 commit comments