MCPcopy
hub / github.com/pingcap/tidb / newTestStorageCommand

Function newTestStorageCommand

br/cmd/br/operator.go:158–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156}
157
158func newTestStorageCommand() *cobra.Command {
159 cmd := &cobra.Command{
160 Use: "test-storage",
161 Short: "test all operations of an external storage",
162 Long: "Test all ExternalStorage operations including read, write, delete, " +
163 "rename, walk, and streaming operations. This helps verify storage " +
164 "configuration and permissions before using it for backup/restore.",
165 Args: cobra.NoArgs,
166 RunE: func(cmd *cobra.Command, args []string) error {
167 cfg := operator.TestStorageConfig{}
168 if err := cfg.ParseFromFlags(cmd.Flags()); err != nil {
169 return err
170 }
171 ctx := GetDefaultContext()
172 return operator.RunTestStorage(ctx, cfg)
173 },
174 }
175 operator.DefineFlagsForTestStorageConfig(cmd.Flags())
176 return cmd
177}

Callers 1

newOperatorCommandFunction · 0.85

Calls 5

ParseFromFlagsMethod · 0.95
RunTestStorageFunction · 0.92
GetDefaultContextFunction · 0.85
FlagsMethod · 0.80

Tested by

no test coverage detected