diff --git a/base/run/cap_integrity.run b/base/run/cap_integrity.run
new file mode 100644
index 0000000000..81b8a5b0b8
--- /dev/null
+++ b/base/run/cap_integrity.run
@@ -0,0 +1,39 @@
+build "core init test/cap_integrity"
+
+create_boot_directory
+
+install_config {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+build_boot_image "core init test-cap_integrity"
+
+append qemu_args "-nographic -m 64"
+
+# increase expect buffer size, since there might be many log messages
+match_max -d 100000
+
+run_genode_until {child exited with exit value 0.*} 60
+
+if {[regexp {\[init\] test message} $output]} {
+ exit -1
+}
+
+puts "Test succeeded"
diff --git a/base/src/test/cap_integrity/main.cc b/base/src/test/cap_integrity/main.cc
new file mode 100644
index 0000000000..662970b65a
--- /dev/null
+++ b/base/src/test/cap_integrity/main.cc
@@ -0,0 +1,36 @@
+/*
+ * \brief Testing capability integrity
+ * \author Christian Prochaska
+ * \date 2012-02-10
+ *
+ */
+
+/*
+ * Copyright (C) 2008-2012 Genode Labs GmbH
+ *
+ * This file is part of the Genode OS framework, which is distributed
+ * under the terms of the GNU General Public License version 2.
+ */
+
+#include
+#include
+
+using namespace Genode;
+
+int main(int argc, char **argv)
+{
+ printf("--- capability integrity test ---\n");
+
+ /* try the first 1000 local name IDs */
+ for (int local_name = 0; local_name < 1000; local_name++) {
+ Log_session_capability log_session_cap =
+ reinterpret_cap_cast(Native_capability(env()->ram_session_cap().dst(), local_name));
+ Log_session_client log_session_client(log_session_cap);
+ try {
+ log_session_client.write("test message");
+ } catch(...) { }
+ }
+
+ printf("--- finished capability integrity test ---\n");
+ return 0;
+}
diff --git a/base/src/test/cap_integrity/target.mk b/base/src/test/cap_integrity/target.mk
new file mode 100644
index 0000000000..024b16ca49
--- /dev/null
+++ b/base/src/test/cap_integrity/target.mk
@@ -0,0 +1,3 @@
+TARGET = test-cap_integrity
+SRC_CC = main.cc
+LIBS = env