Skip to content

Commit

Permalink
Add acceptance test for create and delete aggregate gophercloud#739, g…
Browse files Browse the repository at this point in the history
  • Loading branch information
dstdfx committed Jan 31, 2018
1 parent bb5adf2 commit 45de072
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions acceptance/openstack/compute/v2/aggregates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,25 @@ func TestAggregatesList(t *testing.T) {
tools.PrintResource(t, h)
}
}

func TestAggregatesCreateDelete(t *testing.T) {
client, err := clients.NewComputeV2Client()
if err != nil {
t.Fatalf("Unable to create a compute client: %v", err)
}

opts := aggregates.CreateOpts{
Name: "name",
AvailabilityZone: "london",
}

aggregate, err := aggregates.Create(client, opts).Extract()
if err != nil {
t.Fatalf("Unable to create an aggregate: %v", err)
}

err = aggregates.Delete(client, aggregate.ID).ExtractErr()
if err != nil {
t.Fatalf("Unable to delete an aggregate: %v", err)
}
}

0 comments on commit 45de072

Please sign in to comment.