Merge branch '16265-security-updates' into dependabot/bundler/apps/workbench/loofah...
[arvados.git] / services / crunch-dispatch-slurm / crunch-dispatch-slurm_test.go
index 63117128eb594e5c492fbe2e93e84c5f77672b1f..3c14f7044c7f8f6a9d9213ec0656af9c88d80cb9 100644 (file)
@@ -19,11 +19,11 @@ import (
        "testing"
        "time"
 
-       "git.curoverse.com/arvados.git/lib/dispatchcloud"
-       "git.curoverse.com/arvados.git/sdk/go/arvados"
-       "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
-       "git.curoverse.com/arvados.git/sdk/go/arvadostest"
-       "git.curoverse.com/arvados.git/sdk/go/dispatch"
+       "git.arvados.org/arvados.git/lib/dispatchcloud"
+       "git.arvados.org/arvados.git/sdk/go/arvados"
+       "git.arvados.org/arvados.git/sdk/go/arvadosclient"
+       "git.arvados.org/arvados.git/sdk/go/arvadostest"
+       "git.arvados.org/arvados.git/sdk/go/dispatch"
        "github.com/sirupsen/logrus"
        . "gopkg.in/check.v1"
 )
@@ -420,6 +420,7 @@ BatchSize: 99
                c.Error(err)
 
        }
+       os.Setenv("ARVADOS_KEEP_SERVICES", "")
        err = s.disp.configure("crunch-dispatch-slurm", []string{"-config", tmpfile.Name()})
        c.Check(err, IsNil)
 
@@ -433,16 +434,8 @@ BatchSize: 99
        c.Check(s.disp.cluster.Containers.ReserveExtraRAM, Equals, arvados.ByteSize(12345))
        c.Check(s.disp.cluster.Containers.MinRetryPeriod, Equals, arvados.Duration(13*time.Second))
        c.Check(s.disp.cluster.API.MaxItemsPerResponse, Equals, 99)
-       c.Check(s.disp.cluster.Containers.SLURM.KeepServices, DeepEquals, map[string]arvados.Service{
-               "00000-bi6l4-000000000000000": arvados.Service{
-                       InternalURLs: map[arvados.URL]arvados.ServiceInstance{
-                               arvados.URL{Scheme: "https", Path: "/keep1", Host: "example.com"}: struct{}{},
-                               arvados.URL{Scheme: "https", Path: "/keep2", Host: "example.com"}: struct{}{},
-                       },
-               },
+       c.Check(s.disp.cluster.Containers.SLURM.SbatchEnvironmentVariables, DeepEquals, map[string]string{
+               "ARVADOS_KEEP_SERVICES": "https://example.com/keep1 https://example.com/keep2",
        })
-       ks := os.Getenv("ARVADOS_KEEP_SERVICES")
-       if ks != "https://example.com/keep1 https://example.com/keep2" && ks != "https://example.com/keep2 https://example.com/keep1" {
-               c.Assert(ks, Equals, "https://example.com/keep1 https://example.com/keep2")
-       }
+       c.Check(os.Getenv("ARVADOS_KEEP_SERVICES"), Equals, "https://example.com/keep1 https://example.com/keep2")
 }