@@ -15,6 +15,7 @@ import (
1515 "github.com/microsoft/azure-linux-dev-tools/internal/projectconfig"
1616 "github.com/microsoft/azure-linux-dev-tools/internal/providers/sourceproviders"
1717 "github.com/microsoft/azure-linux-dev-tools/internal/providers/sourceproviders/sourceproviders_test"
18+ "github.com/microsoft/azure-linux-dev-tools/internal/utils/fileperms"
1819 "github.com/microsoft/azure-linux-dev-tools/internal/utils/fileutils"
1920 "github.com/stretchr/testify/assert"
2021 "github.com/stretchr/testify/require"
@@ -60,7 +61,7 @@ func TestPrepareSources_Success(t *testing.T) {
6061 sourceManager .EXPECT ().FetchComponent (gomock .Any (), component , testOutputDir , gomock .Any ()).DoAndReturn (
6162 func (_ interface {}, _ interface {}, outputDir string , _ ... sourceproviders.FetchComponentOption ) error {
6263 // Create the expected spec file.
63- return fileutils .WriteFile (ctx .FS (), outputSpecPath , []byte ("# test spec" ), 0o644 )
64+ return fileutils .WriteFile (ctx .FS (), outputSpecPath , []byte ("# test spec" ), fileperms . PublicFile )
6465 },
6566 )
6667
@@ -184,7 +185,7 @@ func TestPrepareSources_WritesMacrosFile(t *testing.T) {
184185 // Create the expected spec file.
185186 specPath := filepath .Join (outputDir , "my-package.spec" )
186187
187- return fileutils .WriteFile (ctx .FS (), specPath , []byte ("# test spec" ), 0o644 )
188+ return fileutils .WriteFile (ctx .FS (), specPath , []byte ("# test spec" ), fileperms . PublicFile )
188189 },
189190 )
190191
@@ -441,7 +442,7 @@ Summary: Test component
441442make test
442443`
443444
444- return fileutils .WriteFile (ctx .FS (), outputSpecPath , []byte (specContent ), 0o644 )
445+ return fileutils .WriteFile (ctx .FS (), outputSpecPath , []byte (specContent ), fileperms . PublicFile )
445446 },
446447 )
447448
@@ -498,7 +499,7 @@ Summary: Test component
498499make test
499500`
500501
501- return fileutils .WriteFile (ctx .FS (), outputSpecPath , []byte (specContent ), 0o644 )
502+ return fileutils .WriteFile (ctx .FS (), outputSpecPath , []byte (specContent ), fileperms . PublicFile )
502503 },
503504 )
504505
@@ -536,7 +537,7 @@ func TestDiffSources_NoOverlays(t *testing.T) {
536537 func (_ interface {}, _ interface {}, outputDir string , _ ... sourceproviders.FetchComponentOption ) error {
537538 specPath := filepath .Join (outputDir , "test-component.spec" )
538539
539- return fileutils .WriteFile (ctx .FS (), specPath , []byte ("Name: test-component\n Version: 1.0\n " ), 0o644 )
540+ return fileutils .WriteFile (ctx .FS (), specPath , []byte ("Name: test-component\n Version: 1.0\n " ), fileperms . PublicFile )
540541 },
541542 )
542543
@@ -579,7 +580,7 @@ func TestDiffSources_WithOverlays(t *testing.T) {
579580 func (_ interface {}, _ interface {}, outputDir string , _ ... sourceproviders.FetchComponentOption ) error {
580581 specPath := filepath .Join (outputDir , "test-component.spec" )
581582
582- return fileutils .WriteFile (ctx .FS (), specPath , []byte ("Name: test-component\n Version: 1.0\n " ), 0o644 )
583+ return fileutils .WriteFile (ctx .FS (), specPath , []byte ("Name: test-component\n Version: 1.0\n " ), fileperms . PublicFile )
583584 },
584585 )
585586
0 commit comments