X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/55bf4eda20444c8cd875c0e5f4e464e77b393946..5e3f6c9ad492c43044c88ebdc7eea6bdff667f46:/services/api/test/functional/arvados/v1/containers_controller_test.rb 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 588c025cf7..07fa5c3211 100644 --- a/services/api/test/functional/arvados/v1/containers_controller_test.rb +++ b/services/api/test/functional/arvados/v1/containers_controller_test.rb @@ -97,7 +97,7 @@ class Arvados::V1::ContainersControllerTest < ActionController::TestCase authorize_with :dispatch2 uuid = containers(:locked).uuid post :unlock, params: {id: uuid} - assert_response 422 + assert_response 403 end [ @@ -160,4 +160,33 @@ class Arvados::V1::ContainersControllerTest < ActionController::TestCase assert_equal "v2/#{json_response['uuid']}/#{json_response['api_token']}", api_client_authorizations(:container_runtime_token).token assert_equal 'arvados#apiClientAuthorization', json_response['kind'] end + + test 'update_priority' do + ActiveRecord::Base.connection.execute "update containers set priority=0 where uuid='#{containers(:running).uuid}'" + authorize_with :admin + post :update_priority, params: {id: containers(:running).uuid} + assert_response :success + assert_not_equal 0, Container.find_by_uuid(containers(:running).uuid).priority + end + + test 'update runtime_status, runtime_status is toplevel key' do + authorize_with :dispatch1 + c = containers(:running) + patch :update, params: {id: containers(:running).uuid, runtime_status: {activity: "foo", activityDetail: "bar"}} + assert_response :success + end + + test 'update runtime_status, container is toplevel key' do + authorize_with :dispatch1 + c = containers(:running) + patch :update, params: {id: containers(:running).uuid, container: {runtime_status: {activity: "foo", activityDetail: "bar"}}} + assert_response :success + end + + test 'update state, state is toplevel key' do + authorize_with :dispatch1 + c = containers(:running) + patch :update, params: {id: containers(:running).uuid, state: "Complete", runtime_status: {activity: "finishing"}} + assert_response :success + end end