diff --git a/tests/test_utils/config_builder.py b/tests/test_utils/config_builder.py
new file mode 100644
index 0000000..f662b9f
--- /dev/null
+++ b/tests/test_utils/config_builder.py
@@ -0,0 +1,123 @@
+"""
+Copyright 2020 The Magma Authors.
+
+This source code is licensed under the BSD-style license found in the
+LICENSE file in the root directory of this source tree.
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+from lte.protos.mconfig import mconfigs_pb2
+from devices.device_utils import EnodebDeviceName
+
+
+class EnodebConfigBuilder:
+    @classmethod
+    def get_mconfig(
+        cls,
+        device: EnodebDeviceName = EnodebDeviceName.BAICELLS,
+    ) -> mconfigs_pb2.EnodebD:
+        mconfig = mconfigs_pb2.EnodebD()
+        mconfig.bandwidth_mhz = 20
+        # This earfcndl is actually unused, remove later
+        mconfig.earfcndl = 44490
+        mconfig.log_level = 1
+        mconfig.plmnid_list = "00101"
+        mconfig.pci = 260
+        mconfig.allow_enodeb_transmit = False
+        mconfig.tac = 1
+        if device is EnodebDeviceName.BAICELLS_QAFB:
+            # fdd config
+            mconfig.fdd_config.earfcndl = 9211
+        elif device is EnodebDeviceName.CAVIUM:
+            # fdd config
+            mconfig.fdd_config.earfcndl = 2405
+        else:
+            # tdd config
+            mconfig.tdd_config.earfcndl = 39150
+            mconfig.tdd_config.subframe_assignment = 2
+            mconfig.tdd_config.special_subframe_pattern = 7
+
+        return mconfig
+
+    @classmethod
+    def get_multi_enb_mconfig(
+        cls,
+    ) -> mconfigs_pb2.EnodebD:
+        mconfig = mconfigs_pb2.EnodebD()
+        mconfig.bandwidth_mhz = 20
+        mconfig.special_subframe_pattern = 7
+        # This earfcndl is actually unused, remove later
+        mconfig.earfcndl = 44490
+        mconfig.log_level = 1
+        mconfig.plmnid_list = "00101"
+        mconfig.pci = 260
+        mconfig.allow_enodeb_transmit = False
+        mconfig.subframe_assignment = 2
+        mconfig.tac = 1
+
+        # tdd config, unused because of multi-enb config
+        mconfig.tdd_config.earfcndl = 39150
+        mconfig.tdd_config.subframe_assignment = 2
+        mconfig.tdd_config.special_subframe_pattern = 7
+
+        id1 = '120200002618AGP0003'
+        #enb_conf_1 = mconfigs_pb2.EnodebD.EnodebConfig()
+        mconfig.enb_configs_by_serial[id1]\
+                .earfcndl = 39151
+        mconfig.enb_configs_by_serial[id1]\
+                .subframe_assignment = 2
+        mconfig.enb_configs_by_serial[id1]\
+                .special_subframe_pattern = 7
+        mconfig.enb_configs_by_serial[id1]\
+                .pci = 259
+        mconfig.enb_configs_by_serial[id1]\
+                .bandwidth_mhz = 20
+        mconfig.enb_configs_by_serial[id1] \
+            .tac = 1
+        mconfig.enb_configs_by_serial[id1] \
+            .cell_id = 0
+        mconfig.enb_configs_by_serial[id1]\
+            .transmit_enabled = True
+        mconfig.enb_configs_by_serial[id1]\
+            .device_class = 'Baicells Band 40'
+
+        id2 = '120200002618AGP0004'
+        #enb_conf_2 = mconfigs_pb2.EnodebD.EnodebConfig()
+        mconfig.enb_configs_by_serial[id2]\
+                .earfcndl = 39151
+        mconfig.enb_configs_by_serial[id2]\
+                .subframe_assignment = 2
+        mconfig.enb_configs_by_serial[id2]\
+                .special_subframe_pattern = 7
+        mconfig.enb_configs_by_serial[id2]\
+                .pci = 261
+        mconfig.enb_configs_by_serial[id2] \
+            .bandwidth_mhz = 20
+        mconfig.enb_configs_by_serial[id2] \
+            .tac = 1
+        mconfig.enb_configs_by_serial[id2] \
+            .cell_id = 0
+        mconfig.enb_configs_by_serial[id2]\
+                .transmit_enabled = True
+        mconfig.enb_configs_by_serial[id2]\
+                .device_class = 'Baicells Band 40'
+
+        return mconfig
+
+    @classmethod
+    def get_service_config(cls):
+        return {
+            "tr069": {
+                "interface": "eth1",
+                "port": 48080,
+                "perf_mgmt_port": 8081,
+                "public_ip": "192.88.99.142",
+            },
+            "reboot_enodeb_on_mme_disconnected": True,
+            "s1_interface": "eth1",
+        }
diff --git a/tests/test_utils/enb_acs_builder.py b/tests/test_utils/enb_acs_builder.py
new file mode 100644
index 0000000..75f55be
--- /dev/null
+++ b/tests/test_utils/enb_acs_builder.py
@@ -0,0 +1,92 @@
+"""
+Copyright 2020 The Magma Authors.
+
+This source code is licensed under the BSD-style license found in the
+LICENSE file in the root directory of this source tree.
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+import asyncio
+from typing import Dict
+from unittest import mock
+
+from lte.protos.mconfig import mconfigs_pb2
+from common.service import MagmaService
+from devices.device_map import get_device_handler_from_name
+from devices.device_utils import EnodebDeviceName
+from state_machines.enb_acs import EnodebAcsStateMachine
+from state_machines.enb_acs_manager import StateMachineManager
+from tests.test_utils.config_builder import EnodebConfigBuilder
+
+
+class EnodebAcsStateMachineBuilder:
+    @classmethod
+    def build_acs_manager(
+        cls,
+        device: EnodebDeviceName = EnodebDeviceName.BAICELLS,
+    ) -> StateMachineManager:
+        service = cls.build_magma_service(device)
+        return StateMachineManager(service)
+
+    @classmethod
+    def build_multi_enb_acs_manager(
+        cls,
+    ) -> StateMachineManager:
+        service = cls.build_multi_enb_magma_service()
+        return StateMachineManager(service)
+
+    @classmethod
+    def build_multi_enb_acs_state_machine(
+        cls,
+        device: EnodebDeviceName = EnodebDeviceName.BAICELLS,
+    ) -> EnodebAcsStateMachine:
+        # Build the state_machine
+        service = cls.build_multi_enb_magma_service()
+        handler_class = get_device_handler_from_name(device)
+        acs_state_machine = handler_class(service)
+        return acs_state_machine
+
+    @classmethod
+    def build_acs_state_machine(
+        cls,
+        device: EnodebDeviceName = EnodebDeviceName.BAICELLS,
+    ) -> EnodebAcsStateMachine:
+        # Build the state_machine
+        service = cls.build_magma_service(device)
+        handler_class = get_device_handler_from_name(device)
+        acs_state_machine = handler_class(service)
+        return acs_state_machine
+
+    @classmethod
+    def build_magma_service(
+        cls,
+        device: EnodebDeviceName = EnodebDeviceName.BAICELLS,
+            mconfig: mconfigs_pb2.EnodebD = None,
+            service_config: Dict = None,
+    ) -> MagmaService:
+        event_loop = asyncio.get_event_loop()
+        if not mconfig:
+            mconfig = EnodebConfigBuilder.get_mconfig(device)
+        if not service_config:
+            service_config = EnodebConfigBuilder.get_service_config()
+        with mock.patch('magma.common.service.MagmaService') as MockService:
+            MockService.config = service_config
+            MockService.mconfig = mconfig
+            MockService.loop = event_loop
+            return MockService
+
+    @classmethod
+    def build_multi_enb_magma_service(cls) -> MagmaService:
+        event_loop = asyncio.get_event_loop()
+        mconfig = EnodebConfigBuilder.get_multi_enb_mconfig()
+        service_config = EnodebConfigBuilder.get_service_config()
+        with mock.patch('magma.common.service.MagmaService') as MockService:
+            MockService.config = service_config
+            MockService.mconfig = mconfig
+            MockService.loop = event_loop
+            return MockService
diff --git a/tests/test_utils/enodeb_handler.py b/tests/test_utils/enodeb_handler.py
new file mode 100644
index 0000000..ef2b11f
--- /dev/null
+++ b/tests/test_utils/enodeb_handler.py
@@ -0,0 +1,39 @@
+"""
+Copyright 2020 The Magma Authors.
+
+This source code is licensed under the BSD-style license found in the
+LICENSE file in the root directory of this source tree.
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+from unittest import TestCase, mock
+
+import magma.enodebd.tests.test_utils.mock_functions as enb_mock
+
+
+class EnodebHandlerTestCase(TestCase):
+    """
+    Sets up test class with a set of patches needed for eNodeB handlers
+    """
+
+    def setUp(self):
+        self.patches = {
+            enb_mock.GET_IP_FROM_IF_PATH:
+                mock.Mock(side_effect=enb_mock.mock_get_ip_from_if),
+            enb_mock.LOAD_SERVICE_MCONFIG_PATH:
+                mock.Mock(
+                    side_effect=enb_mock.mock_load_service_mconfig_as_json,
+                ),
+        }
+        self.applied_patches = [
+            mock.patch(patch, data) for patch, data in
+            self.patches.items()
+        ]
+        for patch in self.applied_patches:
+            patch.start()
+        self.addCleanup(mock.patch.stopall)
diff --git a/tests/test_utils/mock_functions.py b/tests/test_utils/mock_functions.py
new file mode 100644
index 0000000..59fb0c7
--- /dev/null
+++ b/tests/test_utils/mock_functions.py
@@ -0,0 +1,31 @@
+"""
+Copyright 2020 The Magma Authors.
+
+This source code is licensed under the BSD-style license found in the
+LICENSE file in the root directory of this source tree.
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+from typing import Any
+
+GET_IP_FROM_IF_PATH = \
+    'magma.enodebd.device_config.configuration_init.get_ip_from_if'
+
+LOAD_SERVICE_MCONFIG_PATH = \
+    'magma.enodebd.device_config.configuration_init.load_service_mconfig_as_json'
+
+
+def mock_get_ip_from_if(
+    _iface_name: str,
+    _preference: Any = None,
+) -> str:
+    return '192.168.60.142'
+
+
+def mock_load_service_mconfig_as_json(_service_name: str) -> Any:
+    return {}
diff --git a/tests/test_utils/spyne_builder.py b/tests/test_utils/spyne_builder.py
new file mode 100644
index 0000000..0717aad
--- /dev/null
+++ b/tests/test_utils/spyne_builder.py
@@ -0,0 +1,26 @@
+"""
+Copyright 2020 The Magma Authors.
+
+This source code is licensed under the BSD-style license found in the
+LICENSE file in the root directory of this source tree.
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+from unittest import mock
+
+from spyne.server.wsgi import WsgiMethodContext
+
+
+def get_spyne_context_with_ip(
+    req_ip: str = "192.168.60.145",
+) -> WsgiMethodContext:
+    with mock.patch('spyne.server.wsgi.WsgiApplication') as MockTransport:
+        MockTransport.req_env = {"REMOTE_ADDR": req_ip}
+        with mock.patch('spyne.server.wsgi.WsgiMethodContext') as MockContext:
+            MockContext.transport = MockTransport
+            return MockContext
diff --git a/tests/test_utils/tr069_msg_builder.py b/tests/test_utils/tr069_msg_builder.py
new file mode 100644
index 0000000..3dc0f64
--- /dev/null
+++ b/tests/test_utils/tr069_msg_builder.py
@@ -0,0 +1,1000 @@
+"""
+Copyright 2020 The Magma Authors.
+
+This source code is licensed under the BSD-style license found in the
+LICENSE file in the root directory of this source tree.
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+from typing import Any, List, Optional
+
+from tr069 import models
+
+
+class Tr069MessageBuilder:
+    @classmethod
+    def get_parameter_value_struct(
+            cls,
+            name: str,
+            val_type: str,
+            data: Any,
+    ) -> models.ParameterValueStruct:
+        param_value = models.ParameterValueStruct()
+        param_value.Name = name
+        value = models.anySimpleType()
+        value.type = val_type
+        value.Data = data
+        param_value.Value = value
+        return param_value
+
+    @classmethod
+    def get_fault(cls) -> models.Fault:
+        msg = models.Fault()
+        msg.FaultCode = 0
+        msg.FaultString = 'Some sort of fault'
+        return msg
+
+    @classmethod
+    def get_reboot_inform(cls) -> models.Inform:
+        msg = cls.get_inform()
+        events = []
+
+        event_boot = models.EventStruct()
+        event_boot.EventCode = '1 BOOT'
+        events.append(event_boot)
+
+        event_reboot = models.EventStruct()
+        event_reboot.EventCode = 'M Reboot'
+        events.append(event_reboot)
+
+        msg.Event.EventStruct = events
+        return msg
+
+    @classmethod
+    def get_qafb_inform(
+        cls,
+        oui: str = '48BF74',
+        sw_version: str = 'BaiBS_QAFB_1.6.4',
+        enb_serial: str = '1202000181186TB0006',
+        event_codes: Optional[List[str]] = None,
+    ) -> models.Inform:
+        if event_codes is None:
+            event_codes = []
+        msg = models.Inform()
+
+        # DeviceId
+        device_id = models.DeviceIdStruct()
+        device_id.Manufacturer = 'Unused'
+        device_id.OUI = oui
+        device_id.ProductClass = 'Unused'
+        device_id.SerialNumber = enb_serial
+        msg.DeviceId = device_id
+
+        # Event
+        msg.Event = models.EventList()
+        event_list = []
+        for code in event_codes:
+            event = models.EventStruct()
+            event.EventCode = code
+            event.CommandKey = ''
+            event_list.append(event)
+        msg.Event.EventStruct = event_list
+
+        # ParameterList
+        val_list = []
+        val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.DeviceInfo.HardwareVersion',
+                val_type='string',
+                data='VER.C',
+            ),
+        )
+        val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.DeviceInfo.ManufacturerOUI',
+                val_type='string',
+                data=oui,
+            ),
+        )
+        val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.DeviceInfo.SoftwareVersion',
+                val_type='string',
+                data=sw_version,
+            ),
+        )
+        val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.DeviceInfo.SerialNumber',
+                val_type='string',
+                data=enb_serial,
+            ),
+        )
+        val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.ManagementServer.ConnectionRequestURL',
+                val_type='string',
+                data='http://192.168.60.248:7547/25dbc91d31276f0cb03391160531ecae',
+            ),
+        )
+        msg.ParameterList = models.ParameterValueList()
+        msg.ParameterList.ParameterValueStruct = val_list
+
+        return msg
+
+        pass
+
+    @classmethod
+    def get_inform(
+        cls,
+        oui: str = '48BF74',
+        sw_version: str = 'BaiBS_RTS_3.1.6',
+        enb_serial: str = '120200002618AGP0003',
+        event_codes: Optional[List[str]] = None,
+    ) -> models.Inform:
+        if event_codes is None:
+            event_codes = []
+        msg = models.Inform()
+
+        # DeviceId
+        device_id = models.DeviceIdStruct()
+        device_id.Manufacturer = 'Unused'
+        device_id.OUI = oui
+        device_id.ProductClass = 'Unused'
+        device_id.SerialNumber = enb_serial
+        msg.DeviceId = device_id
+
+        # Event
+        msg.Event = models.EventList()
+        event_list = []
+        for code in event_codes:
+            event = models.EventStruct()
+            event.EventCode = code
+            event.CommandKey = ''
+            event_list.append(event)
+        msg.Event.EventStruct = event_list
+
+        # ParameterList
+        val_list = []
+        val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.DeviceInfo.HardwareVersion',
+                val_type='string',
+                data='VER.C',
+            ),
+        )
+        val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.DeviceInfo.ManufacturerOUI',
+                val_type='string',
+                data=oui,
+            ),
+        )
+        val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.DeviceInfo.SoftwareVersion',
+                val_type='string',
+                data=sw_version,
+            ),
+        )
+        val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.DeviceInfo.SerialNumber',
+                val_type='string',
+                data=enb_serial,
+            ),
+        )
+        val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.ManagementServer.ConnectionRequestURL',
+                val_type='string',
+                data='http://192.168.60.248:7547/25dbc91d31276f0cb03391160531ecae',
+            ),
+        )
+        msg.ParameterList = models.ParameterValueList()
+        msg.ParameterList.ParameterValueStruct = val_list
+
+        return msg
+
+    @classmethod
+    def get_qafb_read_only_param_values_response(
+        cls,
+    ) -> models.GetParameterValuesResponse:
+        msg = models.GetParameterValuesResponse()
+        param_val_list = []
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.1.LTE.X_QUALCOMM_FAPControl.OpState',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.1.LTE.X_QUALCOMM_FAPControl.OpState',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.1.LTE.X_QUALCOMM_FAPControl.OpState',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.FAP.GPS.latitude',
+                val_type='int',
+                data='0',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.FAP.GPS.longitude',
+                val_type='int',
+                data='0',
+            ),
+        )
+        msg.ParameterList = models.ParameterValueList()
+        msg.ParameterList.ParameterValueStruct = param_val_list
+        return msg
+
+    @classmethod
+    def get_read_only_param_values_response(
+        cls,
+    ) -> models.GetParameterValuesResponse:
+        msg = models.GetParameterValuesResponse()
+        param_val_list = []
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.FAPControl.LTE.OpState',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.FAPControl.LTE.RFTxStatus',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.DeviceInfo.X_BAICELLS_COM_GPS_Status',
+                val_type='boolean',
+                data='0',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.DeviceInfo.X_BAICELLS_COM_1588_Status',
+                val_type='boolean',
+                data='0',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.DeviceInfo.X_BAICELLS_COM_MME_Status',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.FAP.GPS.LockedLatitude',
+                val_type='int',
+                data='0',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.FAP.GPS.LockedLongitude',
+                val_type='int',
+                data='0',
+            ),
+        )
+        msg.ParameterList = models.ParameterValueList()
+        msg.ParameterList.ParameterValueStruct = param_val_list
+        return msg
+
+    @classmethod
+    def get_cavium_param_values_response(
+        cls,
+        admin_state: bool = False,
+        earfcndl: int = 2405,
+        num_plmns: int = 0,
+    ) -> models.GetParameterValuesResponse:
+        msg = models.GetParameterValuesResponse()
+        param_val_list = []
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.RF.DLBandwidth',
+                val_type='string',
+                data='20',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.RF.FreqBandIndicator',
+                val_type='string',
+                data='5',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.ManagementServer.PeriodicInformInterval',
+                val_type='int',
+                data='5',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.CellRestriction.CellReservedForOperatorUse',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.RF.ULBandwidth',
+                val_type='string',
+                data='n100',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.Common.CellIdentity',
+                val_type='int',
+                data='138777000',
+            ),
+        )
+        # MME IP
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.FAPControl.LTE.Gateway.S1SigLinkServerList',
+                val_type='string',
+                data='"192.168.60.142"',
+            ),
+        )
+        # perf mgmt enable
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.PerfMgmt.Config.1.Enable',
+                val_type='boolean',
+                data='true',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.CellRestriction.CellBarred',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.PerfMgmt.Config.1.PeriodicUploadInterval',
+                val_type='int',
+                data='600',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.FAPControl.LTE.AdminState',
+                val_type='boolean',
+                data=admin_state,
+            ),
+        )
+        # Perf mgmt upload url
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.PerfMgmt.Config.1.URL',
+                val_type='string',
+                data='http://192.168.60.142:8081/',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.EPC.TAC',
+                val_type='int',
+                data='1',
+            ),
+        )
+        # PCI
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.RF.PhyCellID',
+                val_type='int',
+                data='260',
+            ),
+        )
+        # MME port
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.FAPControl.LTE.Gateway.S1SigLinkPort',
+                val_type='int',
+                data='36412',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.IPsec.Enable',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.RF.EARFCNDL',
+                val_type='int',
+                data='2405',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.RF.EARFCNUL',
+                val_type='int',
+                data='20405',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.Capabilities.LTE.DuplexMode',
+                val_type='string',
+                data='FDDMode',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.Capabilities.LTE.BandsSupported',
+                val_type='string',
+                data='5',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.ManagementServer.PeriodicInformEnable',
+                val_type='int',
+                data='5',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.EPC.PLMNListNumberOfEntries',
+                val_type='int',
+                data=str(num_plmns),
+            ),
+        )
+        msg.ParameterList = models.ParameterValueList()
+        msg.ParameterList.ParameterValueStruct = param_val_list
+        return msg
+
+    @classmethod
+    def get_regular_param_values_response(
+        cls,
+        admin_state: bool = False,
+        earfcndl: int = 39250,
+        exclude_num_plmns: bool = False,
+    ) -> models.GetParameterValuesResponse:
+        msg = models.GetParameterValuesResponse()
+        param_val_list = []
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.RF.DLBandwidth',
+                val_type='string',
+                data='n100',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.RF.FreqBandIndicator',
+                val_type='string',
+                data='40',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.ManagementServer.PeriodicInformInterval',
+                val_type='int',
+                data='5',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.CellRestriction.CellReservedForOperatorUse',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.RF.ULBandwidth',
+                val_type='string',
+                data='20',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.X_BAICELLS_COM_LTE.EARFCNDLInUse',
+                val_type='string',
+                data=earfcndl,
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.PHY.TDDFrame.SpecialSubframePatterns',
+                val_type='int',
+                data='7',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.Common.CellIdentity',
+                val_type='int',
+                data='138777000',
+            ),
+        )
+        # MME IP
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.FAPControl.LTE.Gateway.S1SigLinkServerList',
+                val_type='string',
+                data='"192.168.60.142"',
+            ),
+        )
+        if not exclude_num_plmns:
+            param_val_list.append(
+                cls.get_parameter_value_struct(
+                    name='Device.Services.FAPService.1.CellConfig.LTE.EPC.PLMNListNumberOfEntries',
+                    val_type='int',
+                    data='1',
+                ),
+            )
+        # perf mgmt enable
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.FAP.PerfMgmt.Config.1.Enable',
+                val_type='boolean',
+                data='true',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.CellRestriction.CellBarred',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.FAP.PerfMgmt.Config.1.PeriodicUploadInterval',
+                val_type='int',
+                data='300',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.FAPControl.LTE.AdminState',
+                val_type='boolean',
+                data=admin_state,
+            ),
+        )
+        # Local gateway enable
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.DeviceInfo.X_BAICELLS_COM_LTE_LGW_Switch',
+                val_type='boolean',
+                data='0',
+            ),
+        )
+        # Perf mgmt upload url
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.FAP.PerfMgmt.Config.1.URL',
+                val_type='string',
+                data='http://192.168.60.142:8081/',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.EPC.TAC',
+                val_type='int',
+                data='1',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.FAPControl.LTE.Gateway.X_BAICELLS_COM_MmePool.Enable',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.PHY.TDDFrame.SubFrameAssignment',
+                val_type='int',
+                data='2',
+            ),
+        )
+        # PCI
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.RAN.RF.PhyCellID',
+                val_type='int',
+                data='260',
+            ),
+        )
+        # MME port
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.FAPControl.LTE.Gateway.S1SigLinkPort',
+                val_type='int',
+                data='36412',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.Ipsec.IPSEC_ENABLE',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.X_BAICELLS_COM_LTE.EARFCNULInUse',
+                val_type='int',
+                data='39150',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.Capabilities.LTE.DuplexMode',
+                val_type='string',
+                data='TDDMode',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.Capabilities.LTE.BandsSupported',
+                val_type='string',
+                data='40',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.ManagementServer.PeriodicInformEnable',
+                val_type='int',
+                data='5',
+            ),
+        )
+        msg.ParameterList = models.ParameterValueList()
+        msg.ParameterList.ParameterValueStruct = param_val_list
+        return msg
+
+    @classmethod
+    def get_qafb_regular_param_values_response(
+        cls,
+        admin_state: bool = False,
+        earfcndl: int = 39250,
+    ) -> models.GetParameterValuesResponse:
+        msg = models.GetParameterValuesResponse()
+        param_val_list = []
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.RAN.RF.DLBandwidth',
+                val_type='string',
+                data='20',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.RAN.RF.FreqBandIndicator',
+                val_type='string',
+                data='40',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.ManagementServer.PeriodicInformInterval',
+                val_type='int',
+                data='5',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.RAN.CellRestriction.CellReservedForOperatorUse',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.RAN.RF.ULBandwidth',
+                val_type='string',
+                data='20',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.RAN.RF.ULBandwidth',
+                val_type='int',
+                data='1',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.X_BAICELLS_COM_LTE.EARFCNDLInUse',
+                val_type='string',
+                data=earfcndl,
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.RAN.PHY.TDDFrame.SpecialSubframePatterns',
+                val_type='int',
+                data='7',
+            ),
+        )
+        # MME IP
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.FAPControl.LTE.Gateway.S1SigLinkServerList',
+                val_type='string',
+                data='"192.168.60.142"',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.EPC.PLMNListNumberOfEntries',
+                val_type='int',
+                data='1',
+            ),
+        )
+        # perf mgmt enable
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.FAP.PerfMgmt.Config.1.Enable',
+                val_type='boolean',
+                data='true',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.RAN.CellRestriction.CellBarred',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.FAP.PerfMgmt.Config.1.PeriodicUploadInterval',
+                val_type='int',
+                data='300',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.FAPControl.LTE.AdminState',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        # Local gateway enable
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.DeviceInfo.X_BAICELLS_COM_LTE_LGW_Switch',
+                val_type='boolean',
+                data='0',
+            ),
+        )
+        # Perf mgmt upload url
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.FAP.PerfMgmt.Config.1.URL',
+                val_type='string',
+                data='http://192.168.60.142:8081/',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.EPC.TAC',
+                val_type='int',
+                data='1',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.FAPControl.LTE.Gateway.X_BAICELLS_COM_MmePool.Enable',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.RAN.PHY.TDDFrame.SubFrameAssignment',
+                val_type='int',
+                data='2',
+            ),
+        )
+        # PCI
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.RAN.RF.PhyCellID',
+                val_type='int',
+                data='260',
+            ),
+        )
+        # MME port
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.FAPControl.LTE.Gateway.S1SigLinkPort',
+                val_type='int',
+                data='36412',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='boardconf.ipsec.ipsecConfig.onBoot',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.X_BAICELLS_COM_LTE.EARFCNULInUse',
+                val_type='int',
+                data='9212',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='boardconf.status.eepromInfo.div_multiple',
+                val_type='string',
+                data='02',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='boardconf.status.eepromInfo.work_mode',
+                val_type='string',
+                data='1C000400',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.ManagementServer.PeriodicInformEnable',
+                val_type='int',
+                data='5',
+            ),
+        )
+        msg.ParameterList = models.ParameterValueList()
+        msg.ParameterList.ParameterValueStruct = param_val_list
+        return msg
+
+    @classmethod
+    def get_cavium_object_param_values_response(
+            cls,
+            num_plmns: int,
+    ) -> models.GetParameterValuesResponse:
+        msg = models.GetParameterValuesResponse()
+        param_val_list = []
+        for i in range(1, num_plmns + 1):
+            param_val_list.append(
+                cls.get_parameter_value_struct(
+                    name='Device.Services.FAPService.1.CellConfig.LTE.EPC.PLMNList.%d.IsPrimary' % i,
+                    val_type='boolean',
+                    data='true',
+                ),
+            )
+            param_val_list.append(
+                cls.get_parameter_value_struct(
+                    name='Device.Services.FAPService.1.CellConfig.LTE.EPC.PLMNList.%d.CellReservedForOperatorUse' % i,
+                    val_type='boolean',
+                    data='false',
+                ),
+            )
+            param_val_list.append(
+                cls.get_parameter_value_struct(
+                    name='Device.Services.FAPService.1.CellConfig.LTE.EPC.PLMNList.%d.PLMNID' % i,
+                    val_type='string',
+                    data='00101',
+                ),
+            )
+            param_val_list.append(
+                cls.get_parameter_value_struct(
+                    name='Device.Services.FAPService.1.CellConfig.LTE.EPC.PLMNList.%d.Enable' % i,
+                    val_type='boolean',
+                    data='true',
+                ),
+            )
+        msg.ParameterList = models.ParameterValueList()
+        msg.ParameterList.ParameterValueStruct = param_val_list
+        return msg
+
+    @classmethod
+    def get_object_param_values_response(
+            cls,
+    ) -> models.GetParameterValuesResponse:
+        msg = models.GetParameterValuesResponse()
+        param_val_list = []
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.EPC.PLMNList.1.IsPrimary',
+                val_type='boolean',
+                data='true',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.EPC.PLMNList.1.CellReservedForOperatorUse',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.EPC.PLMNList.1.PLMNID',
+                val_type='string',
+                data='00101',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='Device.Services.FAPService.1.CellConfig.LTE.EPC.PLMNList.1.Enable',
+                val_type='boolean',
+                data='true',
+            ),
+        )
+        msg.ParameterList = models.ParameterValueList()
+        msg.ParameterList.ParameterValueStruct = param_val_list
+        return msg
+
+    @classmethod
+    def get_qafb_object_param_values_response(
+            cls,
+    ) -> models.GetParameterValuesResponse:
+        msg = models.GetParameterValuesResponse()
+        param_val_list = []
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.EPC.PLMNList.1.IsPrimary',
+                val_type='boolean',
+                data='true',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.EPC.PLMNList.1.CellReservedForOperatorUse',
+                val_type='boolean',
+                data='false',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.EPC.PLMNList.1.PLMNID',
+                val_type='string',
+                data='00101',
+            ),
+        )
+        param_val_list.append(
+            cls.get_parameter_value_struct(
+                name='InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.EPC.PLMNList.1.Enable',
+                val_type='boolean',
+                data='true',
+            ),
+        )
+        msg.ParameterList = models.ParameterValueList()
+        msg.ParameterList.ParameterValueStruct = param_val_list
+        return msg
+
+    @classmethod
+    def get_reboot_response(cls) -> models.RebootResponse:
+        return models.RebootResponse()
