Test CLI tools factorized.

Change-Id: Ic45d6ff997ba1bb9d940d56ec91836856fb4f1c4