_acs-authentication__auth__get_register_authority (private)

 _acs-authentication__auth__get_register_authority

Defined in packages/acs-authentication/tcl/test/authentication-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 aa_equals aa_equals (public) aa_log aa_log (public) aa_log_result aa_log_result (public) aa_run_with_teardown aa_run_with_teardown (public) aa_silence_log_entries aa_silence_log_entries (public) _acs-authentication__auth__get_register_authority _acs-authentication__auth__get_register_authority _acs-authentication__auth__get_register_authority->aa_equals _acs-authentication__auth__get_register_authority->aa_log _acs-authentication__auth__get_register_authority->aa_log_result _acs-authentication__auth__get_register_authority->aa_run_with_teardown _acs-authentication__auth__get_register_authority->aa_silence_log_entries

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
        aa_run_with_teardown  -rollback  -test_code {
                set register_authority [auth::get_register_authority]

                # Set all authorities as the register authority one by
                # one and see that the proc returns the expected
                # value.
                db_foreach get_authorities {
                    select authority_id,
                           short_name,
                           register_impl_id
                    from auth_authorities
                } {
                    aa_log "Setting '$short_name' as the registration authority"
                    parameter::set_from_package_key  -parameter RegisterAuthority  -package_key "acs-authentication"  -value $short_name
                    if { $register_impl_id eq "" } {
                        aa_log "Authority '$short_name' does not have a register implementation, fallback to local authority"
                        set reg_authority_id [auth::authority::local]
                    } else {
                        aa_log "Authority '$short_name' has a register implementation"
                        set reg_authority_id $authority_id
                    }
                    aa_equals "Register authority '$short_name' should be picked correctly"  $reg_authority_id [auth::get_register_authority]

                }

                # Finally, try a bogus one.
                set not_exists [db_string get_bogus_authority {
                    select '0' || min(short_name) from auth_authorities
                }]
                parameter::set_from_package_key  -parameter RegisterAuthority  -package_key "acs-authentication"  -value $not_exists
                aa_silence_log_entries -severities error {
                    aa_equals "Non existent register authority '$not_exists' falls back to the local authority"  [auth::authority::local] [auth::get_register_authority]
                }

                #
                # Put the authority back as it was to not pollute
                # the cache.
                #
                parameter::set_from_package_key  -parameter RegisterAuthority  -package_key "acs-authentication"  -value $register_authority
            }
    }} {
          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" "auth__get_register_authority (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: