nixos/tests/podman: refactor dns test and fix indentation
This commit is contained in:
parent
b53ab7f158
commit
9ab047538f
@ -133,21 +133,16 @@ import ../make-test-python.nix (
|
|||||||
assert pid == "2"
|
assert pid == "2"
|
||||||
|
|
||||||
with subtest("aardvark-dns"):
|
with subtest("aardvark-dns"):
|
||||||
dns.succeed("tar cv --files-from /dev/null | podman import - scratchimg")
|
dns.succeed("tar cv --files-from /dev/null | podman import - scratchimg")
|
||||||
dns.succeed(
|
dns.succeed(
|
||||||
"podman run -d --name=webserver -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin -w ${pkgs.writeTextDir "index.html" "<h1>Hi</h1>"} scratchimg ${pkgs.python3}/bin/python -m http.server 8000"
|
"podman run -d --name=webserver -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin -w ${pkgs.writeTextDir "index.html" "<h1>Testing</h1>"} scratchimg ${pkgs.python3}/bin/python -m http.server 8000"
|
||||||
)
|
)
|
||||||
dns.succeed("podman ps | grep webserver")
|
dns.succeed("podman ps | grep webserver")
|
||||||
dns.succeed("""
|
dns.wait_until_succeeds(
|
||||||
for i in `seq 0 120`; do
|
"podman run --rm --name=client -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratchimg ${pkgs.curl}/bin/curl http://webserver:8000 | grep Testing"
|
||||||
podman run --rm --name=client -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratchimg ${pkgs.curl}/bin/curl http://webserver:8000 >/dev/console \
|
)
|
||||||
&& exit 0
|
dns.succeed("podman stop webserver")
|
||||||
sleep 0.5
|
dns.succeed("podman rm webserver")
|
||||||
done
|
|
||||||
exit 1
|
|
||||||
""")
|
|
||||||
dns.succeed("podman stop webserver")
|
|
||||||
dns.succeed("podman rm webserver")
|
|
||||||
|
|
||||||
with subtest("A podman member can use the docker cli"):
|
with subtest("A podman member can use the docker cli"):
|
||||||
docker.succeed(su_cmd("docker version"))
|
docker.succeed(su_cmd("docker version"))
|
||||||
|
Loading…
Reference in New Issue
Block a user