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