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