Use newer default values for mounts CLI

In the API:
`Writable` changed to `ReadOnly`
`Populate` changed to `NoCopy`

Corresponding CLI options updated to:
`volume-writable` changed to `volume-readonly`
`volume-populate` changed to `volume-nocopy`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2016-07-05 14:43:28 -04:00 committed by Brian Goff
parent 9344f05303
commit dfe4019f03

View file

@ -2,6 +2,9 @@
package assert package assert
import ( import (
"fmt"
"path/filepath"
"runtime"
"strings" "strings"
) )
@ -15,7 +18,7 @@ type TestingT interface {
// they are not equal. // they are not equal.
func Equal(t TestingT, actual, expected interface{}) { func Equal(t TestingT, actual, expected interface{}) {
if expected != actual { if expected != actual {
t.Fatalf("Expected '%v' (%T) got '%v' (%T)", expected, expected, actual, actual) fatal(t, fmt.Sprintf("Expected '%v' (%T) got '%v' (%T)", expected, expected, actual, actual))
} }
} }
@ -37,7 +40,7 @@ func EqualStringSlice(t TestingT, actual, expected []string) {
// NilError asserts that the error is nil, otherwise it fails the test. // NilError asserts that the error is nil, otherwise it fails the test.
func NilError(t TestingT, err error) { func NilError(t TestingT, err error) {
if err != nil { if err != nil {
t.Fatalf("Expected no error, got: %s", err.Error()) fatal(t, fmt.Sprintf("Expected no error, got: %s", err.Error()))
} }
} }
@ -45,11 +48,11 @@ func NilError(t TestingT, err error) {
// otherwise it fails the test. // otherwise it fails the test.
func Error(t TestingT, err error, contains string) { func Error(t TestingT, err error, contains string) {
if err == nil { if err == nil {
t.Fatalf("Expected an error, but error was nil") fatal(t, "Expected an error, but error was nil")
} }
if !strings.Contains(err.Error(), contains) { if !strings.Contains(err.Error(), contains) {
t.Fatalf("Expected error to contain '%s', got '%s'", contains, err.Error()) fatal(t, fmt.Sprintf("Expected error to contain '%s', got '%s'", contains, err.Error()))
} }
} }
@ -57,6 +60,11 @@ func Error(t TestingT, err error, contains string) {
// test. // test.
func Contains(t TestingT, actual, contains string) { func Contains(t TestingT, actual, contains string) {
if !strings.Contains(actual, contains) { if !strings.Contains(actual, contains) {
t.Fatalf("Expected '%s' to contain '%s'", actual, contains) fatal(t, fmt.Sprintf("Expected '%s' to contain '%s'", actual, contains))
} }
} }
func fatal(t TestingT, msg string) {
_, file, line, _ := runtime.Caller(2)
t.Fatalf("%s:%d: %s", filepath.Base(file), line, msg)
}