From e41dec42de3cf3881c0c5ba79a4938c9158b041f Mon Sep 17 00:00:00 2001 From: hunt Date: Mon, 7 May 2007 17:11:49 +0000 Subject: 2007-05-07 Martin Hunt PR4466 * systemtap.samples/system_func.stp: Rewrite test to account for probes not being placed until after begin. * systemtap.samples/system_func.exp: Only expect 1 sys_open. --- testsuite/systemtap.samples/system_func.stp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'testsuite/systemtap.samples/system_func.stp') diff --git a/testsuite/systemtap.samples/system_func.stp b/testsuite/systemtap.samples/system_func.stp index 60d9a723..0b074514 100644 --- a/testsuite/systemtap.samples/system_func.stp +++ b/testsuite/systemtap.samples/system_func.stp @@ -2,20 +2,27 @@ # test the system() function +global saw_echo + probe kernel.function("sys_open") { - # very inefficient. Testing only. DO NOT DO THIS - msg="echo sys_open" - system(msg) + 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__") } +probe timer.ms(110) { exit() } + probe begin { # should succeed system("whoami") - - # should fail - system("cat __xyzzy123ABC__") - - exit() } probe end { -- cgit