aboutsummaryrefslogtreecommitdiff
path: root/tests/spawn/spawn.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/spawn/spawn.c')
-rw-r--r--tests/spawn/spawn.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/spawn/spawn.c b/tests/spawn/spawn.c
new file mode 100644
index 0000000..67d64f8
--- /dev/null
+++ b/tests/spawn/spawn.c
@@ -0,0 +1,18 @@
+#include <common/test.h>
+
+START(pid, tid, d0, d1, d2, d3)
+{
+ UNUSED(d2);
+ UNUSED(d3);
+
+ printf("pid = %ld, tid = %ld, d0 = %ld, d1 = %ld\n",
+ pid, tid, d0, d1);
+
+ check(pid == 0, "unexpected pid for spawn\n");
+ check(tid == 2, "unexpected tid for spawn\n");
+ check(d0 == SYS_USER_SPAWNED, "unexpected d0 for spawn\n");
+ check(d1 == 2, "unexpected d1 for spawn\n");
+
+ printf("causing shutdown, assuming init gave us CAP_POWER\n");
+ ok();
+}