From 9fbda39bf7687ceeee28813f30f6e3ec5c72fc5d Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 29 Jan 2009 16:55:06 -0500 Subject: Move some systemtap.sample tests to systemtap.base. --- testsuite/systemtap.base/system_func.stp | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 testsuite/systemtap.base/system_func.stp (limited to 'testsuite/systemtap.base/system_func.stp') diff --git a/testsuite/systemtap.base/system_func.stp b/testsuite/systemtap.base/system_func.stp new file mode 100644 index 00000000..d14fb25b --- /dev/null +++ b/testsuite/systemtap.base/system_func.stp @@ -0,0 +1,35 @@ +#! stap + +# test the system() function + +global saw_echo, did_cat + +probe kernel.function("sys_open") { + if (!saw_echo) { + # very inefficient. Testing only. DO NOT DO THIS + msg="echo sys_open" + system(msg) + saw_echo = 1 + } +} + +probe timer.ms(100) { + # should fail + system("cat __xyzzy123ABC__") + did_cat = 1 +} + +probe timer.ms(150) { + if (saw_echo && did_cat) + exit() +} + +probe begin { + # should succeed + system("whoami") +} + +probe end { + # should succeed + system("echo DONE") +} -- cgit