From 33d515b597cf96f62a67342a6741b5b557387ddb Mon Sep 17 00:00:00 2001 From: Daniel Githinji Date: Thu, 15 Aug 2024 00:10:04 +0300 Subject: [PATCH] Added a 'testSetPath' test in dockerfile_windows_test.go. The test checks whether the path in a Windows container image can be set or not. Signed-off-by: Daniel Githinji path.txt +`) + dir := integration.Tmpdir( + t, + fstest.CreateFile("Dockerfile", dockerfile, 0600), + ) + c, err := client.New(sb.Context(), sb.Address()) + require.NoError(t, err) + defer c.Close() + + destDir := t.TempDir() + _, err = f.Solve(sb.Context(), c, client.SolveOpt{ + Exports: []client.ExportEntry{ + { + Type: client.ExporterLocal, + OutputDir: destDir, + }, + }, + LocalMounts: map[string]fsutil.FS{ + dockerui.DefaultLocalNameDockerfile: dir, + dockerui.DefaultLocalNameContext: dir, + }, + }, nil) + require.NoError(t, err) + + dt, err := os.ReadFile(filepath.Join(destDir, "path.txt")) + require.NoError(t, err) + + envStr := string(dt) + require.Contains(t, envStr, "C:\\NewPath1;C:\\NewPath2") +}