From 6a67a1b576bb695e9b274c277b7220590da1a39d Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Fri, 25 Sep 2020 01:00:43 -0400 Subject: [PATCH] 16809: Test keep-web with s3cmd if available. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- lib/install/deps.go | 5 +++-- services/keep-web/s3_test.go | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/install/deps.go b/lib/install/deps.go index 93a0ce452b..dceb8f3ff7 100644 --- a/lib/install/deps.go +++ b/lib/install/deps.go @@ -142,11 +142,12 @@ func (installCommand) RunCommand(prog string, args []string, stdin io.Reader, st "postgresql", "postgresql-contrib", "python3-dev", + "python3-venv", + "python3-virtualenv", "r-base", "r-cran-testthat", + "s3cmd", "sudo", - "python3-virtualenv", - "python3-venv", "wget", "xvfb", "zlib1g-dev", diff --git a/services/keep-web/s3_test.go b/services/keep-web/s3_test.go index 5acc18e494..8a476c9abb 100644 --- a/services/keep-web/s3_test.go +++ b/services/keep-web/s3_test.go @@ -11,6 +11,7 @@ import ( "io/ioutil" "net/http" "os" + "os/exec" "strings" "sync" "time" @@ -664,3 +665,18 @@ func (s *IntegrationSuite) testS3CollectionListRollup(c *check.C) { c.Logf("=== trial %+v keys %q prefixes %q nextMarker %q", trial, gotKeys, gotPrefixes, resp.NextMarker) } } + +func (s *IntegrationSuite) TestS3cmd(c *check.C) { + if _, err := exec.LookPath("s3cmd"); err != nil { + c.Skip("s3cmd not found") + return + } + + stage := s.s3setup(c) + defer stage.teardown(c) + + cmd := exec.Command("s3cmd", "--no-ssl", "--host="+s.testServer.Addr, "--host-bucket="+s.testServer.Addr, "--access_key="+arvadostest.ActiveTokenUUID, "--secret_key="+arvadostest.ActiveToken, "ls", "s3://"+arvadostest.FooCollection) + buf, err := cmd.CombinedOutput() + c.Check(err, check.IsNil) + c.Check(string(buf), check.Matches, `.* 3 +s3://`+arvadostest.FooCollection+`/foo\n`) +} -- 2.30.2