Convert remaining cmx files to cml

In addition to the straightforward changes, execserver.cmx and
executor.cmx have been removed because they weren't in use.
vulkan-cts-no-args was converted to a test, because otherwise there was
nowhere in the component hierarchy to run it.

Bug: 103175
Change-Id: Ie221acc056fc5b3540cd0dc8836dd74ba12b9412
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/vulkan-cts/+/693428
Reviewed-by: Craig Stout <cstout@google.com>
diff --git a/fuchsia/BUILD.gn b/fuchsia/BUILD.gn
index 59498f2..d77cab6 100644
--- a/fuchsia/BUILD.gn
+++ b/fuchsia/BUILD.gn
@@ -23,11 +23,12 @@
     # TODO(fxbug.dev/71971): Fix.
     hermetic_deps = false
     deps = [
-      "//zircon/public/sysroot:system_libc_deps",
       "//sdk:zircon_sysroot_export",
       "//sdk/lib/fdio:fdio_sdk",
       "//src/lib/vulkan",
+      "//zircon/public/sysroot:system_libc_deps",
     ]
+
     # Use absolute paths to avoid having to track relative paths through CMake.
     no_output_dir_leaks = false
 
@@ -60,6 +61,7 @@
       "$root_out_dir/build-vulkancts/external/vulkancts/modules/vulkan/deqp-vk",
     ]
     deps = [ ":build" ]
+
     # output path is built into executable.
     no_output_dir_leaks = false
   }
@@ -110,15 +112,18 @@
 # from the variant_target template in //build/config/BUILDCONFIG.gn.
 cpp_binary_deps = [
   "//build/toolchain/runtime:shared-libc++-deps",
-  "//zircon/public/sysroot:system_libc_deps",
   "//sdk/lib/fdio",
   "//src/zircon/lib/zircon",
   "//zircon/public/sysroot:cpp_binary_deps",
   "//zircon/public/sysroot:crt1_deps",
+  "//zircon/public/sysroot:system_libc_deps",
 ]
 
 resource("vulkan-cts-executable") {
-  deps = [ ":strip", ":vulkan_cts_build_id" ]
+  deps = [
+    ":strip",
+    ":vulkan_cts_build_id",
+  ]
   data_deps = [ "//src/lib/vulkan" ] + cpp_binary_deps
 
   sources = [ "$root_build_dir/vulkan-cts" ]
@@ -155,35 +160,36 @@
 
 # To run on device:
 #
-# run fuchsia-pkg://fuchsia.com/vulkan-cts-unified#meta/vulkan-cts.cmx
+# fx test -o vulkan-cts.cm
 #
 # Command line args are specified in the component manifest.
 #
 fuchsia_component("vulkan-cts-component") {
   component_name = "vulkan-cts"
   testonly = true
-  manifest = "meta/vulkan-cts.cmx"
+  manifest = "meta/vulkan-cts.cml"
   deps = [ ":cts-deps" ]
 }
 
 # To run on device:
 #
-# run fuchsia-pkg://fuchsia.com/vulkan-cts-zircon#meta/vulkan-cts-zircon.cmx
+# fx test -o vulkan-cts-zircon
 #
 fuchsia_component("vulkan-cts-zircon-component") {
   testonly = true
   component_name = "vulkan-cts-zircon"
-  manifest = "meta/vulkan-cts-zircon.cmx"
+  manifest = "meta/vulkan-cts-zircon.cml"
   deps = [ ":cts-deps" ]
 }
 
 # To run on device:
 #
-# run fuchsia-pkg://fuchsia.com/vulkan-cts-unified#meta/vulkan-cts-no-args.cmx --deqp-log-images=disable --deqp-log-shader-sources=disable --deqp-log-filename=/data/TestResults.qpa --deqp-archive-dir=/pkg/data --deqp-case=dEQP-VK.*
+# fx test -o vulkan-cts-no-args -- --deqp-log-images=disable --deqp-log-shader-sources=disable --deqp-log-filename=/artifacts/TestResults.qpa --deqp-archive-dir=/pkg/data --deqp-case=dEQP-VK.*
 #
-fuchsia_component("vulkan-cts-no-args") {
+fuchsia_component("vulkan-cts-no-args-component") {
   testonly = true
-  manifest = "meta/vulkan-cts-no-args.cmx"
+  component_name = "vulkan-cts-no-args"
+  manifest = "meta/vulkan-cts-no-args.cml"
   deps = [ ":cts-deps" ]
 }
 
@@ -195,6 +201,21 @@
   }
 }
 
+fuchsia_test_package("vulkan-cts-no-args") {
+  test_components = [ ":vulkan-cts-no-args-component" ]
+  test_specs = {
+    environments = [
+      {
+        forward_variables_from(aemu_env, "*")
+
+        # This test should only be run manually (it needs command-line arguments to work), so use a
+        # tag that's never enabled on infra.
+        tags = [ "disabled-vulkan-cts" ]
+      },
+    ]
+  }
+}
+
 fuchsia_test_package("vulkan-cts-zircon") {
   test_components = [ ":vulkan-cts-zircon-component" ]
   test_specs = {
@@ -206,6 +227,7 @@
   testonly = true
   public_deps = [
     ":vulkan-cts",
+    ":vulkan-cts-no-args",
     "//src/graphics/bundles:vulkan",
   ]
 }
diff --git a/fuchsia/meta/vulkan-cts-execserver.cmx b/fuchsia/meta/vulkan-cts-execserver.cmx
deleted file mode 100644
index f5a8d6d..0000000
--- a/fuchsia/meta/vulkan-cts-execserver.cmx
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-    "program": {
-        "binary": "bin/execserver"
-    },
-    "sandbox": {
-        "dev": [
-            "class/framebuffer"
-        ],
-        "features": [
-            "vulkan",
-            "isolated-persistent-storage"
-        ],
-        "services": [
-            "fuchsia.posix.socket.Provider",
-            "fuchsia.net.NameLookup",
-            "fuchsia.vulkan.loader.Loader"
-        ]
-    }
-}
diff --git a/fuchsia/meta/vulkan-cts-executor.cmx b/fuchsia/meta/vulkan-cts-executor.cmx
deleted file mode 100644
index 334cb5d..0000000
--- a/fuchsia/meta/vulkan-cts-executor.cmx
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-    "program": {
-        "binary": "bin/executor"
-    },
-    "sandbox": {
-        "dev": [
-            "class/framebuffer"
-        ],
-        "features": [
-            "vulkan",
-            "isolated-persistent-storage"
-        ],
-        "services": [
-            "fuchsia.process.Launcher",
-            "fuchsia.posix.socket.Provider",
-            "fuchsia.net.NameLookup",
-            "fuchsia.vulkan.loader.Loader"
-        ]
-    }
-}
diff --git a/fuchsia/meta/vulkan-cts-no-args.cml b/fuchsia/meta/vulkan-cts-no-args.cml
new file mode 100644
index 0000000..de7be16
--- /dev/null
+++ b/fuchsia/meta/vulkan-cts-no-args.cml
@@ -0,0 +1,32 @@
+// Copyright 2022 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+{
+    include: [
+        "//src/sys/test_manager/system-test.shard.cml",
+        "sys/testing/elf_test_runner.shard.cml",
+        "syslog/client.shard.cml",
+        "vulkan/client.shard.cml",
+    ],
+    program: {
+        binary: "test/vulkan-cts",
+    },
+    use: [
+        {
+            storage: "cache",
+            path: "/cache",
+        },
+        {
+            storage: "data",
+            path: "/data",
+        },
+        {
+            storage: "tmp",
+            path: "/tmp",
+        },
+        {
+            storage: "custom_artifacts",
+            path: "/artifacts",
+        },
+    ],
+}
diff --git a/fuchsia/meta/vulkan-cts-no-args.cmx b/fuchsia/meta/vulkan-cts-no-args.cmx
deleted file mode 100644
index 09b1996..0000000
--- a/fuchsia/meta/vulkan-cts-no-args.cmx
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-    "facets": {
-        "fuchsia.test": {
-            "system-services": [
-                "fuchsia.sysmem.Allocator",
-                "fuchsia.vulkan.loader.Loader"
-            ]
-        }
-    },
-    "program": {
-        "binary": "test/vulkan-cts"
-    },
-    "sandbox": {
-        "dev": [
-            "class/framebuffer"
-        ],
-        "features": [
-            "vulkan",
-            "isolated-persistent-storage",
-            "isolated-temp"
-        ],
-        "services": [
-            "fuchsia.sysmem.Allocator",
-            "fuchsia.tracing.provider.Registry",
-            "fuchsia.logger.LogSink",
-            "fuchsia.vulkan.loader.Loader"
-        ]
-    }
-}
diff --git a/fuchsia/meta/vulkan-cts-zircon.cml b/fuchsia/meta/vulkan-cts-zircon.cml
new file mode 100644
index 0000000..deee224
--- /dev/null
+++ b/fuchsia/meta/vulkan-cts-zircon.cml
@@ -0,0 +1,40 @@
+// Copyright 2022 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+{
+    include: [
+        "//src/sys/test_manager/system-test.shard.cml",
+        "sys/testing/elf_test_runner.shard.cml",
+        "syslog/client.shard.cml",
+        "vulkan/client.shard.cml",
+    ],
+    program: {
+        binary: "test/vulkan-cts",
+        args: [
+            "--deqp-case=*zircon*",
+            "--deqp-log-images=disable",
+            "--deqp-log-shader-sources=disable",
+            "--deqp-log-filename=/artifacts/TestResults.qpa",
+            "--deqp-archive-dir=/pkg/data",
+            "--deqp-log-flush=disable",
+        ],
+    },
+    use: [
+        {
+            storage: "cache",
+            path: "/cache",
+        },
+        {
+            storage: "data",
+            path: "/data",
+        },
+        {
+            storage: "tmp",
+            path: "/tmp",
+        },
+        {
+            storage: "custom_artifacts",
+            path: "/artifacts",
+        },
+    ],
+}
diff --git a/fuchsia/meta/vulkan-cts-zircon.cmx b/fuchsia/meta/vulkan-cts-zircon.cmx
deleted file mode 100644
index a41e481..0000000
--- a/fuchsia/meta/vulkan-cts-zircon.cmx
+++ /dev/null
@@ -1,37 +0,0 @@
-{
-    "facets": {
-        "fuchsia.test": {
-            "system-services": [
-                "fuchsia.sysmem.Allocator",
-                "fuchsia.vulkan.loader.Loader"
-            ]
-        }
-    },
-    "program": {
-        "args": [
-            "--deqp-case=*zircon*",
-            "--deqp-log-images=disable",
-            "--deqp-log-shader-sources=disable",
-            "--deqp-log-filename=/tmp/TestResults.qpa",
-            "--deqp-archive-dir=/pkg/data",
-            "--deqp-log-flush=disable"
-        ],
-        "binary": "test/vulkan-cts"
-    },
-    "sandbox": {
-        "dev": [
-            "class/framebuffer"
-        ],
-        "features": [
-            "isolated-persistent-storage",
-            "isolated-temp",
-            "vulkan"
-        ],
-        "services": [
-            "fuchsia.logger.LogSink",
-            "fuchsia.sysmem.Allocator",
-            "fuchsia.tracing.provider.Registry",
-            "fuchsia.vulkan.loader.Loader"
-        ]
-    }
-}
diff --git a/fuchsia/meta/vulkan-cts.cml b/fuchsia/meta/vulkan-cts.cml
new file mode 100644
index 0000000..5a814e1
--- /dev/null
+++ b/fuchsia/meta/vulkan-cts.cml
@@ -0,0 +1,41 @@
+// Copyright 2022 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+{
+    include: [
+        "//src/sys/test_manager/system-test.shard.cml",
+        "sys/testing/elf_test_runner.shard.cml",
+        "syslog/client.shard.cml",
+        "vulkan/client.shard.cml",
+    ],
+    program: {
+        binary: "test/vulkan-cts",
+        args: [
+            "--deqp-caselist-file=/pkg/data/vk-default.txt",
+            "--deqp-log-images=disable",
+            "--deqp-log-shader-sources=disable",
+            "--deqp-log-filename=/artifacts/TestResults.qpa",
+            "--deqp-archive-dir=/pkg/data",
+            "--deqp-log-flush=disable",
+            "--deqp-minimize-stdout=enable",
+        ],
+    },
+    use: [
+        {
+            storage: "cache",
+            path: "/cache",
+        },
+        {
+            storage: "data",
+            path: "/data",
+        },
+        {
+            storage: "tmp",
+            path: "/tmp",
+        },
+        {
+            storage: "custom_artifacts",
+            path: "/artifacts",
+        },
+    ],
+}
diff --git a/fuchsia/meta/vulkan-cts.cmx b/fuchsia/meta/vulkan-cts.cmx
deleted file mode 100644
index 121ca2f..0000000
--- a/fuchsia/meta/vulkan-cts.cmx
+++ /dev/null
@@ -1,37 +0,0 @@
-{
-    "facets": {
-        "fuchsia.test": {
-            "system-services": [
-                "fuchsia.sysmem.Allocator",
-                "fuchsia.vulkan.loader.Loader"
-            ]
-        }
-    },
-    "program": {
-        "args": [
-            "--deqp-caselist-file=/pkg/data/vk-default.txt",
-            "--deqp-log-images=disable",
-            "--deqp-log-shader-sources=disable",
-            "--deqp-log-filename=/data/TestResults.qpa",
-            "--deqp-archive-dir=/pkg/data",
-            "--deqp-log-flush=disable",
-            "--deqp-minimize-stdout=enable"
-        ],
-        "binary": "test/vulkan-cts"
-    },
-    "sandbox": {
-        "dev": [
-            "class/framebuffer"
-        ],
-        "features": [
-            "vulkan",
-            "isolated-persistent-storage"
-        ],
-        "services": [
-            "fuchsia.sysmem.Allocator",
-            "fuchsia.tracing.provider.Registry",
-            "fuchsia.logger.LogSink",
-            "fuchsia.vulkan.loader.Loader"
-        ]
-    }
-}