new_variant: parse JSON to check project config status

Instead of grepping the project-config.json file for the name of the
new variant, parse the JSON and check that the name is in the correct
place. With `grep`, it could be anywhere in the file, and not
necessarily as a result of having a correct firmware configuration.

BUG=b:176124141
TEST=run the new_variant end-to-end test for one of the supported
reference boards that uses project-config.json (I'll use trembyle
in this instance).

Change-Id: I597e1a8f32ae0b72e55c0172ca385252e9e0bb0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2600105
Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
Tested-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Andrew Lamb <andrewlamb@chromium.org>
1 file changed