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