Files
distcloud/distributedcloud/dcorch/tests/unit/db
Victor Romano 319331e8fe Move DB functions to class
To better apply obligatory decorators like db_session_cleanup, this
commit moves dcmanager and dcorch DB functions to a class. A follow up
commit will move db_session_cleanup to a class decorator and add this
commit hash in .git-blame-ignore-revs as this is a reformat commit.

Because of this change, unit tests were also reformated to use the
DB interface instead of sqlalchemy backend directly.

Test plan:
  - PASS: Build a custom ISO with the changes and deploy a DX system
          controller and a SX subcloud. Verify the system works as
          expected.
  - PASS: Manage a subcloud and verify the sync_status is "in-sync".
  - PASS: Unmanage a subcloud and verify the management status was
          updated to "unmanaged".
  - PASS: Run "dcmanager subcloud show <subcloud_name> --detail" and
          verify the output is correct.
  - PASS: Run "sudo dcorch-manage db_clean 0" and verify old jobs were
          successfully purged.
  - PASS: Verify no errors were observed on dcmanager or dcorch logs.

Story: 2011311
Task: 51894

Change-Id: Ie193906be3a475f3b09e924b2c23a3bc767b3204
Signed-off-by: Victor Romano <victor.gluzromano@windriver.com>
2025-04-08 10:34:34 -03:00
..