Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/dev/sysmon Include better diagnostic info when a requi...
details: https://anonhg.NetBSD.org/src/rev/cd98b63c6a4e
branches: trunk
changeset: 807836:cd98b63c6a4e
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Thu Apr 23 23:23:28 2015 +0000
description:
Include better diagnostic info when a required key value cannot be retrieved from envstat -x
diffstat:
tests/dev/sysmon/t_swsensor.sh | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (24 lines):
diff -r e8e4ec573a29 -r cd98b63c6a4e tests/dev/sysmon/t_swsensor.sh
--- a/tests/dev/sysmon/t_swsensor.sh Thu Apr 23 23:23:20 2015 +0000
+++ b/tests/dev/sysmon/t_swsensor.sh Thu Apr 23 23:23:28 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_swsensor.sh,v 1.8 2015/02/27 09:16:07 martin Exp $
+# $NetBSD: t_swsensor.sh,v 1.9 2015/04/23 23:23:28 pgoyette Exp $
get_sensor_info() {
rump.envstat -x | \
@@ -6,7 +6,13 @@
}
get_sensor_key() {
- get_sensor_info | grep -A1 $1 | grep integer | sed -e 's;<[/a-z]*>;;g'
+ local v
+ v=$(get_sensor_info | grep -A1 $1 | grep integer | \
+ sed -e 's;<[/a-z]*>;;g')
+ if [ -z "$v" ] ; then
+ v="key_$1_not_found"
+ fi
+ echo $v
}
get_powerd_event_count() {
Home |
Main Index |
Thread Index |
Old Index