+ test "find_reusable method with cuda" do
+ set_user_from_auth :active
+ # No cuda
+ no_cuda_attrs = REUSABLE_COMMON_ATTRS.merge({use_existing:false, priority:1, environment:{"var" => "queued"},
+ runtime_constraints: {"vcpus" => 1, "ram" => 1, "keep_cache_ram"=>268435456, "API" => false,
+ "cuda" => {"device_count":0, "driver_version": "", "hardware_capability": ""}},})
+ c1, _ = minimal_new(no_cuda_attrs)
+ assert_equal Container::Queued, c1.state
+
+ # has cuda
+ cuda_attrs = REUSABLE_COMMON_ATTRS.merge({use_existing:false, priority:1, environment:{"var" => "queued"},
+ runtime_constraints: {"vcpus" => 1, "ram" => 1, "keep_cache_ram"=>268435456, "API" => false,
+ "cuda" => {"device_count":1, "driver_version": "11.0", "hardware_capability": "9.0"}},})
+ c2, _ = minimal_new(cuda_attrs)
+ assert_equal Container::Queued, c2.state
+
+ # should find the no cuda one
+ reused = Container.find_reusable(no_cuda_attrs)
+ assert_not_nil reused
+ assert_equal reused.uuid, c1.uuid
+
+ # should find the cuda one
+ reused = Container.find_reusable(cuda_attrs)
+ assert_not_nil reused
+ assert_equal reused.uuid, c2.uuid
+ end
+