21
internal/app/wwctl/overlay/mkdir/mkdir_test.go
Normal file
21
internal/app/wwctl/overlay/mkdir/mkdir_test.go
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package mkdir
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TestArgsOverlayMkdir is a regression test for 248.
|
||||||
|
// One argument should fail, two should succeed.
|
||||||
|
func TestArgsOverlayMkdir(t *testing.T) {
|
||||||
|
command := GetCommand()
|
||||||
|
|
||||||
|
err := command.Args(command, []string{"overlay_name"})
|
||||||
|
if err == nil {
|
||||||
|
t.Errorf("one argument to overlay mkdir should fail")
|
||||||
|
}
|
||||||
|
|
||||||
|
err = command.Args(command, []string{"overlay_name", "directory"})
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("two arguments to overlay mkdir should succeed")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ var (
|
|||||||
Short: "Create a new directory within an Overlay",
|
Short: "Create a new directory within an Overlay",
|
||||||
Long: "This command creates a new directory within the Warewulf OVERLAY_NAME.",
|
Long: "This command creates a new directory within the Warewulf OVERLAY_NAME.",
|
||||||
RunE: CobraRunE,
|
RunE: CobraRunE,
|
||||||
Args: cobra.MinimumNArgs(3),
|
Args: cobra.MinimumNArgs(2),
|
||||||
}
|
}
|
||||||
PermMode int32
|
PermMode int32
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user