integration-cli/build: don't panic
integration-cli/build: don't panic

A lack of check in the test code can lead to a panic due to
`len(ids)` being `0`.

Avoid the panic by adding appropriate checks. Note `Assert()` should be
used rather than `Check()` as if it fails we should not proceed with the
test.

Originally found in https://github.com/moby/moby/pull/38404.

Signed-off-by: Kir Kolyshkin <3a017b8ddb3f9cf3e4a59978b004111bdeb97f08@gmail.com>

rancher/docker,moby/moby,x1022as/docker,trebonian/docker,bearstech/moby,jthelin/docker,AkihiroSuda/docker,rremer/moby,dims/docker,Mokolea/docker,Mokolea/docker,jwhonce/docker,kolyshkin/moby,pradipd/moby,mahak/docker,docker/docker,SvenDowideit/docker,rancher/docker,trebonian/docker,thaJeztah/docker,justincormack/docker,paralin/docker,pradipd/moby,moul/docker,rremer/moby,estesp/docker,yongtang/docker,unclejack/docker,paralin/docker,ibuildthecloud/docker,jthelin/docker,ibuildthecloud/docker,jimjag/docker,djs55/docker,ibuildthecloud/docker,paralin/docker,crosbymichael/docker,jimjag/docker,flavio/docker,nalind/docker,maxamillion/docker,moby/moby,nawawi/docker,flavio/docker,cpuguy83/docker,trebonian/docker,bearstech/moby,trebonian/docker,yosifkit/docker,estesp/docker,jvanz/docker,gnailuy/docker,paralin/docker,yongtang/docker,jlhawn/docker,tmp6154/docker,yosifkit/docker,djs55/docker,bearstech/moby,nawawi/docker,jameszhan/docker,kolyshkin/moby,yosifkit/docker,mikebrow/docker,tmp6154/docker,rremer/moby,gnailuy/docker,AkihiroSuda/docker,vdemeester/docker,Mokolea/docker,moby/moby,SvenDowideit/docker,nalind/docker,x1022as/docker,kolyshkin/moby,kojiromike/docker,KarthikNayak/docker,justincormack/docker,estesp/docker,nawawi/docker,nalind/docker,Ramzec/docker,KarthikNayak/docker,mahak/docker,thaJeztah/docker,jlhawn/docker,moul/docker,KarthikNayak/docker,djs55/docker,yongtang/docker,vdemeester/docker,gnailuy/docker,SvenDowideit/docker,unclejack/docker,konstruktoid/docker-1,crosbymichael/docker,mahak/docker,jameszhan/docker,yosifkit/docker,cpuguy83/docker,konstruktoid/docker-1,tmp6154/docker,konstruktoid/docker-1,rancher/docker,justincormack/docker,dims/docker,konstruktoid/docker-upstream,crosbymichael/docker,thaJeztah/docker,thaJeztah/docker,jwhonce/docker,docker/docker,Ramzec/docker,maxamillion/docker,Ramzec/docker,ibuildthecloud/docker,dims/docker,jimjag/docker,nawawi/docker,x1022as/docker,konstruktoid/docker-upstream,kojiromike/docker,scotttlin/docker,gnailuy/docker,jvanz/docker,pradipd/moby,Ramzec/docker,AkihiroSuda/docker,scotttlin/docker,jvanz/docker,bearstech/moby,jwhonce/docker,cpuguy83/docker,cpuguy83/docker,ibuildthecloud/docker,scotttlin/docker,moul/docker,konstruktoid/docker-upstream,kojiromike/docker,mikebrow/docker,docker/docker,moul/docker,moby/moby,jameszhan/docker,unclejack/docker,jlhawn/docker,mikebrow/docker,AkihiroSuda/docker,Mokolea/docker,flavio/docker,jimjag/docker,nalind/docker,vdemeester/docker,flavio/docker,maxamillion/docker,konstruktoid/docker-upstream,mahak/docker