<commit_before>import ./make-test.nix ({ pkgs, ... }:

{
  name = "atd";
  meta = with pkgs.stdenv.lib.maintainers; {
    maintainers = [ bjornfor ];
  };

  machine =
    { ... }:
    { services.atd.enable = true;
      users.users.alice = { isNormalUser = true; };
    };

  # "at" has a resolution of 1 minute
  testScript = ''
    startAll;

    $machine->fail("test -f ~root/at-1");
    $machine->fail("test -f ~alice/at-1");

    $machine->succeed("echo 'touch ~root/at-1' | at now+1min");
    $machine->succeed("su - alice -c \"echo 'touch at-1' | at now+1min\"");

    $machine->succeed("sleep 1.5m");

    $machine->succeed("test -f ~root/at-1");<commit_msg>nixos/tests/atd: wait for atd to start<commit_after>import ./make-test.nix ({ pkgs, ... }:

{
  name = "atd";
  meta = with pkgs.stdenv.lib.maintainers; {
    maintainers = [ bjornfor ];
  };

  machine =
    { ... }:
    { services.atd.enable = true;
      users.users.alice = { isNormalUser = true; };
    };

  # "at" has a resolution of 1 minute
  testScript = ''
    startAll;

    $machine->waitForUnit('atd.service'); # wait for atd to start
    $machine->fail("test -f ~root/at-1");
    $machine->fail("test -f ~alice/at-1");

    $machine->succeed("echo 'touch ~root/at-1' | at now+1min");
    $machine->succeed("su - alice -c \"echo 'touch at-1' | at now+1min\"");

    $machine->succeed("sleep 1.5m");

    $machine->succeed("test -f ~root/at-1");
{'fraction_non_alphanumeric': 0.2056140350877193, 'fraction_numerical': 0.014035087719298246, 'mean_word_length': 2.6470588235294117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, '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': '4781302', 'n_tokens_mistral': 572, 'n_tokens_neox': 538, 'n_words': 108}