Skip to content

Commit

Permalink
pam/integration-tests: Use a shared authd instance only in race mode …
Browse files Browse the repository at this point in the history
…by default

In case, the env variable AUTHD_TESTS_USE_SHARED_AUTHD_INSTANCES can be
set to force it even in non-race test runs
  • Loading branch information
3v1n0 committed Dec 20, 2024
1 parent 5c678ce commit efe85f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pam/integration-tests/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ func runAuthd(t *testing.T, gpasswdOutput, groupsFile string, currentUserAsRoot
func sharedAuthd(t *testing.T) (socketPath string, gpasswdFile string) {
t.Helper()

if os.Getenv("AUTHD_TESTS_USE_INDIVIDUAL_AUTHD_INSTANCES") != "" {
sharedInstance := testutils.IsRace()
if s, err := strconv.ParseBool(os.Getenv("AUTHD_TESTS_USE_SHARED_AUTHD_INSTANCES")); err == nil {
sharedInstance = s
}

if !sharedInstance {
gPasswd := filepath.Join(t.TempDir(), "gpasswd.output")
groups := filepath.Join(testutils.TestFamilyPath(t), "gpasswd.group")
socket, cleanup, _ := runAuthdForTesting(t, gPasswd, groups, true)
Expand Down

0 comments on commit efe85f9

Please sign in to comment.