Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

nixosTests.zsh-history: migrate to runTest

Part Of #386873

+33 -35
+1 -1
nixos/tests/all-tests.nix
··· 1319 1319 zookeeper = handleTest ./zookeeper.nix {}; 1320 1320 zram-generator = handleTest ./zram-generator.nix {}; 1321 1321 zrepl = handleTest ./zrepl.nix {}; 1322 - zsh-history = handleTest ./zsh-history.nix {}; 1322 + zsh-history = runTest ./zsh-history.nix; 1323 1323 zwave-js = runTest ./zwave-js.nix; 1324 1324 zwave-js-ui = runTest ./zwave-js-ui.nix; 1325 1325 }
+32 -34
nixos/tests/zsh-history.nix
··· 1 - import ./make-test-python.nix ( 2 - { pkgs, ... }: 3 - { 4 - name = "zsh-history"; 5 - meta = with pkgs.lib.maintainers; { 6 - maintainers = [ ]; 7 - }; 1 + { pkgs, ... }: 2 + { 3 + name = "zsh-history"; 4 + meta = with pkgs.lib.maintainers; { 5 + maintainers = [ ]; 6 + }; 8 7 9 - nodes.default = 10 - { ... }: 11 - { 12 - programs = { 13 - zsh.enable = true; 14 - }; 15 - environment.systemPackages = [ pkgs.zsh-history ]; 16 - programs.zsh.interactiveShellInit = '' 17 - source ${pkgs.zsh-history.out}/share/zsh/init.zsh 18 - ''; 19 - users.users.root.shell = "${pkgs.zsh}/bin/zsh"; 8 + nodes.default = 9 + { ... }: 10 + { 11 + programs = { 12 + zsh.enable = true; 20 13 }; 14 + environment.systemPackages = [ pkgs.zsh-history ]; 15 + programs.zsh.interactiveShellInit = '' 16 + source ${pkgs.zsh-history.out}/share/zsh/init.zsh 17 + ''; 18 + users.users.root.shell = "${pkgs.zsh}/bin/zsh"; 19 + }; 21 20 22 - testScript = '' 23 - start_all() 24 - default.wait_for_unit("multi-user.target") 25 - default.wait_until_succeeds("pgrep -f 'agetty.*tty1'") 21 + testScript = '' 22 + start_all() 23 + default.wait_for_unit("multi-user.target") 24 + default.wait_until_succeeds("pgrep -f 'agetty.*tty1'") 26 25 27 - # Login 28 - default.wait_until_tty_matches("1", "login: ") 29 - default.send_chars("root\n") 30 - default.wait_until_tty_matches("1", r"\nroot@default\b") 26 + # Login 27 + default.wait_until_tty_matches("1", "login: ") 28 + default.send_chars("root\n") 29 + default.wait_until_tty_matches("1", r"\nroot@default\b") 31 30 32 - # Generate some history 33 - default.send_chars("echo foobar\n") 34 - default.wait_until_tty_matches("1", "foobar") 31 + # Generate some history 32 + default.send_chars("echo foobar\n") 33 + default.wait_until_tty_matches("1", "foobar") 35 34 36 - # Ensure that command was recorded in history 37 - default.succeed("/run/current-system/sw/bin/history list | grep -q foobar") 38 - ''; 39 - } 40 - ) 35 + # Ensure that command was recorded in history 36 + default.succeed("/run/current-system/sw/bin/history list | grep -q foobar") 37 + ''; 38 + }