Skip to content

Commit 8c108d7

Browse files
committed
pam/integration-tests: Use a shared authd instance only in race mode 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
1 parent 095bb32 commit 8c108d7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: pam/integration-tests/helpers_test.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ func runAuthd(t *testing.T, gpasswdOutput, groupsFile string, currentUserAsRoot
8181
func sharedAuthd(t *testing.T) (socketPath string, gpasswdFile string) {
8282
t.Helper()
8383

84-
if os.Getenv("AUTHD_TESTS_USE_INDIVIDUAL_AUTHD_INSTANCES") != "" {
84+
sharedInstance := testutils.IsRace()
85+
if s, err := strconv.ParseBool(os.Getenv("AUTHD_TESTS_USE_SHARED_AUTHD_INSTANCES")); err == nil {
86+
sharedInstance = s
87+
}
88+
89+
if !sharedInstance {
8590
gPasswd := filepath.Join(t.TempDir(), "gpasswd.output")
8691
groups := filepath.Join(testutils.TestFamilyPath(t), "gpasswd.group")
8792
socket, cleanup, _ := runAuthdForTesting(t, gPasswd, groups, true)

0 commit comments

Comments
 (0)