[vdsm] Test failure not free loop devices

David Caro Estevez dcaroest at redhat.com
Fri Aug 9 13:45:02 UTC 2013


Sometimes we get this error when running the vdsm tests:

======================================================================
ERROR: testLoopMount (mountTests.MountTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/ephemeral0/vdsm_unit_tests_gerrit_el/tests/mountTests.py", line 69, in testLoopMount
    m.mount(mntOpts="loop")
  File "/ephemeral0/vdsm_unit_tests_gerrit_el/vdsm/storage/mount.py", line 222, in mount
    return self._runcmd(cmd, timeout)
  File "/ephemeral0/vdsm_unit_tests_gerrit_el/vdsm/storage/mount.py", line 238, in _runcmd
    raise MountError(rc, ";".join((out, err)))
MountError: (2, ';mount: could not find any free loop device\n')
-------------------- >> begin captured logging << --------------------
Storage.Misc.excCmd: DEBUG: '/sbin/mkfs.ext2 -F /tmp/tmpq95svr' (cwd None)
Storage.Misc.excCmd: DEBUG: SUCCESS: <err> = 'mke2fs 1.41.12 (17-May-2010)\n'; <rc> = 0
Storage.Misc.excCmd: DEBUG: '/usr/bin/sudo -n /bin/mount -o loop /tmp/tmpq95svr /tmp/tmpcS29EU' (cwd None)

The problem is that it seems that the loop devices that are not being released (maybe when the test fails?) and the system runs out of devices eventually.
Can you take a look to see where the cleanup fails and fix it?

Thanks!

pd. To free a loop device you have to umount it and then losetup -d <loopdevice>, that way the device gets liberated. Also it might be a good solution to create a specific device per test, that way it will never run out of them no matter how many tests run in parallel, but that requires a little more modifications.

----
David Caro

Red Hat Czech s.r.o.
Continuous Integration Engineer - EMEA ENG Virtualization R&D

Tel.: +420 532 294 605
Email: dcaro at redhat.com
Web: www.cz.redhat.com
Red Hat Czech s.r.o., Purkyňova 99/71, 612 45, Brno, Czech Republic
RHT Global #: 82-62605




More information about the vdsm-devel mailing list