Fix tests with old cmd function.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Merge pull request #9490 from jfrazelle/fix-test-cmd-eff

Fix tests with old cmd function.