chore: import CephMig prototype
Initial import of the existing CephFS subvolume migration prototype, including the native libcephfs transport, rsync backend, local Ceph lab environment and integration tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
7705ed3eaf
58 files changed
+8769
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCLIRejectsFinalizationWithoutWriterStop(t *testing.T) {
|
||||
var out, log bytes.Buffer
|
||||
err := run(context.Background(), []string{"finalize", "--config", "dev/migration.example.json", "--state", "/tmp/unused-state"}, &out, &log)
|
||||
if err == nil || !strings.Contains(err.Error(), "--writers-stopped") {
|
||||
t.Fatalf("got %v", err)
|
||||
}
|
||||
}
|
||||
func TestCLIUsage(t *testing.T) {
|
||||
var out, log bytes.Buffer
|
||||
if err := run(context.Background(), []string{"--help"}, &out, &log); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !strings.Contains(out.String(), "finalize") {
|
||||
t.Fatal("help missing")
|
||||
}
|
||||
for _, args := range [][]string{nil, {"unknown"}, {"sync"}, {"status"}, {"sync", "--config", "x", "extra"}} {
|
||||
if err := run(context.Background(), args, &out, &log); err == nil {
|
||||
t.Fatalf("accepted %v", args)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user