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

{

  machine =
    { config, pkgs, lib, ... }:
    { boot.kernelPackages = lib.mkIf latestKernel pkgs.linuxPackages_latest;
    };

  testScript =
    ''
      $machine->waitForUnit("default.target");
      $machine->screenshot("postboot");

      subtest "create user", sub {
          $machine->succeed("useradd -m alice");
          $machine->succeed("(echo foobar; echo foobar) | passwd alice");
      };

      # Check whether switching VTs works.
      subtest "virtual console switching", sub {
          $machine->sendKeys("alt-f2");
          $machine->waitUntilSucceeds("[ \$(fgconsole) = 2 ]");
          $machine->waitForUnit('getty@tty2.service');
      };

      # Log in as alice on a virtual console.<commit_msg>Make the login test a bit more robust<commit_after>import ./make-test.nix ({ pkgs, latestKernel ? false, ... }:

{

  machine =
    { config, pkgs, lib, ... }:
    { boot.kernelPackages = lib.mkIf latestKernel pkgs.linuxPackages_latest;
    };

  testScript =
    ''
      $machine->waitForUnit('multi-user.target');
      $machine->waitUntilSucceeds("pgrep -f 'agetty.*tty1'");
      $machine->screenshot("postboot");

      subtest "create user", sub {
          $machine->succeed("useradd -m alice");
          $machine->succeed("(echo foobar; echo foobar) | passwd alice");
      };

      # Check whether switching VTs works.
      subtest "virtual console switching", sub {
          $machine->fail("pgrep -f 'agetty.*tty2'");
          $machine->sendKeys("alt-f2");
          $machine->waitUntilSucceeds("[ \$(fgconsole) = 2 ]");
          $machine->waitForUnit('getty@tty2.service');
          $machine->waitUntilSucceeds("pgrep -f 'agetty.*tty2'");
      };

      # Log in as alice on a virtual console.
{'fraction_non_alphanumeric': 0.1617161716171617, 'fraction_numerical': 0.0049504950495049506, 'mean_word_length': 2.6163021868787277, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6920884', 'n_tokens_mistral': 599, 'n_tokens_neox': 572, 'n_words': 119}