mirror of
https://github.com/NixOS/nix.git
synced 2025-02-01 01:23:06 +00:00
test: Add hydraJobs.tests.functional_symlinked-home
(cherry picked from commit 628c11d237
)
This commit is contained in:
parent
3fbcd8d7ba
commit
7c4e2fdfd7
@ -152,6 +152,8 @@ in
|
|||||||
|
|
||||||
functional_root = runNixOSTestFor "x86_64-linux" ./functional/as-root.nix;
|
functional_root = runNixOSTestFor "x86_64-linux" ./functional/as-root.nix;
|
||||||
|
|
||||||
|
functional_symlinked-home = runNixOSTestFor "x86_64-linux" ./functional/symlinked-home.nix;
|
||||||
|
|
||||||
user-sandboxing = runNixOSTestFor "x86_64-linux" ./user-sandboxing;
|
user-sandboxing = runNixOSTestFor "x86_64-linux" ./user-sandboxing;
|
||||||
|
|
||||||
s3-binary-cache-store = runNixOSTestFor "x86_64-linux" ./s3-binary-cache-store.nix;
|
s3-binary-cache-store = runNixOSTestFor "x86_64-linux" ./s3-binary-cache-store.nix;
|
||||||
|
36
tests/nixos/functional/symlinked-home.nix
Normal file
36
tests/nixos/functional/symlinked-home.nix
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/**
|
||||||
|
This test runs the functional tests on a NixOS system where the home directory
|
||||||
|
is symlinked to another location.
|
||||||
|
|
||||||
|
The purpose of this test is to find cases where Nix uses low-level operations
|
||||||
|
that don't support symlinks on paths that include them.
|
||||||
|
|
||||||
|
It is not a substitute for more intricate, use case-specific tests, but helps
|
||||||
|
catch common issues.
|
||||||
|
*/
|
||||||
|
# TODO: add symlinked tmpdir
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
name = "functional-tests-on-nixos_user_symlinked-home";
|
||||||
|
|
||||||
|
imports = [ ./common.nix ];
|
||||||
|
|
||||||
|
nodes.machine = {
|
||||||
|
users.users.alice = { isNormalUser = true; };
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
machine.wait_for_unit("multi-user.target")
|
||||||
|
with subtest("prepare symlinked home"):
|
||||||
|
machine.succeed("""
|
||||||
|
(
|
||||||
|
set -x
|
||||||
|
mv /home/alice /home/alice.real
|
||||||
|
ln -s alice.real /home/alice
|
||||||
|
) 1>&2
|
||||||
|
""")
|
||||||
|
machine.succeed("""
|
||||||
|
su --login --command "run-test-suite" alice >&2
|
||||||
|
""")
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user