@@ -7,7 +7,6 @@ use std::num::NonZeroU32;
77use chrono:: Utc ;
88use dropshot:: test_util:: ClientTestContext ;
99use dropshot:: { HttpErrorResponseBody , ResultsPage } ;
10- use gateway_test_utils:: setup:: DEFAULT_SP_SIM_CONFIG ;
1110use nexus_auth:: authn:: USER_TEST_UNPRIVILEGED ;
1211use nexus_config:: NexusConfig ;
1312use nexus_db_queries:: db:: fixed_data:: silo:: DEFAULT_SILO ;
@@ -21,7 +20,6 @@ use nexus_test_utils::{
2120 http_testing:: { AuthnMode , NexusRequest , RequestBuilder } ,
2221 resource_helpers:: grant_iam,
2322} ;
24- use nexus_test_utils:: { load_test_config, test_setup_with_config} ;
2523use nexus_test_utils_macros:: nexus_test;
2624use nexus_types:: external_api:: { params, views} ;
2725use nexus_types:: external_api:: {
@@ -33,7 +31,6 @@ use nexus_types::external_api::{
3331use omicron_uuid_kinds:: SiloUserUuid ;
3432
3533use http:: { StatusCode , header, method:: Method } ;
36- use omicron_sled_agent:: sim;
3734use oxide_client:: types:: { FleetRole , SiloRole } ;
3835use serde:: Deserialize ;
3936use tokio:: time:: { Duration , sleep} ;
@@ -994,34 +991,38 @@ async fn test_admin_logout_deletes_tokens_and_sessions(
994991#[ tokio:: test]
995992async fn test_session_list_excludes_expired ( ) {
996993 // Test with default TTL - session should not be expired
997- let mut config = load_test_config ( ) ;
998- test_session_list_with_config ( & mut config, 1 ) . await ;
994+ test_session_list_with_config ( & |_config| ( ) , 1 ) . await ;
999995
1000996 // Test with idle TTL = 0 - session should be expired immediately
1001- let mut config = load_test_config ( ) ;
1002- config. pkg . console . session_idle_timeout_minutes = 0 ;
1003- test_session_list_with_config ( & mut config, 0 ) . await ;
997+ test_session_list_with_config (
998+ & |config| {
999+ config. pkg . console . session_idle_timeout_minutes = 0 ;
1000+ } ,
1001+ 0 ,
1002+ )
1003+ . await ;
10041004
10051005 // Test with abs TTL = 0 - session should be expired immediately
1006- let mut config = load_test_config ( ) ;
1007- config. pkg . console . session_absolute_timeout_minutes = 0 ;
1008- test_session_list_with_config ( & mut config, 0 ) . await ;
1006+ test_session_list_with_config (
1007+ & |config| {
1008+ config. pkg . console . session_absolute_timeout_minutes = 0 ;
1009+ } ,
1010+ 0 ,
1011+ )
1012+ . await ;
10091013}
10101014
10111015/// Set up a test context with the given config, create a user in the test suite
10121016/// silo, and create a session, and assert about the length of the session list
10131017async fn test_session_list_with_config (
1014- config : & mut NexusConfig ,
1018+ modify_config : & dyn Fn ( & mut NexusConfig ) -> ( ) ,
10151019 expected_sessions : usize ,
10161020) {
1017- let cptestctx = test_setup_with_config :: < omicron_nexus :: Server > (
1021+ let cptestctx = nexus_test_utils :: ControlPlaneBuilder :: new (
10181022 "test_session_list_excludes_expired" ,
1019- config,
1020- sim:: SimMode :: Explicit ,
1021- None ,
1022- 0 ,
1023- DEFAULT_SP_SIM_CONFIG . into ( ) ,
10241023 )
1024+ . customize_nexus_config ( modify_config)
1025+ . start :: < omicron_nexus:: Server > ( )
10251026 . await ;
10261027 let testctx = & cptestctx. external_client ;
10271028
0 commit comments