bluetooth_after_suspend fails on systems without bluetooth

Bug #852014 reported by Daniel Manrique on 2011-09-16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Daniel Manrique
checkbox (Ubuntu)

Bug Description

Somewhat related to bug 836756.

If there's no bluetooth device present on the system, the bluetooth_detect_before_suspend test writes an empty file in $CHECKBOX_DATA/bluetooth_address.

The bluetooth_detect_after_suspend test tries to compare that file's contents with the output of this command:

hcitool dev | tail -n+2 | awk '{print $2}'

If there's no bluetooth adapter, the command also returns an empty string.

However if you try to grep an empty file (not even a carriage return, nothing) grep will return error. Thus, when comparing the empty string against a blank file, this command returns an error (exit code 1):

grep -q `hcitool dev | tail -n+2 | awk '{print $2}'` $CHECKBOX_DATA/bluetooth_address

To test the behavior:

echo -n "" >/tmp/test.txt
grep "" /tmp/test.txt
echo $?

Expected return code: 0
Actual return code: 1

So some more magic may be needed to get this to work correctly, perhaps using diff instead of grep (see the other *_before_suspend jobs).

Related branches

Daniel Manrique (roadmr) on 2011-09-20
Changed in checkbox:
importance: Undecided → High
status: New → In Progress
assignee: nobody → Daniel Manrique (roadmr)
milestone: none → 0.12.8
Ara Pulido (ara) on 2011-09-23
Changed in checkbox:
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package checkbox - 0.12.8

checkbox (0.12.8) oneiric; urgency=low

  New upstream release (LP: #862579):

  [Brendan Donegan]
  * Remove test for FTP connection from network_check script (LP: #854222)
  * Update a parameter in usb_test to have it run faster.
  * Remove record_playback_after_suspend from Ubuntu Friendly whitelist (LP: #855540)
  * Fix minor typo in multi-monitor friendly resolution_test script which caused
    minimum_resolution test to fail (LP: #855599)
  * Remove storage_devices_test from Ubuntu Friendly whitelist since bonnie++ (which it uses) is not installed by default (LP: #855841)
  * Changed description and name to reflect Ubuntu Friendly branding. Now when a user searches for Ubuntu Friendly in the lens, Checkbox will appear (LP: #852036)
  * Reset the selections at the test suite prompt if No is selected at the recover prompt (LP: #861208)
  * Save the connection name(s) instead of the interface name so that they can be reconnected to properly after the wireless before/after suspend tests have completed (LP: #861502)
  * Make connect_wireless use the UUID of the connection instead of the name for greater reliability (LP: #862190)

  [Daniel Manrique]
  * Restored _recover attribute, re-enabling welcome and test selection
    screens (LP: #852204)
  * Remove memory/test from the Ubuntu Friendly whitelist (LP: #853799)
  * Use diff instead of grep, better comparing of empty files (LP: #852014)
  * Apport integration: new mandatory "tag" value in ApportOptions (LP: #852201)
  * Add warning prior to starting the tests (LP: #855328)
  * Apport integration: Fix instantiation of Gtk.RadioButton, needed due
    to PyGI related API changes (LP: #805679)
  * Remove ping -R parameter that apparently caused ICMP packets to be dropped
    by some routers (LP: #861404)

  [ Evan Broder ]
  * Replace resolution_test with an implementation which uses GdkScreen to
    be multimonitor-aware (LP: #632987)

  [Jeff Lane]
  * Fix names of optical drive tests and remove a non-existing test from the
    whitelist (LP: #854808)
  * Fix wireless_*_suspend jobs so they recreate iface file instead of append
    each time (LP: #855845)
    (LP: #852201)
  * Clarify better the intend of the is_laptop question (LP: #861844)
  * Fixed dependencies for tests that depend on suspend/suspend_advanced
    (LP: #860651)

  [Tim Chen]
  * Fix cpu_scaling_test (LP: #811177)

  [Ara Pulido]
  * Avoid connect_wireless messing with AP with similar names (LP: #861538)
  * Remove bluetooth/file-transfer from the list of tests to run, since due to
    bug 834348 it always fails.

  [Marc Tardif]
  * Added support for wildcards when verifying the transport certificate.
  * Applying depends across suites (LP: #861218)
 -- Daniel Manrique <email address hidden> Thu, 29 Sep 2011 13:12:01 -0400

Changed in checkbox (Ubuntu):
status: New → Fix Released
Ara Pulido (ara) on 2011-09-30
Changed in checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers