From f7968aad1cd56ca7f0119f159f5be2462a9bbf6d Mon Sep 17 00:00:00 2001 From: nielash Date: Sat, 9 Aug 2025 00:21:19 -0400 Subject: [PATCH] fstest: fix parsing of commas in -remotes Connection string remotes like "TestGoogleCloudStorage,directory_markers:" use commas. Before this change, these could not be passed with the -remotes flag, which expected commas to be used only as separators. After this change, CSV parsing is used so that commas will be properly recognized inside a terminal-escaped and quoted value, like: -remotes local,\"TestGoogleCloudStorage,directory_markers:\" --- fstest/test_all/test_all.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fstest/test_all/test_all.go b/fstest/test_all/test_all.go index f1b40c34d..07328387b 100644 --- a/fstest/test_all/test_all.go +++ b/fstest/test_all/test_all.go @@ -11,6 +11,7 @@ Make TesTrun have a []string of flags to try - that then makes it generic */ import ( + "encoding/csv" "flag" "fmt" "math/rand" @@ -79,7 +80,14 @@ func main() { // Filter selection if *testRemotes != "" { - conf.filterBackendsByRemotes(strings.Split(*testRemotes, ",")) + // CSV parse to support connection string remotes with commas like -remotes local,\"TestGoogleCloudStorage,directory_markers:\" + r := csv.NewReader(strings.NewReader(*testRemotes)) + remotes, err := r.Read() + if err != nil { + fs.Fatalf(*testRemotes, "error CSV-parsing -remotes string: %v", err) + } + fs.Debugf(*testRemotes, "using remotes: %v", remotes) + conf.filterBackendsByRemotes(remotes) } if *testBackends != "" { conf.filterBackendsByBackends(strings.Split(*testBackends, ","))