at 23.05-pre 1.1 kB view raw
1{ system ? builtins.currentSystem 2, config ? {} 3, pkgs ? import ../.. { inherit system config; } 4, lib ? pkgs.lib 5}: 6 7let 8 9 inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest; 10 11 mkOCITest = backend: makeTest { 12 name = "oci-containers-${backend}"; 13 14 meta = { 15 maintainers = with lib.maintainers; [ adisbladis benley mkaito ] ++ lib.teams.serokell.members; 16 }; 17 18 nodes = { 19 ${backend} = { pkgs, ... }: { 20 virtualisation.oci-containers = { 21 inherit backend; 22 containers.nginx = { 23 image = "nginx-container"; 24 imageFile = pkgs.dockerTools.examples.nginx; 25 ports = ["8181:80"]; 26 }; 27 }; 28 }; 29 }; 30 31 testScript = '' 32 start_all() 33 ${backend}.wait_for_unit("${backend}-nginx.service") 34 ${backend}.wait_for_open_port(8181) 35 ${backend}.wait_until_succeeds("curl -f http://localhost:8181 | grep Hello") 36 ''; 37 }; 38 39in 40lib.foldl' (attrs: backend: attrs // { ${backend} = mkOCITest backend; }) {} [ 41 "docker" 42 "podman" 43]