summaryrefslogtreecommitdiffstats
path: root/testsuite/lib
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/lib')
-rw-r--r--testsuite/lib/stap_run.exp11
-rw-r--r--testsuite/lib/systemtap.exp16
2 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/lib/stap_run.exp b/testsuite/lib/stap_run.exp
index ff93ed8a..c9131562 100644
--- a/testsuite/lib/stap_run.exp
+++ b/testsuite/lib/stap_run.exp
@@ -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)+$"
diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp
index 6c8ed540..5b08c233 100644
--- a/testsuite/lib/systemtap.exp
+++ b/testsuite/lib/systemtap.exp
@@ -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 {} {}