mirror of
https://github.com/clearlinux/rkt.git
synced 2026-09-01 11:26:05 +00:00
functional tests: Simplify running the test server
This commit is contained in:
+1
-17
@@ -18,7 +18,6 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -135,9 +134,7 @@ func testAuthIgnoreSubdirectories(t *testing.T, server *taas.Server) {
|
||||
}
|
||||
|
||||
func runServer(t *testing.T, auth taas.Type) *taas.Server {
|
||||
goTool := getAbs(t, "go")
|
||||
acTool := getAbs(t, "../bin/actool")
|
||||
server, err := taas.NewServerWithPaths(auth, 20, acTool, goTool)
|
||||
server, err := taas.NewServerWithPaths(auth, 20, "../bin/actool", "go")
|
||||
if err != nil {
|
||||
t.Fatalf("Could not start server: %v", err)
|
||||
}
|
||||
@@ -145,19 +142,6 @@ func runServer(t *testing.T, auth taas.Type) *taas.Server {
|
||||
return server
|
||||
}
|
||||
|
||||
func getAbs(t *testing.T, tool string) string {
|
||||
baseTool := filepath.Base(tool)
|
||||
pathTool, err := exec.LookPath(tool)
|
||||
if err != nil {
|
||||
t.Fatalf("Could not find %s, required to run server: %v", baseTool, err)
|
||||
}
|
||||
absTool, err := filepath.Abs(pathTool)
|
||||
if err != nil {
|
||||
t.Fatalf("Could not get absolute path of %s, required to run server: %v", baseTool, err)
|
||||
}
|
||||
return absTool
|
||||
}
|
||||
|
||||
func serverHandler(t *testing.T, server *taas.Server) {
|
||||
for {
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user