Files
sics/site_ansto/instrument/util/check/check_hdb.tcl
Ferdi Franceschini 0749b0effa Merging release 2.0 branch with CVS trunk
r2601 | ffr | 2008-05-30 10:26:57 +1000 (Fri, 30 May 2008) | 2 lines
2012-11-15 13:38:17 +11:00

41 lines
898 B
Tcl

## \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