Add lifecycle test in rake.

Change-Id: If7eb3f89f8e8ba1d307217fba2bf2a47a586f644