[ARVADOS] updated: 2.1.0-111-g14d8b783f
Git user
git at public.arvados.org
Fri Dec 4 20:26:47 UTC 2020
Summary of changes:
lib/controller/federation/conn.go | 2 ++
lib/controller/integration_test.go | 38 ++++++++++++++++++++++++++++++++++++++
lib/controller/rpc/conn.go | 2 ++
3 files changed, 42 insertions(+)
via 14d8b783fb5940db594f377920c4ecd20ac262a9 (commit)
from 17ef0d07a7671fb3dab8ee9b40b945ac035f89b8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 14d8b783fb5940db594f377920c4ecd20ac262a9
Author: Nico Cesar <nico at nicocesar.com>
Date: Fri Dec 4 15:25:28 2020 -0500
added a test that fails to prove rpc.Conn is not DTRT
Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico at curii.com>
diff --git a/lib/controller/federation/conn.go b/lib/controller/federation/conn.go
index e99afc251..30c15b57c 100644
--- a/lib/controller/federation/conn.go
+++ b/lib/controller/federation/conn.go
@@ -10,6 +10,7 @@ import (
"encoding/json"
"errors"
"fmt"
+ "log"
"net/http"
"net/url"
"regexp"
@@ -342,6 +343,7 @@ func (conn *Conn) ContainerRequestList(ctx context.Context, options arvados.List
func (conn *Conn) ContainerRequestCreate(ctx context.Context, options arvados.CreateOptions) (arvados.ContainerRequest, error) {
be := conn.chooseBackend(options.ClusterID)
+ log.Printf("THIS IS THE federation.Conn.ContainerRequestCreate() for %s we are %s", options.ClusterID, conn.cluster.ClusterID)
if be == conn.local {
return be.ContainerRequestCreate(ctx, options)
}
diff --git a/lib/controller/integration_test.go b/lib/controller/integration_test.go
index a479e4476..e75e996f4 100644
--- a/lib/controller/integration_test.go
+++ b/lib/controller/integration_test.go
@@ -478,6 +478,8 @@ func (s *IntegrationSuite) dbConn(c *check.C, clusterID string) (*sql.DB, *sql.C
return db, conn
}
+// TestRuntimeTokenInCR will test several different tokens in the runtime attribute
+// and check the expected retualts
func (s *IntegrationSuite) TestRuntimeTokenInCR(c *check.C) {
db, dbconn := s.dbConn(c, "z1111")
defer db.Close()
@@ -530,6 +532,42 @@ func (s *IntegrationSuite) TestRuntimeTokenInCR(c *check.C) {
}
}
+// TestIntermediateCluster will send a container request to
+// one cluster with another cluster as the destination
+// and check the tokens are being handled properly
+func (s *IntegrationSuite) TestIntermediateCluster(c *check.C) {
+ conn1 := s.conn("z1111")
+ rootctx1, _, _ := s.rootClients("z1111")
+ _, ac1, _, _ := s.userClients(rootctx1, c, conn1, "z1111", true)
+ //conn2 := s.conn("z2222")
+ //rootctx2, _, _ := s.rootClients("z2222")
+ //_, ac2, _, _ := s.userClients(rootctx2, c, conn2, "z2222", true)
+
+ tests := []struct {
+ name string
+ token string
+ }{
+ {"Good token z1111 user sending a CR to z2222", ac1.AuthToken},
+ }
+
+ for _, tt := range tests {
+ c.Log(c.TestName() + " " + tt.name)
+ rq := map[string]interface{}{
+ "command": []string{"echo"},
+ "container_image": "d41d8cd98f00b204e9800998ecf8427e+0",
+ "cwd": "/",
+ "output_path": "/",
+ "runtime_token": tt.token,
+ }
+ cr, err := conn1.ContainerRequestCreate(rootctx1, arvados.CreateOptions{ClusterID: "z2222", Attrs: rq})
+
+ c.Check(err, check.IsNil)
+ c.Check(cr, check.NotNil)
+ c.Check(cr.UUID, check.Not(check.Equals), "")
+
+ }
+}
+
// Test for bug #16263
func (s *IntegrationSuite) TestListUsers(c *check.C) {
rootctx1, _, _ := s.rootClients("z1111")
diff --git a/lib/controller/rpc/conn.go b/lib/controller/rpc/conn.go
index 5ffa66801..b3fd541bb 100644
--- a/lib/controller/rpc/conn.go
+++ b/lib/controller/rpc/conn.go
@@ -12,6 +12,7 @@ import (
"errors"
"fmt"
"io"
+ "log"
"net"
"net/http"
"net/url"
@@ -287,6 +288,7 @@ func (conn *Conn) ContainerUnlock(ctx context.Context, options arvados.GetOption
}
func (conn *Conn) ContainerRequestCreate(ctx context.Context, options arvados.CreateOptions) (arvados.ContainerRequest, error) {
+ log.Printf("THIS IS THE rcp.Conn.ContainerRequestCreate(): %s", options.ClusterID)
ep := arvados.EndpointContainerRequestCreate
var resp arvados.ContainerRequest
err := conn.requestAndDecode(ctx, &resp, ep, nil, options)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list