projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
8460: Rename pg -> event_source.go
[arvados.git]
/
services
/
keepstore
/
pull_worker_test.go
diff --git
a/services/keepstore/pull_worker_test.go
b/services/keepstore/pull_worker_test.go
index 5076b85e20703e8305b74ab4ce5a048cd17a81b0..43a6de68443f693acb85696a0f5938836a34b2f7 100644
(file)
--- a/
services/keepstore/pull_worker_test.go
+++ b/
services/keepstore/pull_worker_test.go
@@
-39,7
+39,7
@@
func (s *PullWorkerTestSuite) SetUpTest(c *C) {
func RunTestPullWorker(c *C) {
arv, err := arvadosclient.MakeArvadosClient()
c.Assert(err, Equals, nil)
func RunTestPullWorker(c *C) {
arv, err := arvadosclient.MakeArvadosClient()
c.Assert(err, Equals, nil)
- keepClient, err := keepclient.MakeKeepClient(
&
arv)
+ keepClient, err := keepclient.MakeKeepClient(arv)
c.Assert(err, Equals, nil)
pullq = NewWorkQueue()
c.Assert(err, Equals, nil)
pullq = NewWorkQueue()
@@
-84,10
+84,10
@@
type PullWorkerTestData struct {
func (s *PullWorkerTestSuite) TestPullWorkerPullList_with_two_locators(c *C) {
defer teardown()
func (s *PullWorkerTestSuite) TestPullWorkerPullList_with_two_locators(c *C) {
defer teardown()
-
dataManager
Token = "DATA MANAGER TOKEN"
+
theConfig.systemAuth
Token = "DATA MANAGER TOKEN"
testData := PullWorkerTestData{
name: "TestPullWorkerPullList_with_two_locators",
testData := PullWorkerTestData{
name: "TestPullWorkerPullList_with_two_locators",
- req: RequestTester{"/pull",
dataManager
Token, "PUT", firstPullList},
+ req: RequestTester{"/pull",
theConfig.systemAuth
Token, "PUT", firstPullList},
responseCode: http.StatusOK,
responseBody: "Received 2 pull requests\n",
readContent: "hello",
responseCode: http.StatusOK,
responseBody: "Received 2 pull requests\n",
readContent: "hello",
@@
-101,10
+101,10
@@
func (s *PullWorkerTestSuite) TestPullWorkerPullList_with_two_locators(c *C) {
func (s *PullWorkerTestSuite) TestPullWorkerPullList_with_one_locator(c *C) {
defer teardown()
func (s *PullWorkerTestSuite) TestPullWorkerPullList_with_one_locator(c *C) {
defer teardown()
-
dataManager
Token = "DATA MANAGER TOKEN"
+
theConfig.systemAuth
Token = "DATA MANAGER TOKEN"
testData := PullWorkerTestData{
name: "TestPullWorkerPullList_with_one_locator",
testData := PullWorkerTestData{
name: "TestPullWorkerPullList_with_one_locator",
- req: RequestTester{"/pull",
dataManager
Token, "PUT", secondPullList},
+ req: RequestTester{"/pull",
theConfig.systemAuth
Token, "PUT", secondPullList},
responseCode: http.StatusOK,
responseBody: "Received 1 pull requests\n",
readContent: "hola",
responseCode: http.StatusOK,
responseBody: "Received 1 pull requests\n",
readContent: "hola",
@@
-118,10
+118,10
@@
func (s *PullWorkerTestSuite) TestPullWorkerPullList_with_one_locator(c *C) {
func (s *PullWorkerTestSuite) TestPullWorker_error_on_get_one_locator(c *C) {
defer teardown()
func (s *PullWorkerTestSuite) TestPullWorker_error_on_get_one_locator(c *C) {
defer teardown()
-
dataManager
Token = "DATA MANAGER TOKEN"
+
theConfig.systemAuth
Token = "DATA MANAGER TOKEN"
testData := PullWorkerTestData{
name: "TestPullWorker_error_on_get_one_locator",
testData := PullWorkerTestData{
name: "TestPullWorker_error_on_get_one_locator",
- req: RequestTester{"/pull",
dataManager
Token, "PUT", secondPullList},
+ req: RequestTester{"/pull",
theConfig.systemAuth
Token, "PUT", secondPullList},
responseCode: http.StatusOK,
responseBody: "Received 1 pull requests\n",
readContent: "unused",
responseCode: http.StatusOK,
responseBody: "Received 1 pull requests\n",
readContent: "unused",
@@
-135,10
+135,10
@@
func (s *PullWorkerTestSuite) TestPullWorker_error_on_get_one_locator(c *C) {
func (s *PullWorkerTestSuite) TestPullWorker_error_on_get_two_locators(c *C) {
defer teardown()
func (s *PullWorkerTestSuite) TestPullWorker_error_on_get_two_locators(c *C) {
defer teardown()
-
dataManager
Token = "DATA MANAGER TOKEN"
+
theConfig.systemAuth
Token = "DATA MANAGER TOKEN"
testData := PullWorkerTestData{
name: "TestPullWorker_error_on_get_two_locators",
testData := PullWorkerTestData{
name: "TestPullWorker_error_on_get_two_locators",
- req: RequestTester{"/pull",
dataManager
Token, "PUT", firstPullList},
+ req: RequestTester{"/pull",
theConfig.systemAuth
Token, "PUT", firstPullList},
responseCode: http.StatusOK,
responseBody: "Received 2 pull requests\n",
readContent: "unused",
responseCode: http.StatusOK,
responseBody: "Received 2 pull requests\n",
readContent: "unused",
@@
-152,10
+152,10
@@
func (s *PullWorkerTestSuite) TestPullWorker_error_on_get_two_locators(c *C) {
func (s *PullWorkerTestSuite) TestPullWorker_error_on_put_one_locator(c *C) {
defer teardown()
func (s *PullWorkerTestSuite) TestPullWorker_error_on_put_one_locator(c *C) {
defer teardown()
-
dataManager
Token = "DATA MANAGER TOKEN"
+
theConfig.systemAuth
Token = "DATA MANAGER TOKEN"
testData := PullWorkerTestData{
name: "TestPullWorker_error_on_put_one_locator",
testData := PullWorkerTestData{
name: "TestPullWorker_error_on_put_one_locator",
- req: RequestTester{"/pull",
dataManager
Token, "PUT", secondPullList},
+ req: RequestTester{"/pull",
theConfig.systemAuth
Token, "PUT", secondPullList},
responseCode: http.StatusOK,
responseBody: "Received 1 pull requests\n",
readContent: "hello hello",
responseCode: http.StatusOK,
responseBody: "Received 1 pull requests\n",
readContent: "hello hello",
@@
-169,10
+169,10
@@
func (s *PullWorkerTestSuite) TestPullWorker_error_on_put_one_locator(c *C) {
func (s *PullWorkerTestSuite) TestPullWorker_error_on_put_two_locators(c *C) {
defer teardown()
func (s *PullWorkerTestSuite) TestPullWorker_error_on_put_two_locators(c *C) {
defer teardown()
-
dataManager
Token = "DATA MANAGER TOKEN"
+
theConfig.systemAuth
Token = "DATA MANAGER TOKEN"
testData := PullWorkerTestData{
name: "TestPullWorker_error_on_put_two_locators",
testData := PullWorkerTestData{
name: "TestPullWorker_error_on_put_two_locators",
- req: RequestTester{"/pull",
dataManager
Token, "PUT", firstPullList},
+ req: RequestTester{"/pull",
theConfig.systemAuth
Token, "PUT", firstPullList},
responseCode: http.StatusOK,
responseBody: "Received 2 pull requests\n",
readContent: "hello again",
responseCode: http.StatusOK,
responseBody: "Received 2 pull requests\n",
readContent: "hello again",
@@
-195,10
+195,10
@@
func (s *PullWorkerTestSuite) TestPullWorkerPullList_with_two_items_latest_repla
pullq.ReplaceQueue(makeTestWorkList(firstInput))
testPullLists["Added_before_actual_test_item"] = string(1)
pullq.ReplaceQueue(makeTestWorkList(firstInput))
testPullLists["Added_before_actual_test_item"] = string(1)
-
dataManager
Token = "DATA MANAGER TOKEN"
+
theConfig.systemAuth
Token = "DATA MANAGER TOKEN"
testData := PullWorkerTestData{
name: "TestPullWorkerPullList_with_two_items_latest_replacing_old",
testData := PullWorkerTestData{
name: "TestPullWorkerPullList_with_two_items_latest_replacing_old",
- req: RequestTester{"/pull",
dataManager
Token, "PUT", secondPullList},
+ req: RequestTester{"/pull",
theConfig.systemAuth
Token, "PUT", secondPullList},
responseCode: http.StatusOK,
responseBody: "Received 1 pull requests\n",
readContent: "hola de nuevo",
responseCode: http.StatusOK,
responseBody: "Received 1 pull requests\n",
readContent: "hola de nuevo",
@@
-210,14
+210,14
@@
func (s *PullWorkerTestSuite) TestPullWorkerPullList_with_two_items_latest_repla
}
// In this case, the item will not be placed on pullq
}
// In this case, the item will not be placed on pullq
-func (s *PullWorkerTestSuite) TestPullWorker_invalid
_dataManager
Token(c *C) {
+func (s *PullWorkerTestSuite) TestPullWorker_invalidToken(c *C) {
defer teardown()
defer teardown()
-
dataManager
Token = "DATA MANAGER TOKEN"
+
theConfig.systemAuth
Token = "DATA MANAGER TOKEN"
testData := PullWorkerTestData{
name: "TestPullWorkerPullList_with_two_locators",
testData := PullWorkerTestData{
name: "TestPullWorkerPullList_with_two_locators",
- req: RequestTester{"/pull", "invalid
_dataManager
Token", "PUT", firstPullList},
+ req: RequestTester{"/pull", "invalidToken", "PUT", firstPullList},
responseCode: http.StatusUnauthorized,
responseBody: "Unauthorized\n",
readContent: "hello",
responseCode: http.StatusUnauthorized,
responseBody: "Unauthorized\n",
readContent: "hello",