From: Christos Trochalakis <ctrochalakis@debian.org>
Date: Fri, 1 Sep 2017 15:31:31 +0300
Subject: test: Autopkgtest support

 o Use system's redis-server
 o Adapt paths for autopkgtest
---
 main_test.go | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/main_test.go b/main_test.go
index 30f09c6..8e6587c 100644
--- a/main_test.go
+++ b/main_test.go
@@ -247,12 +247,17 @@ func (p *redisProcess) Close() error {
 }
 
 var (
-	redisServerBin, _  = filepath.Abs(filepath.Join("testdata", "redis", "src", "redis-server"))
-	redisServerConf, _ = filepath.Abs(filepath.Join("testdata", "redis.conf"))
+	autopkgtestTmp       = os.Getenv("AUTOPKGTEST_TMP")
+	autopkgtestArtifacts = os.Getenv("AUTOPKGTEST_ARTIFACTS")
+)
+
+var (
+	redisServerBin     = "/usr/bin/redis-server"
+	redisServerConf, _ = filepath.Abs(filepath.Join(autopkgtestTmp, "testdata", "redis.conf"))
 )
 
 func redisDir(port string) (string, error) {
-	dir, err := filepath.Abs(filepath.Join("testdata", "instances", port))
+	dir, err := filepath.Abs(filepath.Join(autopkgtestArtifacts, "testdata", "instances", port))
 	if err != nil {
 		return "", err
 	}
