Skip to content

Commit

Permalink
nixos/test-driver: Specify /bin/sh shell when running a bourne shell …
Browse files Browse the repository at this point in the history
…script as the user

(cherry picked from commit 751a270)

Reason: Back-porting this straight-forward fix is the best way to
allow tests affected by this user-shell problem to run in 20.03.
There isn't a great override point to apply just this fix.  Copy/pasting
testing-python.nix just to specify a new test-driver.py isn't great --
it would cut off receiving any other fixes in the testing infrastructure
until 20.09.  A 20.03 system using testing-python.nix from the unstable
branch and then passing 20.03's pkgs in to avoid getting unstable's
pkgs is quite a bit of configuration to expect from clients and seems
fragile against future changes in the unstable branch that expect pkgs
to be mostly in-sync with the test driver.  Both of these not-great
options leave a bunch of "TODO: Remove after 20.09" junk in clients'
configs & make that upgrade harder.
  • Loading branch information
chkno authored and Jon committed Jul 3, 2020
1 parent c2eca91 commit f761c14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nixos/lib/test-driver/test-driver.py
Expand Up @@ -367,7 +367,7 @@ def systemctl(self, q: str, user: Optional[str] = None) -> Tuple[int, str]:
q = q.replace("'", "\\'")
return self.execute(
(
"su -l {} -c "
"su -l {} --shell /bin/sh -c "
"$'XDG_RUNTIME_DIR=/run/user/`id -u` "
"systemctl --user {}'"
).format(user, q)
Expand Down

0 comments on commit f761c14

Please sign in to comment.