39 lines
1.8 KiB
C
39 lines
1.8 KiB
C
/* Exercise only the chooser after discovery; loopback_fixture.py covers the socket. */
|
|
#define GW_ACCOUNT_IDLE_TEST 1
|
|
#include "source_profile5_worker_fixture.c"
|
|
|
|
int main(void){
|
|
configure();
|
|
owned_endpoint.kind=1;
|
|
select_source_singleton(1,1,0);
|
|
check(gw_wire_auth_data.selected_index==0,137);
|
|
gw_wire_auth_data.selected_index=-1;
|
|
gw_wire_account_ui_activate();
|
|
select_source_singleton(1,1,0);
|
|
check(gw_wire_auth_data.selected_index==-1,138);
|
|
gw_wire_auth_data.selected_index=1;
|
|
select_source_singleton(1,1,0);
|
|
check(gw_wire_auth_data.selected_index==1,139);
|
|
for(chooser_test=select_after_idle;chooser_test<=missed_deadline;chooser_test++){
|
|
configure();
|
|
gw_wire_auth_data.state=5;
|
|
gw_wire_auth_data.retention_ms=120000;
|
|
gw_wire_auth_data.server_proof_verified=1;
|
|
struct gw_wire_call call={.login=11};
|
|
ULONGLONG began=chooser_clock, retention_start=began;
|
|
singleton_waits=chooser_refreshes=0;
|
|
int success=wait_for_source_realm_choice(&call,2,&retention_start);
|
|
if(chooser_test==select_after_idle){
|
|
check(success && chooser_refreshes==5 && gw_wire_auth_data.selected_index==1,131);
|
|
check(chooser_clock-began==180000 && !expired(retention_start),132);
|
|
}else{
|
|
check(chooser_refreshes==(chooser_test==missed_deadline?0u:1u),133);
|
|
check(retention_start==began && gw_wire_auth_data.selected_index==-1,134);
|
|
if(chooser_test==refuse_refresh)check(!success && gw_wire_auth_data.discovery_result==-2,135);
|
|
else check(success && expired(retention_start),136);
|
|
}
|
|
}
|
|
message("First-login LOCAL singleton picker, existing choice and headless fallback passed; idle chooser passed 180s, refused reply, cancellation and expired lifetime\n");
|
|
return 0;
|
|
}
|