From 46bc05bbd7ed386182042ea2609db9d4a85428b2 Mon Sep 17 00:00:00 2001 From: Konstantin Babushkin Date: Mon, 2 Jun 2025 18:43:14 +0200 Subject: [PATCH] fix integration tests, add epoxy release (#428) * use `cinder/block-storage` service instead of `cinderv3/volumev3` in tests --- .github/workflows/integration_tests.yml | 32 ++++++++++--------- doc/services/block-storage/v3/index.rst | 7 ++++ samples/BlockStorage/v3/snapshots/create.php | 2 +- samples/BlockStorage/v3/snapshots/delete.php | 2 +- samples/BlockStorage/v3/snapshots/get.php | 2 +- .../v3/snapshots/get_metadata.php | 2 +- samples/BlockStorage/v3/snapshots/list.php | 2 +- .../BlockStorage/v3/snapshots/list_detail.php | 2 +- .../BlockStorage/v3/snapshots/list_sorted.php | 2 +- .../v3/snapshots/merge_metadata.php | 2 +- .../v3/snapshots/reset_metadata.php | 2 +- samples/BlockStorage/v3/snapshots/update.php | 2 +- .../BlockStorage/v3/volume_types/create.php | 2 +- .../BlockStorage/v3/volume_types/delete.php | 2 +- samples/BlockStorage/v3/volume_types/list.php | 2 +- samples/BlockStorage/v3/volume_types/read.php | 2 +- .../BlockStorage/v3/volume_types/update.php | 2 +- samples/BlockStorage/v3/volumes/create.php | 2 +- .../v3/volumes/create_from_image.php | 2 +- .../v3/volumes/create_from_snapshot.php | 2 +- .../v3/volumes/create_from_volume.php | 2 +- samples/BlockStorage/v3/volumes/delete.php | 2 +- samples/BlockStorage/v3/volumes/list.php | 2 +- .../BlockStorage/v3/volumes/list_detail.php | 2 +- samples/BlockStorage/v3/volumes/read.php | 2 +- samples/BlockStorage/v3/volumes/update.php | 2 +- src/Images/v2/Models/Image.php | 3 ++ tests/sample/Images/v2/ImageTest.php | 2 +- tests/sample/TestCase.php | 2 +- 29 files changed, 53 insertions(+), 41 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 43ca72622..c8dbdc79a 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -2,6 +2,16 @@ name: Integration Tests on: workflow_dispatch: + inputs: + tmate_enabled: + type: boolean + description: 'Run the build with tmate debugging enabled' + required: false + default: false + openstack_version: + description: 'Comma-separated list of Openstack versions e.g. "stable/2025.1", "unmaintained/zed"' + required: false + default: false pull_request: push: branches: @@ -19,23 +29,11 @@ jobs: strategy: fail-fast: false matrix: - openstack_version: [ "stable/2023.2" ] + openstack_version: ${{ fromJSON(format('[{0}]', inputs.openstack_version || vars.OPENSTACK_VERSIONS )) }} php_version: [ 8.1 ] - include: - - name: "dalmatian" - openstack_version: "stable/2024.2" - ubuntu_version: "22.04" - - name: "caracal" - openstack_version: "stable/2024.1" - ubuntu_version: "22.04" - - name: "antelope" - openstack_version: "unmaintained/2023.1" - ubuntu_version: "22.04" - - name: "zed" - openstack_version: "unmaintained/zed" - ubuntu_version: "22.04" + ubuntu_version: [ 22.04 ] runs-on: ubuntu-${{ matrix.ubuntu_version }} - name: Deploy OpenStack ${{ matrix.name }} and run integration tests with php ${{matrix.php_version}} + name: Deploy OpenStack ${{ matrix.openstack_version }} and run integration tests with php ${{matrix.php_version}} steps: - uses: actions/checkout@v4 @@ -120,3 +118,7 @@ jobs: with: name: failure-logs-${{ strategy.job-index }} path: failure-logs + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: ${{ always() && github.event_name == 'workflow_dispatch' && inputs.tmate_enabled }} \ No newline at end of file diff --git a/doc/services/block-storage/v3/index.rst b/doc/services/block-storage/v3/index.rst index 7c8acfbd4..9245691d2 100644 --- a/doc/services/block-storage/v3/index.rst +++ b/doc/services/block-storage/v3/index.rst @@ -4,6 +4,13 @@ Block Storage v3 OpenStack Block Storage API v3 (Cinder). Cinder is the OpenStack Block Storage service for providing volumes to Nova virtual machines, Ironic bare metal hosts, containers and more. +.. note:: + + By default we are creating Cinder service with ``cinderv3`` name and ``volumev3`` type. + This is left for backward compatibility and would be changed on the next major release of OpenStack SDK. + It's made to be compatible with the old OpenStack installations where the 2nd version of Cinder was also installed. + Check your service name and type. New installations would use ``cinder`` name and ``block-storage`` type. + .. osdoc:: https://docs.openstack.org/api-ref/block-storage/v3/ .. toctree:: diff --git a/samples/BlockStorage/v3/snapshots/create.php b/samples/BlockStorage/v3/snapshots/create.php index 94ad40aec..c764801e0 100644 --- a/samples/BlockStorage/v3/snapshots/create.php +++ b/samples/BlockStorage/v3/snapshots/create.php @@ -9,7 +9,7 @@ 'scope' => ['project' => ['id' => '{projectId}']] ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $snapshot = $service->createSnapshot([ 'volumeId' => '{volumeId}', diff --git a/samples/BlockStorage/v3/snapshots/delete.php b/samples/BlockStorage/v3/snapshots/delete.php index 7136ca1eb..b17a185b4 100644 --- a/samples/BlockStorage/v3/snapshots/delete.php +++ b/samples/BlockStorage/v3/snapshots/delete.php @@ -9,7 +9,7 @@ 'scope' => ['project' => ['id' => '{projectId}']] ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $snapshot = $service->getSnapshot('{snapshotId}'); $snapshot->delete(); diff --git a/samples/BlockStorage/v3/snapshots/get.php b/samples/BlockStorage/v3/snapshots/get.php index 2466cbfc1..862ea41cc 100644 --- a/samples/BlockStorage/v3/snapshots/get.php +++ b/samples/BlockStorage/v3/snapshots/get.php @@ -9,6 +9,6 @@ 'scope' => ['project' => ['id' => '{projectId}']] ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $snapshot = $service->getSnapshot('{snapshotId}'); diff --git a/samples/BlockStorage/v3/snapshots/get_metadata.php b/samples/BlockStorage/v3/snapshots/get_metadata.php index 76e319a6c..23fe6c2a2 100644 --- a/samples/BlockStorage/v3/snapshots/get_metadata.php +++ b/samples/BlockStorage/v3/snapshots/get_metadata.php @@ -9,7 +9,7 @@ 'scope' => ['project' => ['id' => '{projectId}']] ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $metadata = $service->getSnapshot('{snapshotId}') ->getMetadata(); diff --git a/samples/BlockStorage/v3/snapshots/list.php b/samples/BlockStorage/v3/snapshots/list.php index fdf3f66d1..c887806d2 100644 --- a/samples/BlockStorage/v3/snapshots/list.php +++ b/samples/BlockStorage/v3/snapshots/list.php @@ -9,7 +9,7 @@ 'scope' => ['project' => ['id' => '{projectId}']] ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $snapshots = $service->listSnapshots(); diff --git a/samples/BlockStorage/v3/snapshots/list_detail.php b/samples/BlockStorage/v3/snapshots/list_detail.php index 525ea482f..c53cf80f9 100644 --- a/samples/BlockStorage/v3/snapshots/list_detail.php +++ b/samples/BlockStorage/v3/snapshots/list_detail.php @@ -9,7 +9,7 @@ 'scope' => ['project' => ['id' => '{projectId}']] ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $snapshots = $service->listSnapshots(true); diff --git a/samples/BlockStorage/v3/snapshots/list_sorted.php b/samples/BlockStorage/v3/snapshots/list_sorted.php index ce9a50bf4..d722825e8 100644 --- a/samples/BlockStorage/v3/snapshots/list_sorted.php +++ b/samples/BlockStorage/v3/snapshots/list_sorted.php @@ -9,7 +9,7 @@ 'scope' => ['project' => ['id' => '{projectId}']] ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $snapshots = $service->listSnapshots(false, ['sortKey' => '{sortKey}', 'sortDir' => '{sortDir}']); diff --git a/samples/BlockStorage/v3/snapshots/merge_metadata.php b/samples/BlockStorage/v3/snapshots/merge_metadata.php index c85386c78..40eca4bf0 100644 --- a/samples/BlockStorage/v3/snapshots/merge_metadata.php +++ b/samples/BlockStorage/v3/snapshots/merge_metadata.php @@ -9,7 +9,7 @@ 'scope' => ['project' => ['id' => '{projectId}']] ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $snapshot = $service->getSnapshot('{snapshotId}'); diff --git a/samples/BlockStorage/v3/snapshots/reset_metadata.php b/samples/BlockStorage/v3/snapshots/reset_metadata.php index d0d7a710d..114111d9e 100644 --- a/samples/BlockStorage/v3/snapshots/reset_metadata.php +++ b/samples/BlockStorage/v3/snapshots/reset_metadata.php @@ -9,7 +9,7 @@ 'scope' => ['project' => ['id' => '{projectId}']] ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $snapshot = $service->getSnapshot('{snapshotId}'); diff --git a/samples/BlockStorage/v3/snapshots/update.php b/samples/BlockStorage/v3/snapshots/update.php index 3310d44a1..b9adf70e3 100644 --- a/samples/BlockStorage/v3/snapshots/update.php +++ b/samples/BlockStorage/v3/snapshots/update.php @@ -9,7 +9,7 @@ 'scope' => ['project' => ['id' => '{projectId}']] ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $snapshot = $service->getSnapshot('{snapshotId}'); diff --git a/samples/BlockStorage/v3/volume_types/create.php b/samples/BlockStorage/v3/volume_types/create.php index abed4941d..c3ceb2098 100644 --- a/samples/BlockStorage/v3/volume_types/create.php +++ b/samples/BlockStorage/v3/volume_types/create.php @@ -11,7 +11,7 @@ , ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volumeType = $service->createVolumeType([ 'name' => '{name}', diff --git a/samples/BlockStorage/v3/volume_types/delete.php b/samples/BlockStorage/v3/volume_types/delete.php index f0e9a2f7a..2d118583b 100644 --- a/samples/BlockStorage/v3/volume_types/delete.php +++ b/samples/BlockStorage/v3/volume_types/delete.php @@ -11,7 +11,7 @@ , ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volumeType = $service->getVolumeType('{volumeTypeId}'); $volumeType->delete(); diff --git a/samples/BlockStorage/v3/volume_types/list.php b/samples/BlockStorage/v3/volume_types/list.php index 238572891..d9974d731 100644 --- a/samples/BlockStorage/v3/volume_types/list.php +++ b/samples/BlockStorage/v3/volume_types/list.php @@ -11,7 +11,7 @@ , ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volumeTypes = $service->listVolumeTypes(); diff --git a/samples/BlockStorage/v3/volume_types/read.php b/samples/BlockStorage/v3/volume_types/read.php index b254c8eaf..217a97f30 100644 --- a/samples/BlockStorage/v3/volume_types/read.php +++ b/samples/BlockStorage/v3/volume_types/read.php @@ -11,7 +11,7 @@ , ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volumeType = $service->getVolumeType('{volumeTypeId}'); $volumeType->retrieve(); \ No newline at end of file diff --git a/samples/BlockStorage/v3/volume_types/update.php b/samples/BlockStorage/v3/volume_types/update.php index bdd08ab5c..b99b04640 100644 --- a/samples/BlockStorage/v3/volume_types/update.php +++ b/samples/BlockStorage/v3/volume_types/update.php @@ -11,7 +11,7 @@ , ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volumeType = $service->getVolumeType('{volumeTypeId}'); $volumeType->name = '{newName}'; diff --git a/samples/BlockStorage/v3/volumes/create.php b/samples/BlockStorage/v3/volumes/create.php index 0af2293bd..6de120959 100644 --- a/samples/BlockStorage/v3/volumes/create.php +++ b/samples/BlockStorage/v3/volumes/create.php @@ -11,7 +11,7 @@ ], ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volume = $service->createVolume([ 'description' => '{description}', diff --git a/samples/BlockStorage/v3/volumes/create_from_image.php b/samples/BlockStorage/v3/volumes/create_from_image.php index b561c353d..316b9a822 100644 --- a/samples/BlockStorage/v3/volumes/create_from_image.php +++ b/samples/BlockStorage/v3/volumes/create_from_image.php @@ -11,7 +11,7 @@ ], ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volume = $service->createVolume([ 'description' => '{description}', diff --git a/samples/BlockStorage/v3/volumes/create_from_snapshot.php b/samples/BlockStorage/v3/volumes/create_from_snapshot.php index 2c9de9c81..6d08b1510 100644 --- a/samples/BlockStorage/v3/volumes/create_from_snapshot.php +++ b/samples/BlockStorage/v3/volumes/create_from_snapshot.php @@ -11,7 +11,7 @@ ], ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volume = $service->createVolume([ 'description' => '{description}', diff --git a/samples/BlockStorage/v3/volumes/create_from_volume.php b/samples/BlockStorage/v3/volumes/create_from_volume.php index a72ed00c5..e48172e2f 100644 --- a/samples/BlockStorage/v3/volumes/create_from_volume.php +++ b/samples/BlockStorage/v3/volumes/create_from_volume.php @@ -11,7 +11,7 @@ ], ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volume = $service->createVolume([ 'description' => '{description}', diff --git a/samples/BlockStorage/v3/volumes/delete.php b/samples/BlockStorage/v3/volumes/delete.php index 8776244f0..4f70cd95e 100644 --- a/samples/BlockStorage/v3/volumes/delete.php +++ b/samples/BlockStorage/v3/volumes/delete.php @@ -11,7 +11,7 @@ ], ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volume = $service->getVolume('{volumeId}'); $volume->delete(); diff --git a/samples/BlockStorage/v3/volumes/list.php b/samples/BlockStorage/v3/volumes/list.php index 5f88fa843..473b6f0bf 100644 --- a/samples/BlockStorage/v3/volumes/list.php +++ b/samples/BlockStorage/v3/volumes/list.php @@ -11,7 +11,7 @@ ], ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volumes = $service->listVolumes(); diff --git a/samples/BlockStorage/v3/volumes/list_detail.php b/samples/BlockStorage/v3/volumes/list_detail.php index 2029d32ce..755606c0e 100644 --- a/samples/BlockStorage/v3/volumes/list_detail.php +++ b/samples/BlockStorage/v3/volumes/list_detail.php @@ -11,7 +11,7 @@ ], ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); foreach ($service->listVolumes(true) as $volume) { /** @var $volume \OpenStack\BlockStorage\v2\Models\Volume */ diff --git a/samples/BlockStorage/v3/volumes/read.php b/samples/BlockStorage/v3/volumes/read.php index d1de298e6..1a3ef1356 100644 --- a/samples/BlockStorage/v3/volumes/read.php +++ b/samples/BlockStorage/v3/volumes/read.php @@ -11,7 +11,7 @@ ], ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volume = $service->getVolume('{volumeId}'); $volume->retrieve(); \ No newline at end of file diff --git a/samples/BlockStorage/v3/volumes/update.php b/samples/BlockStorage/v3/volumes/update.php index d2ead417b..9aaea22e9 100644 --- a/samples/BlockStorage/v3/volumes/update.php +++ b/samples/BlockStorage/v3/volumes/update.php @@ -11,7 +11,7 @@ ], ]); -$service = $openstack->blockStorageV3(); +$service = $openstack->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); $volume = $service->getVolume('{volumeId}'); diff --git a/src/Images/v2/Models/Image.php b/src/Images/v2/Models/Image.php index 9cff176b6..5ee322f60 100644 --- a/src/Images/v2/Models/Image.php +++ b/src/Images/v2/Models/Image.php @@ -8,6 +8,7 @@ use OpenStack\Common\Resource\Alias; use OpenStack\Common\Resource\Creatable; use OpenStack\Common\Resource\Deletable; +use OpenStack\Common\Resource\HasWaiterTrait; use OpenStack\Common\Resource\Listable; use OpenStack\Common\Resource\OperatorResource; use OpenStack\Common\Resource\Retrievable; @@ -20,6 +21,8 @@ */ class Image extends OperatorResource implements Creatable, Listable, Retrievable, Deletable { + use HasWaiterTrait; + /** @var string */ public $status; diff --git a/tests/sample/Images/v2/ImageTest.php b/tests/sample/Images/v2/ImageTest.php index af524d3f5..ffb938365 100644 --- a/tests/sample/Images/v2/ImageTest.php +++ b/tests/sample/Images/v2/ImageTest.php @@ -18,7 +18,7 @@ public function testCreate(): Image '{tag1}' => 'ubuntu', '{tag2}' => 'test', '{containerFormat}' => 'bare', - '{diskFormat}' => 'qcow2', + '{diskFormat}' => 'raw', '{visibility}' => 'private', ] ); diff --git a/tests/sample/TestCase.php b/tests/sample/TestCase.php index 79ef23131..e7c1a7ee5 100644 --- a/tests/sample/TestCase.php +++ b/tests/sample/TestCase.php @@ -48,7 +48,7 @@ protected function getCachedService(string $serviceType): AbstractService $service = $this->getOpenStack()->blockStorageV2(); break; case \OpenStack\BlockStorage\v3\Service::class: - $service = $this->getOpenStack()->blockStorageV3(); + $service = $this->getOpenStack()->blockStorageV3(['catalogName' => 'cinder', 'catalogType' => 'block-storage']); break; case \OpenStack\Compute\v2\Service::class: $service = $this->getOpenStack()->computeV2();