Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
nixos/test-driver: Specify /bin/sh shell when running a bourne shell script as the user #87414
Motivation for this change
The test harness provides the commands it wishes to run in Bourne syntax. This fails if the user uses a different shell. For example, with fish:
…script as the user The test harness provides the commands it wishes to run in Bourne syntax. This fails if the user uses a different shell. For example, with fish: machine.wait_for_unit("graphical-session.target", "alice") machine # fish: Unsupported use of '='. To run '-u`' with a modified environment, please use 'env XDG_RUNTIME_DIR=/run/user/`id -u`…' machine # XDG_RUNTIME_DIR=/run/user/`id -u` systemctl --user --no-pager show "graphical-session.target" machine # ^ machine # [ 16.329957] su: pam_unix(su:session): session closed for user alice error: retrieving systemctl info for unit "graphical-session.target" under user "alice" failed with exit code 127
@7c6f434c this `/bin/sh` is only used as a shell for su, to then execute `systemctl --user` in a non-interactive fashion.
No, the question is not whether this uses interactivity, the question is whether this can happen while the user tries to use something like interactive REPL for debugging tests.
So far, the `Machine.execute` method (which is used under the hood) isn't able to be used interactively, also when using the interactive ptpython REPL.
Oh, my fault, `/bin/sh` is inside the VM, not outside. Right, then `/bin/sh` and the `Machine.execute` environment have to be in sync inside VM, even if a switch is being tested.