diff --git a/e2e/actions/actions.go b/e2e/actions/actions.go index d2168d69f1..f3c0fa3fb3 100644 --- a/e2e/actions/actions.go +++ b/e2e/actions/actions.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2023, Sylabs Inc. All rights reserved. +// Copyright (c) 2019-2024, Sylabs Inc. All rights reserved. // Copyright (c) Contributors to the Apptainer project, established as // Apptainer a Series of LF Projects LLC. // This software is licensed under a 3-clause BSD license. Please consult the @@ -2956,6 +2956,7 @@ func E2ETests(env e2e.TestEnv) testhelper.Tests { "issue 5690": c.issue5690, // https://github.com/sylabs/singularity/issues/5690 "issue 1950": c.issue1950, // https://github.com/sylabs/singularity/issues/1950 "issue 2690": c.issue2690, // https://github.com/sylabs/singularity/issues/2690 + "issue 1848": c.issue1848, // https://github.com/apptainer/apptainer/issues/1848 "network": c.actionNetwork, // test basic networking "netns-path": c.actionNetnsPath, // test netns joining "binds": c.actionBinds, // test various binds with --bind and --mount diff --git a/e2e/actions/regressions.go b/e2e/actions/regressions.go index 89966c6c04..e2e5357665 100644 --- a/e2e/actions/regressions.go +++ b/e2e/actions/regressions.go @@ -1,4 +1,6 @@ -// Copyright (c) 2020, Sylabs Inc. All rights reserved. +// Copyright (c) 2020-2024, Sylabs Inc. All rights reserved. +// Copyright (c) Contributors to the Apptainer project, established as +// Apptainer a Series of LF Projects LLC. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE.md file distributed with the sources of this project regarding your // rights to use or distribute this software. @@ -912,3 +914,27 @@ func (c actionTests) issue3129(t *testing.T) { e2e.ExpectExit(0), ) } + +// Verify the generated host user data appended to /etc/passwd +func (c actionTests) issue1848(t *testing.T) { + e2e.EnsureImage(t, c.env) + user := e2e.UserProfile.HostUser(t) + expectedPasswdLine := fmt.Sprintf("%s:x:%d:%d:%s:%s:%s", + user.Name, + user.UID, + user.GID, + user.Gecos, + user.Dir, + user.Shell, + ) + + c.env.RunSingularity( + t, + e2e.WithProfile(e2e.UserProfile), + e2e.WithCommand("exec"), + e2e.WithArgs(c.env.ImagePath, "tail", "-1", "/etc/passwd"), + e2e.ExpectExit(0, + e2e.ExpectOutput(e2e.ExactMatch, expectedPasswdLine), + ), + ) +}