fix where cmd function dne

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

fix tests where cmd function does not exist