refactor: modularize audit and harden build validation

This commit is contained in:
Mikhail Chusavitin
2026-08-31 21:22:16 +03:00
parent bb22ccfafe
commit ac4bc0b2b7
78 changed files with 13598 additions and 13130 deletions
+12 -1
View File
@@ -216,7 +216,7 @@ func (f fakeSAT) RunNvidiaPulseTestPack(_ context.Context, baseDir string, durat
return f.runNvidiaFn(baseDir)
}
func (f fakeSAT) RunNvidiaBandwidthPack(_ context.Context, baseDir string, gpuIndices []int, _ func(string)) (string, error) {
func (f fakeSAT) RunNvidiaBandwidthPack(_ context.Context, baseDir string, gpuIndices []int, _ bool, _ func(string)) (string, error) {
if f.runNvidiaBandwidthFn != nil {
return f.runNvidiaBandwidthFn(baseDir, gpuIndices)
}
@@ -287,6 +287,10 @@ func (f fakeSAT) RunTPMValidationPack(_ context.Context, _ string, _ func(string
return "", nil
}
func (f fakeSAT) TPMPresent() bool { return true }
func (f fakeSAT) PhysicalGPUVendors() (bool, bool) { return false, false }
func (f fakeSAT) RunNvidiaConfigCheckPack(_ context.Context, baseDir string, _ func(string)) (string, error) {
return "", nil
}
@@ -725,6 +729,7 @@ func TestActionResultsUseFallbackBody(t *testing.T) {
func TestExportSupportBundleResultMentionsUnmountedUSB(t *testing.T) {
tmp := t.TempDir()
t.Setenv("TMPDIR", tmp)
oldExportDir := DefaultExportDir
DefaultExportDir = tmp
t.Cleanup(func() { DefaultExportDir = oldExportDir })
@@ -761,6 +766,7 @@ func TestExportSupportBundleResultMentionsUnmountedUSB(t *testing.T) {
func TestExportSupportBundleResultDoesNotPretendSuccessOnError(t *testing.T) {
tmp := t.TempDir()
t.Setenv("TMPDIR", tmp)
oldExportDir := DefaultExportDir
DefaultExportDir = tmp
t.Cleanup(func() { DefaultExportDir = oldExportDir })
@@ -939,6 +945,10 @@ func TestApplySATOverlayFiltersIgnoredLegacyDevices(t *testing.T) {
func TestBuildSupportBundleIncludesExportDirContents(t *testing.T) {
tmp := t.TempDir()
// Isolate os.TempDir() so a concurrent support-bundle test (this or the
// webui endpoint test, in another package running in parallel) cannot
// collide on the staging tree / archive path.
t.Setenv("TMPDIR", tmp)
exportDir := filepath.Join(tmp, "export")
if err := os.MkdirAll(filepath.Join(exportDir, "bee-sat", "memory-run"), 0755); err != nil {
t.Fatal(err)
@@ -1065,6 +1075,7 @@ func TestBuildSupportBundleIncludesExportDirContents(t *testing.T) {
// too.
func TestBuildSupportBundleIncludesOrientationDocs(t *testing.T) {
tmp := t.TempDir()
t.Setenv("TMPDIR", tmp)
exportDir := filepath.Join(tmp, "export")
if err := os.MkdirAll(exportDir, 0755); err != nil {
t.Fatal(err)