Refactor functional tests for testing more command options. Change-Id: I030652f6f3ab3dada12252599b20969f03a5df02