[tests] More componentized tests.

Change-Id: Ic06b1932b6917a61008d1edabe4743ed7b28213e
diff --git a/garnet/bin/stash/BUILD.gn b/garnet/bin/stash/BUILD.gn
index f461e69..94ae1e7 100644
--- a/garnet/bin/stash/BUILD.gn
+++ b/garnet/bin/stash/BUILD.gn
@@ -4,6 +4,7 @@
 
 import("//build/package.gni")
 import("//build/rust/rustc_binary.gni")
+import("//build/test/test_package.gni")
 import("//build/testing/environments.gni")
 
 rustc_binary("bin") {
@@ -52,9 +53,7 @@
   ]
 }
 
-package("stash_tests") {
-  testonly = true
-
+test_package("stash_tests") {
   deps = [
     ":bin",
   ]
diff --git a/garnet/bin/stash/meta/stash_bin_test.cmx b/garnet/bin/stash/meta/stash_bin_test.cmx
new file mode 100644
index 0000000..fa0bc13
--- /dev/null
+++ b/garnet/bin/stash/meta/stash_bin_test.cmx
@@ -0,0 +1,10 @@
+{
+    "program": {
+        "binary": "test/stash_bin_test"
+    },
+    "sandbox": {
+        "features": [
+            "system-temp"
+        ]
+    }
+}
diff --git a/garnet/bin/stash_ctl/BUILD.gn b/garnet/bin/stash_ctl/BUILD.gn
index 2089b81..6b6a4f4 100644
--- a/garnet/bin/stash_ctl/BUILD.gn
+++ b/garnet/bin/stash_ctl/BUILD.gn
@@ -4,6 +4,7 @@
 
 import("//build/package.gni")
 import("//build/rust/rustc_binary.gni")
+import("//build/test/test_package.gni")
 import("//build/testing/environments.gni")
 
 rustc_binary("bin") {
@@ -52,9 +53,7 @@
   ]
 }
 
-package("stash_ctl_tests") {
-  testonly = true
-
+test_package("stash_ctl_tests") {
   deps = [
     ":bin",
   ]
diff --git a/garnet/bin/stash_ctl/meta/stash_ctl_bin_test.cmx b/garnet/bin/stash_ctl/meta/stash_ctl_bin_test.cmx
new file mode 100644
index 0000000..7c2e0bb
--- /dev/null
+++ b/garnet/bin/stash_ctl/meta/stash_ctl_bin_test.cmx
@@ -0,0 +1,5 @@
+{
+    "program": {
+        "binary": "test/stash_ctl_bin_test"
+    }
+}
diff --git a/garnet/public/lib/syslog/cpp/BUILD.gn b/garnet/public/lib/syslog/cpp/BUILD.gn
index edf9673..edc65d6 100644
--- a/garnet/public/lib/syslog/cpp/BUILD.gn
+++ b/garnet/public/lib/syslog/cpp/BUILD.gn
@@ -3,6 +3,7 @@
 # found in the LICENSE file.
 
 import("//build/package.gni")
+import("//build/test/test_package.gni")
 import("//build/testing/environments.gni")
 
 source_set("cpp") {
@@ -33,9 +34,7 @@
   ]
 }
 
-package("tests") {
-  testonly = true
-
+test_package("tests") {
   package_name = "syslog_cpp_tests"
 
   deps = [
diff --git a/garnet/public/lib/syslog/cpp/meta/syslog_cpp_unittests.cmx b/garnet/public/lib/syslog/cpp/meta/syslog_cpp_unittests.cmx
new file mode 100644
index 0000000..ef90dd0
--- /dev/null
+++ b/garnet/public/lib/syslog/cpp/meta/syslog_cpp_unittests.cmx
@@ -0,0 +1,5 @@
+{
+    "program": {
+        "binary": "test/syslog_cpp_unittests"
+    }
+}
\ No newline at end of file
diff --git a/garnet/public/lib/syslog/go/src/syslog/BUILD.gn b/garnet/public/lib/syslog/go/src/syslog/BUILD.gn
index f585f26..4561a0f 100644
--- a/garnet/public/lib/syslog/go/src/syslog/BUILD.gn
+++ b/garnet/public/lib/syslog/go/src/syslog/BUILD.gn
@@ -6,6 +6,7 @@
 import("//build/go/go_test.gni")
 import("//build/go/toolchain.gni")
 import("//build/package.gni")
+import("//build/test/test_package.gni")
 import("//build/testing/environments.gni")
 
 go_library("syslog") {
@@ -24,9 +25,7 @@
   ]
 }
 
-package("syslog_gotests") {
-  testonly = true
-
+test_package("syslog_gotests") {
   deps = [
     ":syslog_test",
   ]
diff --git a/garnet/public/lib/syslog/go/src/syslog/meta/syslog_test.cmx b/garnet/public/lib/syslog/go/src/syslog/meta/syslog_test.cmx
new file mode 100644
index 0000000..7380e92
--- /dev/null
+++ b/garnet/public/lib/syslog/go/src/syslog/meta/syslog_test.cmx
@@ -0,0 +1,10 @@
+{
+    "program": {
+        "binary": "test/syslog_test"
+    },
+    "sandbox": {
+        "features": [
+            "system-temp"
+        ]
+    }
+}
\ No newline at end of file
diff --git a/peridot/bin/sessionmgr/storage/BUILD.gn b/peridot/bin/sessionmgr/storage/BUILD.gn
index 7561003..dfb5015 100644
--- a/peridot/bin/sessionmgr/storage/BUILD.gn
+++ b/peridot/bin/sessionmgr/storage/BUILD.gn
@@ -5,7 +5,7 @@
 import("//build/testing/environments.gni")
 import("//peridot/build/tests_package.gni")
 
-tests_package("storage_unittests") {
+hermetic_tests_package("storage_unittests") {
   deps = [
     ":constants_and_utils_unittest",
     ":session_storage_unittest",
diff --git a/peridot/bin/sessionmgr/storage/meta/constants_and_utils_unittest.cmx b/peridot/bin/sessionmgr/storage/meta/constants_and_utils_unittest.cmx
new file mode 100644
index 0000000..37d2457
--- /dev/null
+++ b/peridot/bin/sessionmgr/storage/meta/constants_and_utils_unittest.cmx
@@ -0,0 +1,5 @@
+{
+    "program": {
+        "binary": "test/constants_and_utils_unittest"
+    }
+}
\ No newline at end of file
diff --git a/peridot/bin/sessionmgr/storage/meta/session_storage_unittest.cmx b/peridot/bin/sessionmgr/storage/meta/session_storage_unittest.cmx
new file mode 100644
index 0000000..f7f09d9
--- /dev/null
+++ b/peridot/bin/sessionmgr/storage/meta/session_storage_unittest.cmx
@@ -0,0 +1,10 @@
+{
+    "program": {
+        "binary": "test/session_storage_unittest"
+    },
+    "sandbox": {
+        "services": [
+            "fuchsia.sys.Launcher"
+        ]
+    }
+}
\ No newline at end of file
diff --git a/peridot/bin/sessionmgr/storage/meta/story_storage_unittest.cmx b/peridot/bin/sessionmgr/storage/meta/story_storage_unittest.cmx
new file mode 100644
index 0000000..8e39984
--- /dev/null
+++ b/peridot/bin/sessionmgr/storage/meta/story_storage_unittest.cmx
@@ -0,0 +1,10 @@
+{
+    "program": {
+        "binary": "test/story_storage_unittest"
+    },
+    "sandbox": {
+        "services": [
+            "fuchsia.sys.Launcher"
+        ]
+    }
+}
\ No newline at end of file