[tools][fuzz] Fix crash in fx fuzz

The json output of ffx component has changed such that first one must
check to ensure the "resolved" arg exists and that the "started" arg
exists within the "resolved" arg.

Fixed: 103285
Change-Id: I1993c4c42103257f5dd37cf50d6d024987f2c662
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/693809
Reviewed-by: Cameron Finucane <eep@google.com>
Commit-Queue: Stefan Bossbaly <stefanbossbaly@google.com>
diff --git a/scripts/fuzzing/lib/device.py b/scripts/fuzzing/lib/device.py
index 73fb495c..ca8bbc2 100644
--- a/scripts/fuzzing/lib/device.py
+++ b/scripts/fuzzing/lib/device.py
@@ -201,7 +201,11 @@
             out = self.host.create_process(cmd).check_output()
             # Components that are not running can be either absent or have null
             # execution info
-            self._urls = [c["url"] for c in json.loads(out) if c["execution"]]
+            self._urls = [
+                c["url"]
+                for c in json.loads(out)
+                if "resolved" in c and "started" in c["resolved"]
+            ]
         return url in self._urls
 
     def isfile(self, pathname):
diff --git a/scripts/fuzzing/test/test_case.py b/scripts/fuzzing/test/test_case.py
index c483a64..fb4781b9 100644
--- a/scripts/fuzzing/test/test_case.py
+++ b/scripts/fuzzing/test/test_case.py
@@ -168,7 +168,16 @@
             '/fuchsia_dir/.jiri_root/bin/fx', 'ffx', '--machine', 'json',
             'component', 'show', '/core/appmgr/sys'
         ]
-        output = {"url": url, "execution": {"elf_runtime": {"job_id": 123}}}
+        output = {
+            "url": url,
+            "resolved": {
+                "started": {
+                    "elf_runtime": {
+                        "job_id": 123
+                    }
+                }
+            }
+        }
         end = None if not duration else self.host.elapsed + duration
         self.set_outputs(cmd, output, end=end, reset=False, raw=True)
         if refresh: