This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Proposal for small addition to testsuite output
Hi,
As discussed in the meeting, I made a small change to
systemtap.exp and stap_run.exp for labrat.
Please kindly review the patch. If no objection, I will commit it.
Thanks,
Wenji
--- src/testsuite/lib/systemtap.exp 2007-09-27 10:59:56.000000000 -0400
+++ src.new/testsuite/lib/systemtap.exp 2007-09-27 10:56:53.000000000 -0400
@@ -49,9 +49,25 @@ proc setup_systemtap_environment {} {
}
}
+proc get_system_info {} {
+ global Host Snapshot Distro env
+
+ set Host [exec /bin/uname -a]
+ if [file exists $env(SRCDIR)/../SNAPSHOT] {
+ set Snapshot [exec /bin/cat $env(SRCDIR)/../SNAPSHOT]
+ } else {
+ set Snapshot "unknown"
+ }
+ set Distro "Linux"
+ if [file exists /etc/fedora-release] {set Distro [exec /bin/cat /etc/fedora-release]}
+ if [file exists /etc/redhat-release] {set Distro [exec /bin/cat /etc/redhat-release]}
+ if [file exists /etc/suse-release] {set Distro [exec /bin/cat /etc/suse-release]}
+ if [file exists /etc/debian_version] {set Distro [exec /bin/cat /etc/debian_version]}
+}
setup_systemtap_environment
print_systemtap_version
+get_system_info
proc systemtap_init {args} {}
proc systemtap_version {} {}
--- src/testsuite/lib/stap_run.exp 2007-09-27 10:59:56.000000000 -0400
+++ src.new/testsuite/lib/stap_run.exp 2007-09-27 10:56:53.000000000 -0400
@@ -86,5 +86,16 @@ proc no_load {} {
return 0
}
+proc print_system_info {} {
+ global Host Snapshot Distro
+
+ clone_output "\nHost: $Host"
+ if {[string compare $Snapshot "unknown"]!=0} {
+ clone_output "Snapshot: $Snapshot"
+ }
+ clone_output "Distro: $Distro\n"
+}
+
+print_system_info
# tests better all be true
set all_pass_string "(systemtap test success\r\n)+$"