Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
base: 426c513c14c1
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: 814b38541f66
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jan 2, 2018

  1. test-driver: support testing user units

    It is quite complicated to test services using the test-driver when
    declaring user services with `systemd.user.services` such as many
    X11-based services like `xautolock.service`.
    
    This change adds an optional `$user` parameter to each systemd-related
    function in the test-driver and runs `systemctl --user` commands using
    `su -l $user -c ...` and sets the `XDG_RUNTIME_DIR` variable
    accordingly and a new function named `systemctl` which is able to run a
    systemd command with or without a specified user.
    
    The change can be confirmed with a simple VM declaration like this:
    
    ```
    import ./nixos/tests/make-test.nix ({ pkgs, lib }:
    
    with lib;
    
    {
      name = "systemd-user-test";
    
      nodes.machine = {
        imports = [ ./nixos/tests/common/user-account.nix ];
    
        services.xserver.enable = true;
        services.xserver.displayManager.auto.enable = true;
        services.xserver.displayManager.auto.user = "bob";
        services.xserver.xautolock.enable = true;
      };
    
      testScript = ''
        $machine->start;
        $machine->waitForX;
    
        $machine->waitForUnit("xautolock.service", "bob");
        $machine->stopJob("xautolock.service", "bob");
        $machine->startJob("xautolock.service", "bob");
        $machine->systemctl("list-jobs --no-pager", "bob");
        $machine->systemctl("show 'xautolock.service' --no-pager", "bob");
      '';
    })
    ```
    Ma27 committed Jan 2, 2018
    Copy the full SHA
    e538e00 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2018

  1. Merge pull request #32845 from Ma27/test-driver/allow-user-units

    test-driver: support testing user units
    Mic92 committed Jan 4, 2018
    Copy the full SHA
    814b385 View commit details
    Browse the repository at this point in the history