(t *testing.T)
| 599 | } |
| 600 | |
| 601 | func TestStaticFIFO(t *testing.T) { |
| 602 | tdir := t.TempDir() |
| 603 | |
| 604 | fifoPath := filepath.Join(tdir, "fifo") |
| 605 | err := osutil.Mkfifo(fifoPath, 0660) |
| 606 | if err == osutil.ErrNotSupported { |
| 607 | t.SkipNow() |
| 608 | } |
| 609 | if err != nil { |
| 610 | t.Fatalf("osutil.Mkfifo(): %v", err) |
| 611 | } |
| 612 | |
| 613 | fi, err := os.Lstat(fifoPath) |
| 614 | if err != nil { |
| 615 | t.Fatalf("os.Lstat(): %v", err) |
| 616 | } |
| 617 | |
| 618 | bb := NewCommonFileMap(fifoPath, fi) |
| 619 | bb.SetType(TypeFIFO) |
| 620 | bb.SetFileName(fifoPath) |
| 621 | blob := bb.Blob() |
| 622 | t.Logf("Got JSON for fifo: %s\n", blob.JSON()) |
| 623 | |
| 624 | sf, ok := blob.AsStaticFile() |
| 625 | if !ok { |
| 626 | t.Fatalf("Blob.AsStaticFile(): Expected true, got false") |
| 627 | } |
| 628 | _, ok = sf.AsStaticFIFO() |
| 629 | if !ok { |
| 630 | t.Fatalf("StaticFile.AsStaticFIFO(): Expected true, got false") |
| 631 | } |
| 632 | } |
| 633 | |
| 634 | func TestStaticSocket(t *testing.T) { |
| 635 | tdir := t.TempDir() |
nothing calls this directly
no test coverage detected