7167: Remove StartKeepWithParams and StopKeepWithParams and make StartKeep and StopKe...
authorradhika <radhika@curoverse.com>
Fri, 16 Oct 2015 14:23:12 +0000 (10:23 -0400)
committerradhika <radhika@curoverse.com>
Fri, 16 Oct 2015 14:23:12 +0000 (10:23 -0400)
The update was small enough, about 10 usages in the entire code, and hence did not make sense to postpone it for a "better" time.

sdk/go/arvadosclient/arvadosclient_test.go
sdk/go/arvadostest/run_servers.go
sdk/go/keepclient/keepclient_test.go
services/datamanager/datamanager_test.go
services/keepproxy/keepproxy_test.go
services/keepstore/pull_worker_integration_test.go
tools/keep-rsync/keep-rsync_test.go

index d35f6dacb72b632e18718b503d0a2f4ff55e7a17..2c508dcb4a1100cf4609fc3ff3387ac089c6ab26 100644 (file)
@@ -21,7 +21,7 @@ type ServerRequiredSuite struct{}
 
 func (s *ServerRequiredSuite) SetUpSuite(c *C) {
        arvadostest.StartAPI()
-       arvadostest.StartKeep()
+       arvadostest.StartKeep(2, false)
 }
 
 func (s *ServerRequiredSuite) SetUpTest(c *C) {
index e922104aeb75096b4a6f36b6648e74af0abe821d..27c552a4e104094ca2ed15991e310a3b7e9cd65e 100644 (file)
@@ -99,14 +99,10 @@ func StopAPI() {
        exec.Command("python", "run_test_server.py", "stop").Run()
 }
 
-// StartKeep starts 2 keep servers with enforcePermissions=false
-func StartKeep() {
-       StartKeepWithParams(2, false)
-}
-
-// StartKeepWithParams starts the given number of keep servers,
+// StartKeep starts the given number of keep servers,
 // optionally with -enforce-permissions enabled.
-func StartKeepWithParams(numKeepServers int, enforcePermissions bool) {
+// Use numKeepServers = 2 and enforcePermissions = false under all normal circumstances.
+func StartKeep(numKeepServers int, enforcePermissions bool) {
        cwd, _ := os.Getwd()
        defer os.Chdir(cwd)
        chdirToPythonTests()
@@ -128,14 +124,10 @@ func StartKeepWithParams(numKeepServers int, enforcePermissions bool) {
        }
 }
 
-func StopKeep() {
-       StopKeepWithParams(2)
-}
-
-// StopKeepServers stops keep servers that were started with
-// StartKeep. numkeepServers should be the same value that was passed
-// to StartKeep.
-func StopKeepWithParams(numKeepServers int) {
+// StopKeep stops keep servers that were started with StartKeep.
+// numkeepServers should be the same value that was passed to StartKeep,
+// which is 2 under all normal circumstances.
+func StopKeep(numKeepServers int) {
        cwd, _ := os.Getwd()
        defer os.Chdir(cwd)
        chdirToPythonTests()
index b5bc5ced4b23716a381f2af7d53f075a17b6771e..aaba0695f0d0751c370fbd42741c3f6e77b9fbce 100644 (file)
@@ -45,14 +45,14 @@ func (s *ServerRequiredSuite) SetUpSuite(c *C) {
                return
        }
        arvadostest.StartAPI()
-       arvadostest.StartKeep()
+       arvadostest.StartKeep(2, false)
 }
 
 func (s *ServerRequiredSuite) TearDownSuite(c *C) {
        if *no_server {
                return
        }
-       arvadostest.StopKeep()
+       arvadostest.StopKeep(2)
        arvadostest.StopAPI()
 }
 
index 3d9bb3da90a2c828207318908f1ee083d0d0d5f3..c2cb762d52b625b625634f24d385ddbf9ad4e7d8 100644 (file)
@@ -31,7 +31,7 @@ func SetupDataManagerTest(t *testing.T) {
        // start api and keep servers
        arvadostest.ResetEnv()
        arvadostest.StartAPI()
-       arvadostest.StartKeep()
+       arvadostest.StartKeep(2, false)
 
        arv = makeArvadosClient()
 
@@ -54,7 +54,7 @@ func SetupDataManagerTest(t *testing.T) {
 }
 
 func TearDownDataManagerTest(t *testing.T) {
-       arvadostest.StopKeep()
+       arvadostest.StopKeep(2)
        arvadostest.StopAPI()
 }
 
index 6fe8fe7ac3d0023c4d012be022c9ab3d50431d62..7643e4b0fa2225492caae1dd0aff3428505bd86d 100644 (file)
@@ -53,7 +53,7 @@ func closeListener() {
 
 func (s *ServerRequiredSuite) SetUpSuite(c *C) {
        arvadostest.StartAPI()
-       arvadostest.StartKeep()
+       arvadostest.StartKeep(2, false)
 }
 
 func (s *ServerRequiredSuite) SetUpTest(c *C) {
@@ -61,7 +61,7 @@ func (s *ServerRequiredSuite) SetUpTest(c *C) {
 }
 
 func (s *ServerRequiredSuite) TearDownSuite(c *C) {
-       arvadostest.StopKeep()
+       arvadostest.StopKeep(2)
        arvadostest.StopAPI()
 }
 
index e0bad0045af34d8067591fa723e9229be093790c..3a3069ab7745c1efc0a21fd8c706565f65c525e0 100644 (file)
@@ -27,7 +27,7 @@ func SetupPullWorkerIntegrationTest(t *testing.T, testData PullWorkIntegrationTe
 
        // start api and keep servers
        arvadostest.StartAPI()
-       arvadostest.StartKeep()
+       arvadostest.StartKeep(2, false)
 
        // make arvadosclient
        arv, err := arvadosclient.MakeArvadosClient()
index f1091887d5f50ae71a416a6ffb73ae55fc081b3a..6fbb535a03a3069249b1ab22fa6aaae85740998f 100644 (file)
@@ -59,7 +59,7 @@ func (s *ServerRequiredSuite) SetUpTest(c *C) {
 }
 
 func (s *ServerRequiredSuite) TearDownTest(c *C) {
-       arvadostest.StopKeepWithParams(3)
+       arvadostest.StopKeep(3)
 }
 
 func (s *DoMainTestSuite) SetUpTest(c *C) {
@@ -94,7 +94,7 @@ func setupRsync(c *C, enforcePermissions bool, replications int) {
        }
 
        // Start Keep servers
-       arvadostest.StartKeepWithParams(3, enforcePermissions)
+       arvadostest.StartKeep(3, enforcePermissions)
 
        // setup keepclients
        var err error
@@ -421,6 +421,7 @@ func setupConfigFile(c *C, name string) *os.File {
        fileContent := "ARVADOS_API_HOST=" + os.Getenv("ARVADOS_API_HOST") + "\n"
        fileContent += "ARVADOS_API_TOKEN=" + os.Getenv("ARVADOS_API_TOKEN") + "\n"
        fileContent += "ARVADOS_API_HOST_INSECURE=" + os.Getenv("ARVADOS_API_HOST_INSECURE") + "\n"
+       fileContent += "ARVADOS_EXTERNAL_CLIENT=false\n"
        fileContent += "ARVADOS_BLOB_SIGNING_KEY=abcdefg"
 
        _, err = file.Write([]byte(fileContent))
@@ -468,7 +469,7 @@ func (s *DoMainTestSuite) Test_doMainWithSrcAndDstConfig(c *C) {
 
        // Start keepservers. Since we are not doing any tweaking as in setupRsync func,
        // kcSrc and kcDst will be the same and no actual copying to dst will happen, but that's ok.
-       arvadostest.StartKeep()
+       arvadostest.StartKeep(2, false)
 
        err := doMain()
        c.Check(err, IsNil)