1818using namespace srsran ;
1919using namespace srs_cu_up ;
2020
21- // / Fixture class for UE manager tests
22- class pdu_session_manager_test : public ::testing::Test
21+ const network_interface_config net_config_default = {};
22+
23+ // / Fixture base class for PDU session manager tests
24+ class pdu_session_manager_test_base
2325{
2426protected:
25- void SetUp () override
27+ virtual ~pdu_session_manager_test_base () = default ;
28+ virtual network_interface_config get_net_config () = 0;
29+
30+ void init ()
2631 {
2732 srslog::fetch_basic_logger (" TEST" ).set_level (srslog::basic_levels::debug);
2833 srslog::init ();
@@ -42,6 +47,7 @@ class pdu_session_manager_test : public ::testing::Test
4247
4348 manual_task_worker teid_worker{128 };
4449
50+ net_config = get_net_config ();
4551 pdu_session_mng = std::make_unique<pdu_session_manager_impl>(MIN_UE_INDEX,
4652 qos,
4753 security_info,
@@ -63,7 +69,7 @@ class pdu_session_manager_test : public ::testing::Test
6369 gtpu_pcap);
6470 }
6571
66- void TearDown () override
72+ void finish ()
6773 {
6874 // flush logger after each test
6975 srslog::flush ();
@@ -86,6 +92,30 @@ class pdu_session_manager_test : public ::testing::Test
8692 cu_up_ue_logger logger{" CU-UP" , {MIN_UE_INDEX}};
8793};
8894
95+ // / Fixture class for PDU session manager tests with default network interface config
96+ class pdu_session_manager_test : public pdu_session_manager_test_base , public ::testing::Test
97+ {
98+ protected:
99+ network_interface_config get_net_config () override { return net_config_default; }
100+ void SetUp () override { init (); }
101+ void TearDown () override { finish (); }
102+ };
103+
104+ // / Fixture class for PDU session manager tests with configurable N3 ext addr
105+ class pdu_session_manager_test_set_n3_ext_addr : public pdu_session_manager_test_base ,
106+ public ::testing::TestWithParam<const char *>
107+ {
108+ protected:
109+ network_interface_config get_net_config () override
110+ {
111+ network_interface_config cfg = net_config_default;
112+ cfg.n3_ext_addr = GetParam ();
113+ return cfg;
114+ }
115+ void SetUp () override { init (); }
116+ void TearDown () override { finish (); }
117+ };
118+
89119inline e1ap_pdu_session_res_to_setup_item
90120generate_pdu_session_res_to_setup_item (pdu_session_id_t psi, drb_id_t drb_id, qos_flow_id_t qfi, five_qi_t five_qi)
91121{
0 commit comments