Thanks for sharing the problem,   IMHO it should not have any problem with path length.  Hmmm, this actually sounds like it could be a bug, but we must investigate further.

Are you running as root or as user?

Is selinux disabled or in permissive mode?

My suggestion would be to stick <code>import pdb; pdb.set_trace()</code> in your test just before the virsh command.  Then you can examine test.tmpdir value and check out filesystem.  Some part of that path looks weird: <code>.../client/tmp/tmp/tmpVGHhjC_virt...</code>.  Is this path correct?

If everything looks good, then we can look at this as a libvirt bug.  Also, yes it's okay to use <code>test.virtdir</code> and cleanup yourself.  Just make a <code>TODO</code> comment in test to change to <code>test.tmpdir</code> later.  Then there will be no question why you are using <code>test.virtdir</code>.