Fix nil pointer when creating volume with “” storage account

Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
This commit is contained in:
Guillaume Tardif 2020-09-24 09:52:17 +02:00
parent 7e534153f3
commit 7eda96bea4
2 changed files with 12 additions and 4 deletions

View file

@ -150,6 +150,15 @@ func TestContainerRunVolume(t *testing.T) {
accountName = "e2e" + strconv.Itoa(int(time.Now().UnixNano()))
)
t.Run("check empty volume name validity", func(t *testing.T) {
invalidName := ""
res := c.RunDockerOrExitError("volume", "create", "--storage-account", invalidName, "--fileshare", fileshareName)
res.Assert(t, icmd.Expected{
ExitCode: 1,
Err: `parameter=accountName constraint=MinLength value="" details: value length must be greater than or equal to 3`,
})
})
t.Run("check volume name validity", func(t *testing.T) {
invalidName := "some-storage-123"
res := c.RunDockerOrExitError("volume", "create", "--storage-account", invalidName, "--fileshare", fileshareName)