Validate that root and state paths are different.

Using the same path for both results in confusing errors when runtime.newBundle()
attempts to create the directories for the Task

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
Daniel Nephin
2017-11-10 12:31:29 -05:00
parent b4a65de5c6
commit 49af59bfca
2 changed files with 23 additions and 3 deletions

17
server/server_test.go Normal file
View File

@@ -0,0 +1,17 @@
package server
import (
"testing"
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"
)
func TestNewErrorsWithSamePathForRootAndState(t *testing.T) {
path := "/tmp/path/for/testing"
_, err := New(context.Background(), &Config{
Root: path,
State: path,
})
assert.EqualError(t, err, "root and state must be different paths")
}