snapshots/testsuite: Rename: fix fuse-overlayfs incompatibility

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2023-05-11 16:58:17 +09:00
parent f84b2b47b0
commit 5dbae38191
No known key found for this signature in database
GPG Key ID: 49524C6F9F638F1A

View File

@ -128,10 +128,16 @@ func checkRename(ss string) func(ctx context.Context, t *testing.T, sn snapshots
) )
var applier []fstest.Applier var applier []fstest.Applier
if ss != "overlayfs" { switch ss {
// With neither OVERLAY_FS_REDIRECT_DIR nor redirect_dir, // With neither OVERLAY_FS_REDIRECT_DIR nor redirect_dir,
// renaming the directory on the lower directory doesn't work on overlayfs. // renaming the directory on the lower directory doesn't work on overlayfs.
// https://github.com/torvalds/linux/blob/v5.18/Documentation/filesystems/overlayfs.rst#renaming-directories // https://github.com/torvalds/linux/blob/v5.18/Documentation/filesystems/overlayfs.rst#renaming-directories
//
// It doesn't work on fuse-overlayfs either.
// https://github.com/containerd/fuse-overlayfs-snapshotter/pull/53#issuecomment-1543442048
case "overlayfs", "fuse-overlayfs":
// NOP
default:
applier = append(applier, fstest.Rename("/dir1", "/dir2")) applier = append(applier, fstest.Rename("/dir1", "/dir2"))
} }
applier = append( applier = append(