Loading
test: clean up read-only Go module cache directories
Description
Fix test cleanup when a Go subprocess extracts a FIPS snapshot into the temporary module cache with read-only directories. These directories can
cause t.TempDir cleanup to fail with permission denied.
Make the module cache directories writable before t.TempDir removes them.
How has this been tested?
Built the glab 1.131.0 RPM package with this patch and its test suite enabled on Fedora, EL9, and EL10. All three builds passed.
Before the patch, EL9 and EL10 builds failed during cleanup of tests in internal/dependencyfirewall/pm. The EL9 build used Red Hat Go 1.27.3 with GOFIPS140=certified; the failures reported permission denied while removing files under golang.org/fips140 in the temporary module
cache.