distcloud/distributedcloud/dcmanager/tests/unit/orchestrator/states/software/test_deploy_complete.py

33 lines
1.1 KiB
Python

#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from dcmanager.common import consts
from dcmanager.tests.unit.orchestrator.states.software.test_base import \
TestSoftwareOrchestrator
class TestDeployCompleteState(TestSoftwareOrchestrator):
def setUp(self):
super(TestDeployCompleteState, self).setUp()
self.on_success_state = consts.STRATEGY_STATE_SW_FINISH_STRATEGY
# Add the subcloud being processed by this unit test
self.subcloud = self.setup_subcloud()
# Add the strategy_step state being processed by this unit test
self.strategy_step = self.setup_strategy_step(
self.subcloud.id, consts.STRATEGY_STATE_SW_DEPLOY_COMPLETE)
def test_deploy_complete_success(self):
"""Test deploy complete when the API call succeeds."""
self.worker.perform_state_action(self.strategy_step)
# On success, the state should transition to the next state
self.assert_step_updated(self.strategy_step.subcloud_id,
self.on_success_state)