Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

657 B
Raw Blame
package mount

import (
	"testing"

	"github.com/seaweedfs/seaweedfs/weed/filer"
	"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)

func TestIsFilerConfUpdateEventMatchesRenameTarget(t *testing.T) {
	event := &filer_pb.SubscribeMetadataResponse{
		Directory: "/tmp",
		EventNotification: &filer_pb.EventNotification{
			OldEntry:      &filer_pb.Entry{Name: filer.FilerConfName},
			NewEntry:      &filer_pb.Entry{Name: filer.FilerConfName},
			NewParentPath: filer.DirectoryEtcSeaweedFS,
		},
	}

	if !isFilerConfUpdateEvent(event, filer.DirectoryEtcSeaweedFS, filer.FilerConfName) {
		t.Fatalf("expected rename target to match filer.conf watcher")
	}
}