Pull out JSON string from stdout

When there is a custom message in `.bashrc` on certain fedora based
distros, the string will be included in the stdout. This will pull out
the following JSON string, if present, and attempt to parse that.

Change-Id: I7d0d4e9b36924664d158c62baf8cdef163bd1d85
Closes-Bug: #1294851
tests: fix mock usage

Change-Id: I38bef45b09c5e90e079fcf0d4fdaf796bf79b79a
Merge "Pull out JSON string from stdout"