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.maintainers = lib.teams.serokell.members
15 ++ (with lib.maintainers; [ adisbladis benley mkaito ]);
16
17 nodes = {
18 ${backend} = { pkgs, ... }: {
19 virtualisation.oci-containers = {
20 inherit backend;
21 containers.nginx = {
22 image = "nginx-container";
23 imageFile = pkgs.dockerTools.examples.nginx;
24 ports = ["8181:80"];
25 };
26 };
27 };
28 };
29
30 testScript = ''
31 start_all()
32 ${backend}.wait_for_unit("${backend}-nginx.service")
33 ${backend}.wait_for_open_port(8181)
34 ${backend}.wait_until_succeeds("curl -f http://localhost:8181 | grep Hello")
35 '';
36 };
37
38in
39lib.foldl' (attrs: backend: attrs // { ${backend} = mkOCITest backend; }) {} [
40 "docker"
41 "podman"
42]