power-management/bluetooth_detect_after_suspend hangs if bluetooth device is not present
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Checkbox |
Fix Released
|
High
|
Daniel Manrique |
Bug Description
This shouldn't happen on a system where bluetooth was not detected but it does!
The command run for this test is:
grep -q `hcitool dev | tail -n+2 | awk '{print $2}'` $CHECKBOX_
This compares the bluetooth address from hcitool dev with that obtained in the pre-suspend run.
However if there's no bluetooth device present, the command enclosed in backticks returns nothing, and the command run is:
grep -q /home/user/
This searches stdin for the string /home/user/
I realized this happens when I disabled my laptop's bluetooth module and then tried to do a test run.
So steps to reproduce would be:
1- Take either a laptop without bluetooth or one with bluetooth disabled. Make sure bluez is installed, as it's also checked for as a dependency.
2- Start checkbox and do a run that includes the bluetooth_
Expected result:
- the test either passes or fails and the run continues.
Actual result:
- Checkbox hangs waiting for the command to complete, requiring manually killing the "stuck" grep process.
An easy solution is to quote that part of the command so as to ensure it will at least be an "empty string" giving a valid grep command that doesn't crash.
grep -q "`hcitool dev | tail -n+2 | awk '{print $2}'`" $CHECKBOX_
Changed in checkbox: | |
status: | New → Fix Committed |
importance: | Undecided → High |
assignee: | nobody → Daniel Manrique (roadmr) |
Changed in checkbox: | |
status: | Fix Committed → Fix Released |