<commit_before>import ./make-test-python.nix ({ pkgs, ... }: {
  name = "service-runner";
  meta = with pkgs.stdenv.lib.maintainers; {
    maintainers = [ roberth ];
  };

  nodes = {
    machine = { pkgs, lib, ... }: {
      services.nginx.enable = true;
      services.nginx.virtualHosts.machine.root = pkgs.runCommand "webroot" {} ''
        mkdir $out
        echo 'yay' >$out/index.html
      '';
      systemd.services.nginx.enable = false;
    };

  };

  testScript = { nodes, ... }: ''
    url = "http://localhost/index.html"

    with subtest("check systemd.services.nginx.runner"):
        machine.fail(f"curl {url}")
        machine.succeed(
            """
            mkdir -p /run/nginx /var/log/nginx /var/cache/nginx
            ${nodes.machine.config.systemd.services.nginx.runner} &
            echo $!>my-nginx.pid
            """
        )
        machine.wait_for_open_port(80)
        machine.succeed(f"curl {url}")<commit_msg>nixos/tests/service-runner: Use curl --fail<commit_after>import ./make-test-python.nix ({ pkgs, ... }: {
  name = "service-runner";
  meta = with pkgs.stdenv.lib.maintainers; {
    maintainers = [ roberth ];
  };

  nodes = {
    machine = { pkgs, lib, ... }: {
      services.nginx.enable = true;
      services.nginx.virtualHosts.machine.root = pkgs.runCommand "webroot" {} ''
        mkdir $out
        echo 'yay' >$out/index.html
      '';
      systemd.services.nginx.enable = false;
    };

  };

  testScript = { nodes, ... }: ''
    url = "http://localhost/index.html"

    with subtest("check systemd.services.nginx.runner"):
        machine.fail(f"curl {url}")
        machine.succeed(
            """
            mkdir -p /run/nginx /var/log/nginx /var/cache/nginx
            ${nodes.machine.config.systemd.services.nginx.runner} &
            echo $!>my-nginx.pid
            """
        )
        machine.wait_for_open_port(80)
        machine.succeed(f"curl -f {url}")
{'fraction_non_alphanumeric': 0.1660631143300569, 'fraction_numerical': 0.0020693222969477496, 'mean_word_length': 2.0077760497667185, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3492712', 'n_tokens_mistral': 682, 'n_tokens_neox': 654, 'n_words': 97}