Files
logpile/internal/server/file_support_test.go
T

26 lines
753 B
Go

package server
import "testing"
func TestIsSupportedConvertFileName_AcceptsNvidiaBugReportGzip(t *testing.T) {
if !isSupportedConvertFileName("nvidia-bug-report-1651124000923.log.gz") {
t.Fatalf("expected .log.gz bug-report to be supported")
}
}
func TestIsSupportedConvertFileName_AcceptsLenovoFFDC(t *testing.T) {
for _, name := range []string{"ffdc.tzz", "FFDC.TZZ"} {
if !isSupportedConvertFileName(name) {
t.Fatalf("expected Lenovo FFDC %s to be supported", name)
}
}
}
func TestAnalyzeUploadedFile_RejectsUnsupportedExtension(t *testing.T) {
s := &Server{}
_, _, _, err := s.analyzeUploadedFile("unsupported.bin", "application/octet-stream", []byte("abc"))
if err == nil {
t.Fatalf("expected unsupported archive error")
}
}