(t *testing.T)
| 621 | } |
| 622 | |
| 623 | func TestRequestInvalidFilename(t *testing.T) { |
| 624 | m := newTestModel() |
| 625 | rw := testutil.NewBlockingRW() |
| 626 | c := getRawConnection(NewConnection(c0ID, rw, &testutil.NoopRW{}, testutil.NoopCloser{}, m, new(mockedConnectionInfo), CompressionAlways, testKeyGen)) |
| 627 | c.Start() |
| 628 | defer closeAndWait(c, rw) |
| 629 | |
| 630 | c.inbox <- &bep.ClusterConfig{} |
| 631 | c.inbox <- &bep.Request{ |
| 632 | Id: 1, |
| 633 | Name: "../escape", |
| 634 | Size: 1024, |
| 635 | } |
| 636 | |
| 637 | select { |
| 638 | case <-c.dispatcherLoopStopped: |
| 639 | case <-time.After(time.Second): |
| 640 | t.Fatal("timed out before dispatcher loop terminated") |
| 641 | } |
| 642 | |
| 643 | err := m.closedError() |
| 644 | if err == nil { |
| 645 | t.Fatal("expected connection to be closed with an error") |
| 646 | } |
| 647 | if !strings.Contains(err.Error(), "protocol error") { |
| 648 | t.Errorf("expected a protocol error, got %v", err) |
| 649 | } |
| 650 | } |
| 651 | |
| 652 | func TestIndexIDString(t *testing.T) { |
| 653 | // Index ID is a 64 bit, zero padded hex integer. |
nothing calls this directly
no test coverage detected