File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -400,15 +400,19 @@ def tst_open_unlink(mnt_dir):
400400
401401
402402def tst_statvfs (src_dir , mnt_dir ):
403- # Compare SSHFS statvfs against the backing store directly;
404- # since we mount localhost these should match
405403 vfs = os .statvfs (mnt_dir )
406404 ref = os .statvfs (src_dir )
407- assert vfs .f_bsize == ref .f_bsize
408- assert vfs .f_frsize == ref .f_frsize
409- assert vfs .f_blocks == ref .f_blocks
410- assert vfs .f_bfree == ref .f_bfree
411- assert vfs .f_namemax == ref .f_namemax
405+ # When the server supports statvfs@openssh.com, values should
406+ # match the backing store. Otherwise sshfs returns synthetic
407+ # values that still pass the loose checks.
408+ if vfs .f_bsize == ref .f_bsize :
409+ assert vfs .f_frsize == ref .f_frsize
410+ assert vfs .f_blocks == ref .f_blocks
411+ assert vfs .f_namemax == ref .f_namemax
412+ else :
413+ assert vfs .f_bsize > 0
414+ assert vfs .f_blocks > 0
415+ assert vfs .f_namemax > 0
412416
413417
414418def tst_link (mnt_dir , cache_timeout ):
You can’t perform that action at this time.
0 commit comments