Comment 0 for bug 1004131

Daniel Manrique (roadmr) wrote :

Ubuntu Server 12.04, these are the relevant versions of packages:

ii checkbox 0.13.8~ppa5.12.04 System testing application
ii checkbox-certification 0.13.1~ppa30.12.04 Checkbox Certification Tests
ii checkbox-certification-server 0.13.1~ppa30.12.04 Server Certification
ii checkbox-certification-tools 0.13.1~ppa30.12.04 Checkbox Certification Tools
ii checkbox-cli 0.13.8~ppa5.12.04 Command line interface for checkbox

Steps to reproduce:

- Do a server installation, then reboot with the USB stick plugged in.
- Install checkbox-certification-server
- Emulate the usb/storage-preinserted test by running this manually:

/usr/share/checkbox/scripts/removable_storage_test -l usb && /usr/share/checkbox/scripts/removable_storage_test usb

Expected result:
- Success exit code and something like this in the log (this was obtained on a DESKTOP system):
Found the following mounted ['usb'] partitions:
/dev/sdb1 : /media/MUSHKIN
--------------------
Running ['usb'] file transfer test for 1 iterations
Creating Temp Data file
File name is :/tmp/tmpkCn07B
File size is 1048576 bytes
Parent hash is: 2ebe1e55057a5b0aadecbebfcb14077d
Copying /tmp/tmpkCn07B to /media/MUSHKIN
Hashing copy on /media/MUSHKIN
Hash of /media/MUSHKIN/tmpkCn07B on /media/MUSHKIN is 2ebe1e55057a5b0aadecbebfcb14077d
Successfully completed 1 ['usb'] file transfer test iterations

Actual result:
- Error exit code
mount: only root can do that
Error: can't mount /dev/sdb1
There're total 1 device(s) failed at mounting.
No device being mounted successfully for testing, aborting

This happens even if the system is booted without the USB stick and that gets plugged in when it boots.

This suggests that there's something in a desktop installation that makes the inserted USB stick mountable by regular users, and that "something" is not present on the server install.

Thinking it may be user groups, here are the groups for the ubuntu user on the server install:

uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),109(sambashare)

To contrast, here are the groups for a normal user on a desktop install:
uid=1000(roadmr) gid=1000(roadmr) groups=1000(roadmr),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare)

The group numbers are slightly different but they are pretty much the same.

One way to solve this is to make the job have user: root, so that the mount command runs as root, but I'd prefer to find a way to make this work without requiring more root jobs.