livecd-tools/test-fix.patch

79 lines
3.3 KiB
Diff

diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index f999d05..5c5a003 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -820,8 +820,18 @@ class DiskMount(Mount):
def unmount(self):
if self.mounted:
logging.info("Unmounting directory %s" % self.mountdir)
+ time.sleep(10)
rc = call(['umount', self.mountdir])
if rc != 0:
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ call(['lsof', '+c0', self.mountdir])
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ logging.info("- - - fuser %s - - -" % self.mountdir)
+ call(['fuser', '-v', '-m', self.mountdir])
+ logging.info("- - - fuser %s - - -" % self.mountdir)
+ logging.info("- - - pstree - - -")
+ call(['pstree', '-Talp'])
+ logging.info("- - - pstree - - -")
call(['umount', '-l', self.mountdir])
raise MountError(umount_fail_fmt % self.mountdir)
self.mounted = False
@@ -981,8 +991,18 @@ class OverlayFSMount(Mount):
if not self.mounted:
return
+ time.sleep(10)
rc = call(['umount', self.mountdir])
if rc != 0:
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ call(['lsof', '+c0', self.mountdir])
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ logging.info("- - - fuser %s - - -" % self.mountdir)
+ call(['fuser', '-v', '-m', self.mountdir])
+ logging.info("- - - fuser %s - - -" % self.mountdir)
+ logging.info("- - - pstree - - -")
+ call(['pstree', '-Talp'])
+ logging.info("- - - pstree - - -")
call(['umount', '-l', self.mountdir])
raise MountError(umount_fail_fmt % self.mountdir)
if self.cowmnt:
@@ -1059,10 +1079,21 @@ class BindChrootMount():
self.mounted = False
return
+ time.sleep(10)
rc = call(['umount', self.dest])
if rc != 0:
+ logging.info("- - - lsof %s - - -" % self.dest)
+ call(['lsof', '+c0', self.dest])
+ logging.info("- - - lsof %s - - -" % self.dest)
+ logging.info("- - - fuser %s - - -" % self.dest)
+ call(['fuser', '-v', '-m', self.dest])
+ logging.info("- - - fuser %s - - -" % self.dest)
+ logging.info("- - - pstree - - -")
+ call(['pstree', '-Talp'])
+ logging.info("- - - pstree - - -")
call(['umount', '-l', self.dest])
- raise MountError(umount_fail_fmt % self.dest)
+ if self.src.strip() not in ('/sys', '/proc', '/dev/pts'):
+ raise MountError(umount_fail_fmt % self.dest)
self.mounted = False
def cleanup(self):
diff --git a/imgcreate/util.py b/imgcreate/util.py
index fad6772..04380c9 100644
--- a/imgcreate/util.py
+++ b/imgcreate/util.py
@@ -32,7 +32,7 @@ def call(*popenargs, **kwargs):
stderr=subprocess.STDOUT, **kwargs)
rc = p.wait()
fp = io.open(p.stdout.fileno(), mode="r", encoding="utf-8", closefd=False)
- stdout = fp.read().split()
+ stdout = fp.read().splitlines()
fp.close()
# Log output using logging module