Merging release 2.0 branch with CVS trunk
r2601 | ffr | 2008-05-30 10:26:57 +1000 (Fri, 30 May 2008) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
4a937e1608
commit
0749b0effa
40
site_ansto/instrument/util/check/check_hdb.tcl
Normal file
40
site_ansto/instrument/util/check/check_hdb.tcl
Normal file
@@ -0,0 +1,40 @@
|
||||
## \file
|
||||
# Must be loaded into an instance of SICS with fileeval
|
||||
# eg
|
||||
# fileeval tests/query_sics.tcl
|
||||
fileeval util/check/query_sics.tcl
|
||||
set hdb_prop_list {
|
||||
{control data} {true false}
|
||||
}
|
||||
proc checknode {node} {
|
||||
global hdb_prop_list
|
||||
foreach {att v} $hdb_prop_list {
|
||||
foreach a $att {
|
||||
set query "$a @missing"
|
||||
if {[query_propval $node $query]} {
|
||||
clientput "$node: $a is missing"
|
||||
continue
|
||||
}
|
||||
set query "$a \{$v\}"
|
||||
if {![query_propval $node $query]} {
|
||||
clientput "$node: $a should be one of ($v) not [::utility::hgetplainprop $node $a]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
proc checkhdb {{hpath "/"}} {
|
||||
global hdb_prop_list
|
||||
if {$hpath == "/"} {
|
||||
foreach hp [hlist /] {
|
||||
checknode /$hp
|
||||
checkhdb /$hp
|
||||
}
|
||||
clientput OK
|
||||
} else {
|
||||
foreach hp [hlist $hpath] {
|
||||
checknode $hpath/$hp
|
||||
checkhdb $hpath/$hp
|
||||
}
|
||||
}
|
||||
}
|
||||
publish checkhdb user
|
||||
Reference in New Issue
Block a user