Add checkmode support for test-module script

Signed-off-by: Hector Acosta <hector.acosta@gmail.com>
Merge pull request #8214 from hacosta/checkmode

Add checkmode support for test-module script