Merge pull request #263 from MatthewHink/mhink-overlay

Fix wwctl overlay mkdir #248.
This commit is contained in:
Gregory M. Kurtzer
2022-01-27 17:27:07 -08:00
committed by GitHub
2 changed files with 22 additions and 1 deletions

View 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")
}
}

View File

@@ -11,7 +11,7 @@ var (
Short: "Create a new directory within an Overlay",
Long: "This command creates a new directory within the Warewulf OVERLAY_NAME.",
RunE: CobraRunE,
Args: cobra.MinimumNArgs(3),
Args: cobra.MinimumNArgs(2),
}
PermMode int32
)