[ARVADOS] updated: 1.2.0-178-g355ed696d

Git user git at public.curoverse.com
Mon Oct 15 12:09:50 EDT 2018


Summary of changes:
 apps/workbench/app/models/container_work_unit.rb   |  2 +-
 services/api/test/fixtures/containers.yml          |  3 ++-
 .../arvados/v1/containers_controller_test.rb       |  3 +--
 .../api/test/integration/container_auth_test.rb    | 30 ++++++++++------------
 services/api/test/unit/container_test.rb           |  2 +-
 5 files changed, 18 insertions(+), 22 deletions(-)

       via  355ed696d9782561f4c7cce707e275f8658157a1 (commit)
      from  cf36960c259c4f81c3c8758c9f18dc42db7e03fa (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 355ed696d9782561f4c7cce707e275f8658157a1
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Mon Oct 15 12:09:35 2018 -0400

    14260: Fix tests.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index 964295619..ef20a7f8f 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -23,7 +23,7 @@ class ContainerWorkUnit < ProxyWorkUnit
     items = []
     container_uuid = if @proxied.is_a?(Container) then uuid else get(:container_uuid) end
     if container_uuid
-      cols = ContainerRequest.columns.map(&:name) - %w(id updated_at mounts secret_mounts)
+      cols = ContainerRequest.columns.map(&:name) - %w(id updated_at mounts secret_mounts runtime_token)
       my_children = @child_proxies || ContainerRequest.select(cols).where(requesting_container_uuid: container_uuid).results if !my_children
       my_child_containers = my_children.map(&:container_uuid).compact.uniq
       grandchildren = {}
diff --git a/services/api/test/fixtures/containers.yml b/services/api/test/fixtures/containers.yml
index eefb0297c..5c5d45f4b 100644
--- a/services/api/test/fixtures/containers.yml
+++ b/services/api/test/fixtures/containers.yml
@@ -263,7 +263,8 @@ running_to_be_deleted:
 runtime_token:
   uuid: zzzzz-dz642-20isqbkl8xwnsao
   owner_uuid: zzzzz-tpzed-000000000000000
-  state: Queued
+  state: Locked
+  locked_by_uuid: zzzzz-gj3su-jrriu629zljsnuf
   priority: 1
   created_at: 2016-01-11 11:11:11.111111111 Z
   updated_at: 2016-01-11 11:11:11.111111111 Z
diff --git a/services/api/test/functional/arvados/v1/containers_controller_test.rb b/services/api/test/functional/arvados/v1/containers_controller_test.rb
index 8880967ba..452533b9e 100644
--- a/services/api/test/functional/arvados/v1/containers_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/containers_controller_test.rb
@@ -153,9 +153,8 @@ class Arvados::V1::ContainersControllerTest < ActionController::TestCase
   end
 
   test 'get runtime_token auth' do
-    authorize_with :dispatch1
+    authorize_with :dispatch2
     c = containers(:runtime_token)
-    assert c.lock, show_errors(c)
     get :auth, id: c.uuid
     assert_response :success
     assert_equal "v2/#{json_response['uuid']}/#{json_response['api_token']}", api_client_authorizations(:container_runtime_token).token
diff --git a/services/api/test/integration/container_auth_test.rb b/services/api/test/integration/container_auth_test.rb
index bec8b5784..552cce44b 100644
--- a/services/api/test/integration/container_auth_test.rb
+++ b/services/api/test/integration/container_auth_test.rb
@@ -7,14 +7,6 @@ require 'test_helper'
 class ContainerAuthTest < ActionDispatch::IntegrationTest
   fixtures :all
 
-  test "container token validate, Queued" do
-    get "/arvados/v1/containers/current", {
-      :format => :json
-        }, {'HTTP_AUTHORIZATION' => "Bearer #{api_client_authorizations(:container_runtime_token).token}/#{containers(:runtime_token).uuid}"}
-    # Container is Queued, token cannot be used
-    assert_response 401
-  end
-
   test "container token validate, Running, regular auth" do
     get "/arvados/v1/containers/current", {
       :format => :json
@@ -25,9 +17,6 @@ class ContainerAuthTest < ActionDispatch::IntegrationTest
   end
 
   test "container token validate, Locked, runtime_token" do
-    post "/arvados/v1/containers/#{containers(:runtime_token).uuid}/lock", {
-      :format => :json
-    }, {'HTTP_AUTHORIZATION' => "Bearer #{api_client_authorizations(:dispatch1).token}"}
     get "/arvados/v1/containers/current", {
       :format => :json
         }, {'HTTP_AUTHORIZATION' => "Bearer #{api_client_authorizations(:container_runtime_token).token}/#{containers(:runtime_token).uuid}"}
@@ -36,6 +25,19 @@ class ContainerAuthTest < ActionDispatch::IntegrationTest
     assert_equal containers(:runtime_token).uuid, json_response['uuid']
   end
 
+  test "container token validate, Cancelled, runtime_token" do
+    put "/arvados/v1/containers/#{containers(:runtime_token).uuid}", {
+          :format => :json,
+          :container => {:state => "Cancelled"}
+        }, {'HTTP_AUTHORIZATION' => "Bearer #{api_client_authorizations(:dispatch1).token}"}
+    assert_response :success
+    get "/arvados/v1/containers/current", {
+      :format => :json
+        }, {'HTTP_AUTHORIZATION' => "Bearer #{api_client_authorizations(:container_runtime_token).token}/#{containers(:runtime_token).uuid}"}
+    # Container is Queued, token cannot be used
+    assert_response 401
+  end
+
   test "container token validate, Running, without optional portion" do
     get "/arvados/v1/containers/current", {
       :format => :json
@@ -46,9 +48,6 @@ class ContainerAuthTest < ActionDispatch::IntegrationTest
   end
 
   test "container token validate, Locked, runtime_token, without optional portion" do
-    post "/arvados/v1/containers/#{containers(:runtime_token).uuid}/lock", {
-      :format => :json
-    }, {'HTTP_AUTHORIZATION' => "Bearer #{api_client_authorizations(:dispatch1).token}"}
     get "/arvados/v1/containers/current", {
       :format => :json
         }, {'HTTP_AUTHORIZATION' => "Bearer #{api_client_authorizations(:container_runtime_token).token}"}
@@ -57,9 +56,6 @@ class ContainerAuthTest < ActionDispatch::IntegrationTest
   end
 
   test "container token validate, wrong container uuid" do
-    post "/arvados/v1/containers/#{containers(:runtime_token).uuid}/lock", {
-      :format => :json
-    }, {'HTTP_AUTHORIZATION' => "Bearer #{api_client_authorizations(:dispatch1).token}"}
     get "/arvados/v1/containers/current", {
       :format => :json
         }, {'HTTP_AUTHORIZATION' => "Bearer #{api_client_authorizations(:container_runtime_token).token}/#{containers(:running).uuid}"}
diff --git a/services/api/test/unit/container_test.rb b/services/api/test/unit/container_test.rb
index 39fde79a3..491022ad8 100644
--- a/services/api/test/unit/container_test.rb
+++ b/services/api/test/unit/container_test.rb
@@ -671,7 +671,7 @@ class ContainerTest < ActiveSupport::TestCase
   end
 
   test "Container queued count" do
-    assert_equal 2, Container.readable_by(users(:active)).where(state: "Queued").count
+    assert_equal 1, Container.readable_by(users(:active)).where(state: "Queued").count
   end
 
   test "Container locked cancel" do

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list