Beispiel #1
0
 def _init_state_map(self) -> None:
     self._state_map = {
         'wait_inform': WaitInformState(self, when_done='wait_empty', when_boot='wait_rem'),
         'wait_rem': BaicellsRemWaitState(self, when_done='wait_inform'),
         'wait_empty': WaitEmptyMessageState(self, when_done='get_transient_params', when_missing='check_optional_params'),
         'check_optional_params': CheckOptionalParamsState(self, when_done='get_transient_params'),
         'get_transient_params': SendGetTransientParametersState(self, when_done='wait_get_transient_params'),
         'wait_get_transient_params': WaitGetTransientParametersState(self, when_get='get_params', when_get_obj_params='get_obj_params', when_delete='delete_objs', when_add='add_objs', when_set='set_params', when_skip='end_session'),
         'get_params': GetParametersState(self, when_done='wait_get_params'),
         'wait_get_params': WaitGetParametersState(self, when_done='get_obj_params'),
         'get_obj_params': GetObjectParametersState(self, when_done='wait_get_obj_params'),
         'wait_get_obj_params': WaitGetObjectParametersState(self, when_delete='delete_objs', when_add='add_objs', when_set='set_params', when_skip='end_session'),
         'delete_objs': DeleteObjectsState(self, when_add='add_objs', when_skip='set_params'),
         'add_objs': AddObjectsState(self, when_done='set_params'),
         'set_params': SetParameterValuesState(self, when_done='wait_set_params'),
         'wait_set_params': WaitSetParameterValuesState(self, when_done='check_get_params', when_apply_invasive='reboot'),
         'check_get_params': GetParametersState(self, when_done='check_wait_get_params', request_all_params=True),
         'check_wait_get_params': WaitGetParametersState(self, when_done='end_session'),
         'end_session': EndSessionState(self),
         'reboot': BaicellsSendRebootState(self, when_done='wait_reboot'),
         'wait_reboot': WaitRebootResponseState(self, when_done='wait_post_reboot_inform'),
         'wait_post_reboot_inform': WaitInformMRebootState(self, when_done='wait_rem_post_reboot', when_timeout='wait_inform_post_reboot'),
         # After rebooting, we don't need to query optional params again.
         'wait_inform_post_reboot': WaitInformState(self, when_done='wait_empty_post_reboot', when_boot='wait_rem_post_reboot'),
         'wait_rem_post_reboot': BaicellsRemWaitState(self, when_done='wait_inform_post_reboot'),
         'wait_empty_post_reboot': WaitEmptyMessageState(self, when_done='get_transient_params', when_missing='check_optional_params'),
         # The states below are entered when an unexpected message type is
         # received
         'unexpected_fault': ErrorState(self, inform_transition_target='wait_inform'),
     }
Beispiel #2
0
 def _init_state_map(self) -> None:
     self._state_map = {
         'wait_inform': WaitInformState(self, when_done='get_rpc_methods'),
         'get_rpc_methods': GetRPCMethodsState(self, when_done='wait_empty', when_skip='get_transient_params'),
         'wait_empty': WaitEmptyMessageState(self, when_done='get_transient_params'),
         'get_transient_params': SendGetTransientParametersState(self, when_done='wait_get_transient_params'),
         'wait_get_transient_params': WaitGetTransientParametersState(self, when_get='get_params', when_get_obj_params='get_obj_params', when_delete='delete_objs', when_add='add_objs', when_set='set_params', when_skip='end_session'),
         'get_params': GetParametersState(self, when_done='wait_get_params'),
         'wait_get_params': WaitGetParametersState(self, when_done='get_obj_params'),
         'get_obj_params': CaviumGetObjectParametersState(self, when_done='wait_get_obj_params'),
         'wait_get_obj_params': CaviumWaitGetObjectParametersState(self, when_edit='disable_admin', when_skip='get_transient_params'),
         'disable_admin': CaviumDisableAdminEnableState(self, admin_value=False, when_done='wait_disable_admin'),
         'wait_disable_admin': CaviumWaitDisableAdminEnableState(self, admin_value=False, when_add='add_objs', when_delete='delete_objs', when_done='set_params'),
         'delete_objs': DeleteObjectsState(self, when_add='add_objs', when_skip='set_params'),
         'add_objs': AddObjectsState(self, when_done='set_params'),
         'set_params': SetParameterValuesNotAdminState(self, when_done='wait_set_params'),
         'wait_set_params': WaitSetParameterValuesState(self, when_done='enable_admin', when_apply_invasive='enable_admin'),
         'enable_admin': CaviumDisableAdminEnableState(self, admin_value=True, when_done='wait_enable_admin'),
         'wait_enable_admin': CaviumWaitDisableAdminEnableState(self, admin_value=True, when_done='check_get_params', when_add='check_get_params', when_delete='check_get_params'),
         'check_get_params': GetParametersState(self, when_done='check_wait_get_params', request_all_params=True),
         'check_wait_get_params': WaitGetParametersState(self, when_done='end_session'),
         'end_session': EndSessionState(self),
         # Below states only entered through manual user intervention
         'reboot': SendRebootState(self, when_done='wait_reboot'),
         'wait_reboot': WaitRebootResponseState(self, when_done='wait_post_reboot_inform'),
         'wait_post_reboot_inform': WaitInformMRebootState(self, when_done='wait_reboot_delay', when_timeout='wait_inform'),
         # The states below are entered when an unexpected message type is
         # received
         'unexpected_fault': ErrorState(self, inform_transition_target='wait_inform'),
     }
Beispiel #3
0
 def _init_state_map(self) -> None:
     self._state_map = {
         'wait_inform': WaitInformState(self, when_done='wait_empty'),
         'wait_empty': WaitEmptyMessageState(self, when_done='check_optional_params'),
         'check_optional_params': CheckOptionalParamsState(self, when_done='get_transient_params'),
         'get_transient_params': SendGetTransientParametersState(self, when_done='wait_get_transient_params'),
         'wait_get_transient_params': WaitGetTransientParametersState(self, when_get='get_params', when_get_obj_params='get_obj_params', when_delete='delete_objs', when_add='add_objs', when_set='set_params', when_skip='end_session'),
         'get_params': GetParametersState(self, when_done='wait_get_params'),
         'wait_get_params': WaitGetParametersState(self, when_done='get_obj_params'),
         'get_obj_params': GetObjectParametersState(self, when_done='wait_get_obj_params'),
         'wait_get_obj_params': WaitGetObjectParametersState(self, when_delete='delete_objs', when_add='add_objs', when_set='set_params', when_skip='end_session'),
         'delete_objs': DeleteObjectsState(self, when_add='add_objs', when_skip='set_params'),
         'add_objs': AddObjectsState(self, when_done='set_params'),
         'set_params': SetParameterValuesState(self, when_done='wait_set_params'),
         'wait_set_params': WaitSetParameterValuesState(self, when_done='check_get_params'),
         'check_get_params': GetParametersState(self, when_done='check_wait_get_params', request_all_params=True),
         'check_wait_get_params': WaitGetParametersState(self, when_done='end_session'),
         'end_session': EndSessionState(self),
         # The state below are only entered with manual user intervention.
         'reboot': SendRebootState(self, when_done='wait_reboot'),
         'wait_reboot': WaitRebootResponseState(self, when_done='wait_post_reboot_inform'),
         'wait_post_reboot_inform': WaitInformMRebootState(self, when_done='wait_empty_after_reboot', when_timeout='wait_inform'),
         'wait_empty_after_reboot': WaitEmptyMessageState(self, when_done='get_transient_params'),
         # The states below are entered when an unexpected message type is
         # received
         'unexpected_fault': ErrorState(self),
     }
Beispiel #4
0
 def _init_state_map(self) -> None:
     self._state_map = {
         'disconnected':
         BaicellsDisconnectedState(self, when_done='wait_empty'),
         'unexpected_inform':
         UnexpectedInformState(self, when_done='wait_empty'),
         'wait_empty':
         WaitEmptyMessageState(self, when_done='check_optional_params'),
         'check_optional_params':
         CheckOptionalParamsState(self, when_done='get_transient_params'),
         'get_transient_params':
         SendGetTransientParametersState(
             self, when_done='wait_get_transient_params'),
         'wait_get_transient_params':
         WaitGetTransientParametersState(
             self,
             when_get='get_params',
             when_get_obj_params='get_obj_params',
             when_delete='delete_objs',
             when_add='add_objs',
             when_set='set_params',
             when_skip='get_transient_params'),
         'get_params':
         GetParametersState(self, when_done='wait_get_params'),
         'wait_get_params':
         WaitGetParametersState(self, when_done='get_obj_params'),
         'get_obj_params':
         GetObjectParametersState(self, when_done='wait_get_obj_params'),
         'wait_get_obj_params':
         WaitGetObjectParametersState(self,
                                      when_delete='delete_objs',
                                      when_add='add_objs',
                                      when_set='set_params',
                                      when_skip='get_transient_params'),
         'delete_objs':
         DeleteObjectsState(self,
                            when_add='add_objs',
                            when_skip='set_params'),
         'add_objs':
         AddObjectsState(self, when_done='set_params'),
         'set_params':
         SetParameterValuesState(self, when_done='wait_set_params'),
         'wait_set_params':
         WaitSetParameterValuesState(self,
                                     when_done='get_transient_params'),
         # Below states only entered through manual user intervention
         'reboot':
         SendRebootState(self, when_done='wait_reboot'),
         'wait_reboot':
         WaitRebootResponseState(self, when_done='wait_post_reboot_inform'),
         'wait_post_reboot_inform':
         WaitInformMRebootState(self,
                                when_done='wait_reboot_delay',
                                when_timeout='disconnected'),
         'wait_reboot_delay':
         WaitRebootDelayState(self, when_done='wait_inform'),
         'wait_inform':
         WaitInformState(self, when_done='get_transient_params'),
     }
Beispiel #5
0
 def _init_state_map(self) -> None:
     self._state_map = {
         'disconnected':
         BaicellsDisconnectedState(self, when_done='wait_empty'),
         'wait_empty':
         WaitEmptyMessageState(self, when_done='check_optional_params'),
         'check_optional_params':
         CheckOptionalParamsState(self, when_done='get_transient_params'),
         'get_transient_params':
         SendGetTransientParametersState(
             self, when_done='wait_get_transient_params'),
         'wait_get_transient_params':
         WaitGetTransientParametersState(
             self,
             when_get='get_params',
             when_get_obj_params='get_obj_params',
             when_delete='delete_objs',
             when_add='add_objs',
             when_set='set_params',
             when_skip='get_transient_params'),
         'get_params':
         GetParametersState(self, when_done='wait_get_params'),
         'wait_get_params':
         WaitGetParametersState(self, when_done='get_obj_params'),
         'get_obj_params':
         GetObjectParametersState(self, when_done='wait_get_obj_params'),
         'wait_get_obj_params':
         WaitGetObjectParametersState(self,
                                      when_delete='delete_objs',
                                      when_add='add_objs',
                                      when_set='set_params',
                                      when_skip='get_transient_params'),
         'delete_objs':
         DeleteObjectsState(self,
                            when_add='add_objs',
                            when_skip='set_params'),
         'add_objs':
         AddObjectsState(self, when_done='set_params'),
         'set_params':
         SetParameterValuesState(self, when_done='wait_set_params'),
         'wait_set_params':
         WaitSetParameterValuesState(self, when_done='reboot'),
         'reboot':
         SendRebootState(self, when_done='wait_reboot'),
         'wait_reboot':
         WaitRebootResponseState(self, when_done='wait_post_reboot_inform'),
         'wait_post_reboot_inform':
         WaitInformMRebootState(self,
                                when_done='wait_empty_after_reboot',
                                when_timeout='disconnected'),
         'wait_empty_after_reboot':
         WaitEmptyMessageState(self, when_done='get_transient_params'),
         # The states below are entered when an unexpected message type is
         # received
         'unexpected_inform':
         UnexpectedInformState(self, when_done='wait_empty'),
         'unexpected_fault':
         ErrorState(self),
     }
Beispiel #6
0
 def _init_state_map(self) -> None:
     self._state_map = {
         'disconnected':
         DisconnectedState(self, when_done='get_transient_params'),
         'get_transient_params':
         SendGetTransientParametersState(
             self, when_done='wait_get_transient_params'),
         'wait_get_transient_params':
         WaitGetTransientParametersState(
             self,
             when_get='get_params',
             when_get_obj_params='get_obj_params',
             when_delete='delete_objs',
             when_add='add_objs',
             when_set='set_params',
             when_skip='get_transient_params'),
         'get_params':
         GetParametersState(self, when_done='wait_get_parameters'),
         'wait_get_params':
         WaitGetParametersState(self, when_done='disable_admin'),
         'disable_admin':
         CaviumDisableAdminEnableState(self,
                                       when_done='wait_disable_admin'),
         'wait_disable_admin':
         CaviumWaitDisableAdminEnableState(self, when_done='delete_objs'),
         'delete_objs':
         DeleteObjectsState(self,
                            when_add='add_objs',
                            when_skip='set_params'),
         'add_objs':
         AddObjectsState(self, when_done='set_params'),
         'set_params':
         SetParameterValuesNotAdminState(self, when_done='wait_set_params'),
         'wait_set_params':
         WaitSetParameterValuesState(self,
                                     when_done='get_transient_params'),
         # Below states only entered through manual user intervention
         'reboot':
         SendRebootState(self, when_done='wait_reboot'),
         'wait_reboot':
         WaitRebootResponseState(self, when_done='wait_post_reboot_inform'),
         'wait_post_reboot_inform':
         WaitInformMRebootState(self,
                                when_done='wait_reboot_delay',
                                when_timeout='disconnected'),
         # The states below are entered when an unexpected message type is
         # received
         'unexpected_inform':
         UnexpectedInformState(self, when_done='wait_empty'),
         'unexpected_fault':
         ErrorState(self)
     }
Beispiel #7
0
    def _init_state_map(self) -> None:
        self._state_map = {
            # RemWait state seems not needed for QRTB
            'wait_inform': WaitInformState(self, when_done='wait_empty', when_boot=None),
            'wait_empty': WaitEmptyMessageState(self, when_done='check_fw_upgrade_download'),

            # Download flow
            'check_fw_upgrade_download': CheckFirmwareUpgradeDownloadState(
                self,
                when_download='fw_upgrade_download',
                when_skip='get_transient_params',
            ),
            'fw_upgrade_download': FirmwareUpgradeDownloadState(
                self,
                when_done='wait_fw_upgrade_download_response',
            ),
            'wait_fw_upgrade_download_response': WaitForFirmwareUpgradeDownloadResponse(
                self,
                when_done='get_transient_params',
                when_skip='get_transient_params',
            ),
            # Download flow ends

            'get_transient_params': SendGetTransientParametersState(self, when_done='wait_get_transient_params'),
            'wait_get_transient_params': WaitGetTransientParametersState(
                self,
                when_get='get_params',
                when_get_obj_params='get_obj_params',
                when_delete='delete_objs',
                when_add='add_objs',
                when_set='set_params',
                when_skip='end_session',
                request_all_params=True,
            ),
            'get_params': GetParametersState(self, when_done='wait_get_params', request_all_params=True),
            'wait_get_params': WaitGetParametersState(self, when_done='get_obj_params'),
            'get_obj_params': GetObjectParametersState(self, when_done='wait_get_obj_params', request_all_params=True),
            'wait_get_obj_params': WaitGetObjectParametersState(
                self, when_delete='delete_objs', when_add='add_objs',
                when_set='set_params', when_skip='end_session',
            ),
            'delete_objs': DeleteObjectsState(self, when_add='add_objs', when_skip='set_params'),
            'add_objs': AddObjectsState(self, when_done='set_params'),
            'set_params': SetParameterValuesState(self, when_done='wait_set_params'),
            'wait_set_params': WaitSetParameterValuesState(
                self, when_done='check_get_params',
                when_apply_invasive='reboot',
            ),
            'check_get_params': GetParametersState(
                self,
                when_done='check_wait_get_params',
                request_all_params=True,
            ),
            'check_wait_get_params': WaitGetParametersState(self, when_done='end_session'),
            'end_session': BaicellsQRTBEndSessionState(self, when_done='notify_dp'),
            'notify_dp': BaicellsQRTBNotifyDPState(self, when_inform='wait_inform'),
            'reboot': EnbSendRebootState(self, when_done='wait_reboot'),
            'wait_reboot': WaitRebootResponseState(self, when_done='wait_post_reboot_inform'),
            'wait_post_reboot_inform': BaicellsQRTBWaitInformRebootState(
                self,
                when_done='wait_queued_events_post_reboot',
                when_timeout='wait_inform_post_reboot',
            ),
            "wait_queued_events_post_reboot": BaicellsQRTBQueuedEventsWaitState(
                self,
                when_done='wait_inform_post_reboot',
            ),
            'wait_inform_post_reboot': WaitInformState(self, when_done='wait_empty_post_reboot', when_boot=None),
            'wait_empty_post_reboot': WaitEmptyMessageState(
                self, when_done='get_transient_params',
                when_missing='check_optional_params',
            ),
            # The states below are entered when an unexpected message type is
            # received
            'unexpected_fault': ErrorState(self, inform_transition_target='wait_inform'),
        }