diff options
author | zowoq <59103226+zowoq@users.noreply.github.com> | 2021-12-09 12:10:44 +1000 |
---|---|---|
committer | zowoq <59103226+zowoq@users.noreply.github.com> | 2021-12-09 13:03:16 +1000 |
commit | 79e66fce1c2b5a7de3e9a0e75b591ca9552a62ef (patch) | |
tree | ce67a92c6dee4e6a303db425d9eefccba438cbd9 /nixos/tests/podman/dnsname.nix | |
parent | ce82da442b5f66c26f71443e7567e1765953ea9d (diff) | |
download | nixpkgs-79e66fce1c2b5a7de3e9a0e75b591ca9552a62ef.tar nixpkgs-79e66fce1c2b5a7de3e9a0e75b591ca9552a62ef.tar.gz nixpkgs-79e66fce1c2b5a7de3e9a0e75b591ca9552a62ef.tar.bz2 nixpkgs-79e66fce1c2b5a7de3e9a0e75b591ca9552a62ef.tar.lz nixpkgs-79e66fce1c2b5a7de3e9a0e75b591ca9552a62ef.tar.xz nixpkgs-79e66fce1c2b5a7de3e9a0e75b591ca9552a62ef.tar.zst nixpkgs-79e66fce1c2b5a7de3e9a0e75b591ca9552a62ef.zip |
nixos/podman: sort files into directories
Makes codeowners, git history, etc. a bit simpler now that podman has expanded beyond the original single file module and test.
Diffstat (limited to 'nixos/tests/podman/dnsname.nix')
-rw-r--r-- | nixos/tests/podman/dnsname.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/nixos/tests/podman/dnsname.nix b/nixos/tests/podman/dnsname.nix new file mode 100644 index 00000000000..3768ae79e06 --- /dev/null +++ b/nixos/tests/podman/dnsname.nix @@ -0,0 +1,42 @@ +import ../make-test-python.nix ( + { pkgs, lib, ... }: + let + inherit (pkgs) writeTextDir python3 curl; + webroot = writeTextDir "index.html" "<h1>Hi</h1>"; + in + { + name = "podman-dnsname"; + meta = { + maintainers = with lib.maintainers; [ roberth ] ++ lib.teams.podman.members; + }; + + nodes = { + podman = { pkgs, ... }: { + virtualisation.podman.enable = true; + virtualisation.podman.defaultNetwork.dnsname.enable = true; + }; + }; + + testScript = '' + podman.wait_for_unit("sockets.target") + + with subtest("DNS works"): # also tests inter-container tcp routing + podman.succeed("tar cv --files-from /dev/null | podman import - scratchimg") + podman.succeed( + "podman run -d --name=webserver -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin -w ${webroot} scratchimg ${python3}/bin/python -m http.server 8000" + ) + podman.succeed("podman ps | grep webserver") + podman.succeed(""" + 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 ${curl}/bin/curl http://webserver:8000 >/dev/console \ + && exit 0 + sleep 0.5 + done + exit 1 + """) + podman.succeed("podman stop webserver") + podman.succeed("podman rm webserver") + + ''; + } +) |