mirror of
https://github.com/fleetdm/fleet
synced 2026-05-17 14:08:25 +00:00
Addresses https://github.com/fleetdm/fleet/issues/10112 Improved test coverage, also fixed a bug related to vulnerability processing for mac office apps.
31 lines
646 B
Go
31 lines
646 B
Go
package macoffice
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/fleetdm/fleet/v4/pkg/nettest"
|
|
"github.com/fleetdm/fleet/v4/server/vulnerabilities/io"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestIntegrationSync(t *testing.T) {
|
|
nettest.Run(t)
|
|
|
|
vulnPath := t.TempDir()
|
|
ctx := context.Background()
|
|
|
|
err := SyncFromGithub(ctx, vulnPath)
|
|
require.NoError(t, err)
|
|
|
|
entries, err := os.ReadDir(vulnPath)
|
|
var filesInVulnPath []string
|
|
for _, e := range entries {
|
|
filesInVulnPath = append(filesInVulnPath, e.Name())
|
|
}
|
|
|
|
require.NoError(t, err)
|
|
require.Contains(t, filesInVulnPath, io.MacOfficeRelNotesFileName(time.Now()))
|
|
}
|