_acs-tcl__site_node_get_children (private)
_acs-tcl__site_node_get_children
Defined in packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ # # Check if the number of nodes in the system is large, and avoid testing # on all children if that is the case, as it can take too long # set max_nodes 1000 set current_nodes [db_string nodes_number {select count(1) from site_nodes}] if {$current_nodes > $max_nodes} { set all_switch {} aa_log "Large number of nodes ($current_nodes > $max_nodes), testing only the root node and its direct children" } else { set all_switch {-all} } # # Start with a known site-map entry # set node_id [site_node::get_node_id -url "/"] set child_node_ids [site_node::get_children -element node_id {*}$all_switch -node_id $node_id] # # Check that site_node::get_children does not return the root node # (lsearch returns '-1' if not found) # aa_equals "site_node::get_children does not return root node" [lsearch -exact $child_node_ids $node_id] -1 # # Filter by package_key should be equivalent to using -package_key # set nodes [site_node::get_children -element node_id {*}$all_switch -node_id $node_id -filters { package_key "acs-admin" }] aa_equals "package_key arg. identical to -filters" [site_node::get_children -element node_id {*}$all_switch -node_id $node_id -package_key "acs-admin"] $nodes aa_equals "Found exactly one acs-admin node" [llength $nodes] 1 # # Filtering by package_type should be equivalent to using -package_type # set nodes [site_node::get_children -element node_id {*}$all_switch -node_id $node_id -filters { package_type "apm_service" }] aa_equals "package_type arg. identical to filter_element package_type" [site_node::get_children -element node_id {*}$all_switch -node_id $node_id -package_type "apm_service"] $nodes aa_true "Found at least one apm_service node" {[llength $nodes] > 0} # # Check for nonexistent package_type # aa_true "No nodes with package type 'foo'" {[llength [site_node::get_children -element node_id {*}$all_switch -node_id $node_id -package_type "foo"]] == 0} }} { aa_log "Running testcase body $body_count" set ::__aa_test_indent [info level] set catch_val [catch $testcase_body msg] if {$catch_val != 0 && $catch_val != 2} { aa_log_result "fail" "site_node_get_children (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle