- def create_new_container attrs={}
- attrs = {
- command: ['echo', 'foo'],
- container_image: 'img',
- output_path: '/tmp',
- priority: 1,
- runtime_constraints: {"vcpus" => 1, "ram" => 1},
- }
- c = Container.new attrs.merge(attrs)
- c.save!
- cr = ContainerRequest.new attrs.merge(attrs)
- cr.save!
- assert cr.update_attributes(container_uuid: c.uuid,
- state: ContainerRequest::Committed,
- ), show_errors(cr)
- return c
+ test "unlock container locked by different dispatcher" do
+ authorize_with :dispatch2
+ uuid = containers(:locked).uuid
+ post :unlock, {id: uuid}
+ assert_response 422