"20-maas-03-machine-resources" commissioning script improperly reports a Pass when the test fails

Bug #1990172 reported by Adam Vest
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Björn Tillenius
3.3
Fix Released
High
Björn Tillenius

Bug Description

Hello,

As the summary states, the "20-maas-03-machine-resources" commissioning script does not appear to do any sort of return code checking, and simply always exits with a status of 0 (success), causing the MAAS interface to report that the test passed. The script assumes that the "$MAAS_BASE_URL/MAAS/machine-resources/$arch" file that it downloads and executes will always run successfully, which is not entirely the case. On my setup, this script is failing to run with the error:
---
root@star-ox:~# /tmp/user_data.sh.6xZwIu/scripts/commissioning/20-maas-03-machine-resources
--2022-09-19 15:50:50-- http://192.168.1.1:5248/MAAS/machine-resources/amd64
Connecting to 192.168.1.1:5248... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6885376 (6.6M) [application/octet-stream]
Saving to: ‘/tmp/tmp.orVF15wxE2’

/tmp/tmp.orVF15wxE2 100%[========================================>] 6.57M --.-KB/s in 0.1s

2022-09-19 15:50:50 (45.1 MB/s) - ‘/tmp/tmp.orVF15wxE2’ saved [6885376/6885376]

ERROR: Failed to retrieve network information: Failed to add device information for "/sys/class/net/enp0s10f0/device": Failed to add port info: Failed to ETHTOOL_GLINK: operation not supported
---
It took me a while to get to this point since the interface was showing me a green checkmark, indicating that the test was successful.

I would recommend adding some return code checking to the "20-maas-03-machine-resources" script so that it will properly report in the interface whether the test actually passed or not.

Thank you!

Related branches

Revision history for this message
Christian Grabowski (cgrabowski) wrote :

Able to confirm, encountered this while testing LP:1989974 as well.

Changed in maas:
status: New → Triaged
importance: Undecided → High
Changed in maas:
milestone: none → 3.4.0
status: Triaged → In Progress
assignee: nobody → Björn Tillenius (bjornt)
Changed in maas:
status: In Progress → Fix Committed
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.0-beta1
Alberto Donato (ack)
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.