Skip to content

Commit

Permalink
improve ceph test
Browse files Browse the repository at this point in the history
  • Loading branch information
jarlah committed Oct 14, 2023
1 parent 411927c commit 19d91ff
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/ceph_container_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ defmodule CephContainerTest do
container(:ceph, CephContainer.new())

test "creates and starts ceph container", %{ceph: ceph} do

Check failure on line 13 in test/ceph_container_test.exs

View workflow job for this annotation

GitHub Actions / Build and test

test creates and starts ceph container (CephContainerTest)
assert is_number(Container.mapped_port(ceph, 8080))
host_port = Container.mapped_port(ceph, 8080)

{:ok, 404, _headers, _body_ref} =
:hackney.request(:get, "http://127.0.0.1:#{host_port}/bucket_that_does_not_exist")

{:ok, 403, _headers, body_ref} = :hackney.request(:get, "http://127.0.0.1:#{host_port}/demo")

{:ok, 200, _headers, _body_ref} = :hackney.request(:get, "http://127.0.0.1:#{host_port}")
{:ok, body} = :hackney.body(body_ref)
body_str = IO.iodata_to_binary(body)

assert String.contains?(body_str, "anonymous")
end
end

0 comments on commit 19d91ff

Please sign in to comment.