summaryrefslogtreecommitdiffstats
path: root/testsuite/buildok/scsi.stp
diff options
context:
space:
mode:
authordsmith <dsmith>2006-07-19 19:41:37 +0000
committerdsmith <dsmith>2006-07-19 19:41:37 +0000
commita9a80c9b77ced06b0939ad2b2c0160c5e527e8ed (patch)
tree91270e59154c44d126cf148aa5879d351423c726 /testsuite/buildok/scsi.stp
parent0bdb0b6f10f4e0204f13969fe2d1c972c380d73e (diff)
downloadsystemtap-steved-a9a80c9b77ced06b0939ad2b2c0160c5e527e8ed.tar.gz
systemtap-steved-a9a80c9b77ced06b0939ad2b2c0160c5e527e8ed.tar.xz
systemtap-steved-a9a80c9b77ced06b0939ad2b2c0160c5e527e8ed.zip
2006-07-19 David Smith <dsmith@redhat.com>
* testsuite/buildok/scsi.stp: Only run the scsi test if the scsi kernel subsystem is running.
Diffstat (limited to 'testsuite/buildok/scsi.stp')
-rwxr-xr-xtestsuite/buildok/scsi.stp17
1 files changed, 16 insertions, 1 deletions
diff --git a/testsuite/buildok/scsi.stp b/testsuite/buildok/scsi.stp
index 82eee0a5..e058327f 100755
--- a/testsuite/buildok/scsi.stp
+++ b/testsuite/buildok/scsi.stp
@@ -1,4 +1,18 @@
-#! stap -p4
+#! /bin/sh
+
+# This test should only be run when the scsi module is loaded (or scsi
+# functionality is built into the kernel).
+
+# We test for scsi functionality by grepping in /proc/kallsyms for
+# 'scsi_dispatch_cmd', which is what 'scsi.iodispatching' maps to.
+# If that mapping changes this grep command will also need changing.
+if ! grep scsi_dispatch_cmd /proc/kallsyms >/dev/null 2>&1 ; then
+ echo "scsi funtionality not present - not running test";
+ exit 0;
+fi
+
+
+./stap -p4 - << EOF
probe scsi.ioentry
{
printf("ppname: %s, %d, %d, %d\n", probefunc(),
@@ -26,3 +40,4 @@ probe scsi.iocompleted
host_no, channel, lun, dev_id, device_state, data_direction,
goodbytes)
}
+EOF