Saturday, January 21, 2006

Testing DTraceToolkit


I have started to help Brendan to test every DTraceToolkit script and write some more documentation about DTT. Why ? Well simple put it because DTraceToolkit (call it DTT) is already a big toolkit with lots of interesting and smart scripts ready to be used within companies and businesses I would say. What I was looking for was to make sure the DTT was tested and 'certified' for a certain Solaris version release.

So, looks like Im in charge of designing some simple test procedures for DTT scripts. First of all I should be able to create an automated script which will test every DTT category and report several numbers back: time spent to execute the script, if the script was executed fine or not. Doing this we could ensure that DTT works fine on a newer version of Solaris Express or S10. In the same time I started to record all defects or RFEs related with these and document and submit to Brendan. We might need to think for a better bugtracking system...

So this way I started to write dttck - The DTraceToolkit Checker. For fun this is what dttck does at the moment:


sparvu@earth>./dttck
Check DTrace privileges - ok
Usage: dttck [options] [script...]
options:
    -A All scripts
    -a apps scripts
    -c cpu scripts
    -d disk scripts
    -e extra scripts
    -l locks scripts
    -m mem scripts
    -n net scripts
    -s system scripts
    -u user scripts
    -r regression
    -o output report
    -q quiet mode


The script can be used to select certain categories or run individual scripts. Example below how Im testing the Apps category:

sparvu@earth>./dttck -a
Check DTrace privileges - ok

Category: Apps
Scripts: all
Date: 2006-01-26 22:20:04
Number of scripts: 4
     script: httpdstat.d - ok
     script: weblatency.d - ok
     script: shellsnoop - ok
     script: nfswizard.d - ok
Elapsed time: 16 sec(s)


The entire Apps category was tested by firing each script. The checker does record the trace for every run under a report directory called something like: hostname_datetime. E.g.: earth_200601262220, where every script will record its execution trace. At the end a final report file would be compiled gathering all data:

sparvu@earth>ls
Apps.httpdstat.d.out Apps.shellsnoop.out report_earth_200601262220
Apps.nfswizard.d.out Apps.weblatency.d.out

sparvu@earth>cat report_earth_200601262220

REPORT QA DTraceToolkit

DTraceToolkit version 0.92, 12-Jan-2006
Operating System: SunOS 5.11 snv_31 i386

Category: Apps
Scripts: all
Date: 2006-01-26 22:20:04
Number of scripts: 4
     script: httpdstat.d - ok
     script: weblatency.d - ok
     script: shellsnoop - ok
     script: nfswizard.d - ok
Elapsed time: 16 sec(s)


Summary Report

Categories: 1
Failed Scripts: 0/4
Passed Scripts: 4/4
Total Elapsed time: 16 secs

Report generated by: sparvu



There are many things to fix and refine in DTT. I think that DTT is a powerful toolkit which should be used within companies. That's why Im dedicated my time testing and documenting various parts of it. There are no such toolkits under Windows, HPUX, or any other Linux based systems making Solaris a very nice platform for production and development.