Update test failing on debian 12 if s3cmd is installed.
authorTom Clegg <tom@curii.com>
Thu, 21 Mar 2024 15:21:22 +0000 (11:21 -0400)
committerTom Clegg <tom@curii.com>
Thu, 21 Mar 2024 15:24:28 +0000 (11:24 -0400)
Also, update `arvados-server install -type test` to install s3cmd if
available.

No issue #

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/install/deps.go
services/keep-web/s3_test.go

index f9795cf8728da376d3013f93d6acdebb83ed4c26..08312d738c15d86871b8626357e6cd6e308a140f 100644 (file)
@@ -235,6 +235,10 @@ func (inst *installCommand) RunCommand(prog string, args []string, stdin io.Read
                        } else {
                                pkgs = append(pkgs, "firefox")
                        }
+                       if osv.Debian && osv.Major >= 11 {
+                               // not available in Debian <11
+                               pkgs = append(pkgs, "s3cmd")
+                       }
                }
                if dev || test {
                        pkgs = append(pkgs,
index 0e821696b76be45a82c6ce033b50d2b69d8c022c..79b3712c6b7a766efeb0b0c66ff2c8024e9771b0 100644 (file)
@@ -1295,7 +1295,11 @@ func (s *IntegrationSuite) TestS3cmd(c *check.C) {
        cmd = exec.Command("s3cmd", "--no-ssl", "--host="+s.testServer.URL[7:], "--host-bucket="+s.testServer.URL[7:], "--access_key="+arvadostest.ActiveTokenUUID, "--secret_key="+arvadostest.ActiveToken, "get", "s3://"+arvadostest.FooCollection+"/foo,;$[|]bar", tmpfile)
        buf, err = cmd.CombinedOutput()
        c.Check(err, check.NotNil)
-       c.Check(string(buf), check.Matches, `(?ms).*NoSuchKey.*\n`)
+       // As of commit b7520e5c25e1bf25c1a8bf5aa2eadb299be8f606
+       // (between debian bullseye and bookworm versions), s3cmd
+       // started catching the NoSuchKey error code and replacing it
+       // with "Source object '%s' does not exist.".
+       c.Check(string(buf), check.Matches, `(?ms).*(NoSuchKey|Source object.*does not exist).*\n`)
 }
 
 func (s *IntegrationSuite) TestS3BucketInHost(c *check.C) {