X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/77c8223f5ddd64cff2b08d0857749644c474946f..773413b6decf25e4ab669881e00c507aa8a1486f:/services/api/test/unit/container_test.rb diff --git a/services/api/test/unit/container_test.rb b/services/api/test/unit/container_test.rb index efe8c81333..375ab5a7bb 100644 --- a/services/api/test/unit/container_test.rb +++ b/services/api/test/unit/container_test.rb @@ -23,7 +23,7 @@ class ContainerTest < ActiveSupport::TestCase command: ["echo", "hello"], output_path: "test", runtime_constraints: { - "api" => false, + "API" => false, "keep_cache_ram" => 0, "ram" => 12000000000, "vcpus" => 4, @@ -229,7 +229,7 @@ class ContainerTest < ActiveSupport::TestCase set_user_from_auth :active env = {"C" => "3", "B" => "2", "A" => "1"} m = {"F" => {"kind" => "3"}, "E" => {"kind" => "2"}, "D" => {"kind" => "1"}} - rc = {"vcpus" => 1, "ram" => 1, "keep_cache_ram" => 1, "api" => true} + rc = {"vcpus" => 1, "ram" => 1, "keep_cache_ram" => 1, "API" => true} c, _ = minimal_new(environment: env, mounts: m, runtime_constraints: rc) c.reload assert_equal Container.deep_sort_hash(env).to_json, c.environment.to_json @@ -750,6 +750,17 @@ class ContainerTest < ActiveSupport::TestCase check_no_change_from_cancelled c end + test "Container locked with non-expiring token" do + Rails.configuration.API.TokenMaxLifetime = 1.hour + set_user_from_auth :active + c, _ = minimal_new + set_user_from_auth :dispatch1 + assert c.lock, show_errors(c) + refute c.auth.nil? + assert c.auth.expires_at.nil? + assert c.auth.user_id == User.find_by_uuid(users(:active).uuid).id + end + test "Container locked cancel with log" do set_user_from_auth :active c, _ = minimal_new