- test "Independent containers" do
- set_user_from_auth :active_trustedclient
- c = ContainerRequest.new
- c.state = "Committed"
- c.container_image = "img"
- c.command = ["foo", "bar"]
- c.output_path = "/tmp"
- c.cwd = "/tmp"
- c.priority = 5
- c.save!
-
- c2 = ContainerRequest.new
- c2.state = "Committed"
- c2.container_image = "img"
- c2.command = ["foo", "bar"]
- c2.output_path = "/tmp"
- c2.cwd = "/tmp"
- c2.priority = 10
- c2.save!
-
- t = Container.find_by_uuid c.container_uuid
- assert_equal t.priority, 5
-
- t2 = Container.find_by_uuid c2.container_uuid
- assert_equal t2.priority, 10
-
- c.priority = 0
- c.save!
-
- t.reload
- assert_equal t.priority, 0
-
- t2.reload
- assert_equal t2.priority, 10
- end
-
- test "Container container cancel" do
- set_user_from_auth :active_trustedclient
- c = ContainerRequest.new
- c.state = "Committed"
- c.container_image = "img"
- c.command = ["foo", "bar"]
- c.output_path = "/tmp"
- c.cwd = "/tmp"
- c.priority = 5
- c.save!