Skip to content

Commit

Permalink
Add acceptance tests for tag field to compute block_device_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilienM committed Sep 21, 2023
1 parent 93e5d0f commit 4fd4c99
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions acceptance/openstack/compute/v2/bootfromvolume_test.go
Expand Up @@ -51,13 +51,19 @@ func TestBootFromNewVolume(t *testing.T) {
choices, err := clients.AcceptanceTestChoicesFromEnv()
th.AssertNoErr(t, err)

// minimum required microversion for getting volume tags is 2.70
// https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id64
client.Microversion = "2.70"

tagName := "tag1"
blockDevices := []bootfromvolume.BlockDevice{
{
DeleteOnTermination: true,
DestinationType: bootfromvolume.DestinationVolume,
SourceType: bootfromvolume.SourceImage,
UUID: choices.ImageID,
VolumeSize: 2,
Tag: tagName,
},
}

Expand All @@ -73,6 +79,8 @@ func TestBootFromNewVolume(t *testing.T) {

tools.PrintResource(t, server)
tools.PrintResource(t, attachments)
attachmentTag := *attachments[0].Tag
th.AssertEquals(t, attachmentTag, tagName)

if server.Image != nil {
t.Fatalf("server image should be nil")
Expand Down

0 comments on commit 4fd4c99

Please sign in to comment.