From 4d26596c494ff4151e229898d0d9a0b16a2381cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 2 Jul 2024 21:17:29 +0200 Subject: [PATCH] pam/integration-tests/cli: Do not build the module and pam clients for each test Since commit d1a75d811, for the cli tests we call prepareClientTest() for each test in order to get the client folder, however this also implies building the test client, the module and the exec client for each test even though this is not needed, since we can share those binaries. So just call this once in the main test. --- pam/integration-tests/cli_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pam/integration-tests/cli_test.go b/pam/integration-tests/cli_test.go index 577a1df71..c95efc409 100644 --- a/pam/integration-tests/cli_test.go +++ b/pam/integration-tests/cli_test.go @@ -28,6 +28,9 @@ func TestCLIAuthenticate(t *testing.T) { currentDir, err := os.Getwd() require.NoError(t, err, "Setup: Could not get current directory for the tests") + clientPath := t.TempDir() + cliEnv := prepareClientTest(t, clientPath) + tests := map[string]struct { tape string @@ -71,8 +74,10 @@ func TestCLIAuthenticate(t *testing.T) { t.Parallel() outDir := t.TempDir() + err := os.Symlink(filepath.Join(clientPath, "pam_authd"), + filepath.Join(outDir, "pam_authd")) + require.NoError(t, err, "Setup: symlinking the pam client") - cliEnv := prepareClientTest(t, outDir) cliLog := prepareCLILogging(t) t.Cleanup(func() { saveArtifactsForDebug(t, []string{