From 10f96c99d4c08908e9996ff84ac6956d607be7b8 Mon Sep 17 00:00:00 2001 From: mpl Date: Thu, 12 May 2016 02:02:24 +0200 Subject: [PATCH] pkg/test/integration: share large file test We would have needed a sharing test with a file large enough to have several parts to detect the bugs introduced in rev 383f118ccf6ae6e082dc76f5c3b3647614a33684 and fixed in rev ac4f053414b1e740de666c5ce828e3b0f6de3817 The sharing test introduced in this change is such a test. Fixes #527 Change-Id: I7cd8a0b9b8e2acf794723f30ae38bd97d9eced80 --- pkg/test/integration/share_test.go | 6 ++++++ pkg/test/world.go | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/pkg/test/integration/share_test.go b/pkg/test/integration/share_test.go index 06c38a660..2ff36f3bd 100644 --- a/pkg/test/integration/share_test.go +++ b/pkg/test/integration/share_test.go @@ -31,6 +31,12 @@ func TestFileSharing(t *testing.T) { share(t, "share_test.go") } +// like TestFileSharing, but with a file large enough to have several parts, +// including some bytesRef parts. +func TestFileWithBytesSharing(t *testing.T) { + share(t, test.GetWorld(t).ServerBinary()) +} + func TestDirSharing(t *testing.T) { share(t, filepath.FromSlash("../integration")) } diff --git a/pkg/test/world.go b/pkg/test/world.go index eeeb8cc6b..f371bcecc 100644 --- a/pkg/test/world.go +++ b/pkg/test/world.go @@ -371,3 +371,8 @@ func (w *World) SecretRingFile() string { // SearchHandlerPath returns the path to the search handler, with trailing slash. func (w *World) SearchHandlerPath() string { return "/my-search/" } + +// ServerBinary returns the location of the camlistored binary running for this World. +func (w *World) ServerBinary() string { + return filepath.Join(w.camRoot, "bin", "camlistored") +}