Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyOHart committed Oct 22, 2024
1 parent 34645ea commit b52a65c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions apps/managedidentity/managedidentity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,19 @@ func TestAzureArcReturnsWhenHimdsFound(t *testing.T) {
t.Run(string(testCase.source), func(t *testing.T) {
unsetEnvVars(t)

// Get system dependent mock file path
mockFilePath := getAzureArcFilePath(runtime.GOOS)

// Create the mock himds file
createMockFile(t, mockFilePath, 1024)

// Ensure file is deleted after test
defer func() {
if err := os.Remove(mockFilePath); err != nil {
t.Fatalf("failed to delete mock file: %v", err)
}
}()

actualSource, err := GetSource(testCase.miType)
if err != nil {
t.Fatalf("error while getting source: %s", err.Error())
Expand Down

0 comments on commit b52a65c

Please sign in to comment.