def unlink(self, path): print "in unlink(%s)" % path parts = path.split("/") parent = string.join(parts[:-1], "/") child = parts[-1] pptr = vfs_dir.lookup(self.fs, self.root, parent) if pptr == None: return -errno.ENOENT return vfs_dir.unlink(self.fs, pptr, child)
while not vfs_dir.enum(fs, "enum", et.test_cb, et.last_seen): print "got partial result, last_seen = 0x%x" % et.last_seen if "." not in et.seen: print ". missing from result list" status = "FAILED" if ".." not in et.seen: print ". missing from result list" status = "FAILED" for i in range(1000): path = "file%d" % i if path not in et.seen: print "%s missing from result list" % path status = "FAILED" if len(et.seen) != 1002: print "wrong size %d for result list" % len(et.seen) status = "FAILED" if status != "OK": print "status = <<%s>>, skipping other tests" % status raise SystemExit # Test deletion. vfs_dir.unlink(fs, "enum", "file0") a_key = vfs_dir.lookup(fs, "enum", "file0") if a_key != None: print "got key %s for deleted file" % repr(a_key) status = "FAILED" print "status = %s" % status