Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: Configure the login shell of the backdoor service #71083

Closed
wants to merge 1 commit into from

Conversation

@kampka
Copy link
Contributor

@kampka kampka commented Oct 13, 2019

This change allows tests to pass a specific login shell to the backdoor
service. This is relevant for tests of modules that rely on specific
login / interactive shell behavior that is hard to replicate otherwise.

Motivation for this change

While trying to write a module and a test for #67670 I noticed it was quite difficult to emulate the desired behavior of a specific interactive login shell in a test environment as the backdoor is hardwired to /bin/sh.
This patch contains the approach I came up with to remedy that as it allows the test author to define the login shell used by the backdoor service himself.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

This change allows tests to pass a specific login shell to the backdoor
service. This is relevant for tests of modules that rely on specific
login / interactive shell behavior that is hard to replicate otherwise.
@kampka kampka force-pushed the kampka:test-backdoor-shell branch from 96029c0 to c5dcc34 Oct 13, 2019
@nixos-discourse
Copy link

@nixos-discourse nixos-discourse commented Nov 1, 2019

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/74

@JohnAZoidberg
Copy link
Member

@JohnAZoidberg JohnAZoidberg commented Nov 7, 2019

Zillions of conflicts, because many(all?) tests are being rewritten to Python. Should be trivial to rebase for you, though.

@kampka
Copy link
Contributor Author

@kampka kampka commented Nov 7, 2019

Zillions of conflicts, because many(all?) tests are being rewritten to Python. Should be trivial to rebase for you, though.

Not surprising. Before I start rebasing everything, I would like to get some comments on the actual change. Since this change is quite big, I have no interest in touching it too often.

@JohnAZoidberg
Copy link
Member

@JohnAZoidberg JohnAZoidberg commented Nov 7, 2019

It's only big because you touch all of the tests, the only real changes are in:

  • nixos/lib/build-vms.nix
  • nixos/lib/testing.nix
  • nixos/modules/testing/test-instrumentation.nix

Right?

@kampka
Copy link
Contributor Author

@kampka kampka commented Nov 7, 2019

nixos/lib/build-vms.nix
nixos/lib/testing.nix 
nixos/modules/testing/test-instrumentation.nix
nixos/tests/boot.nix
nixos/tests/make-test.nix 

Those are all files that contain non-tivial (?) changes I think.

@kampka kampka closed this Dec 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.