Skip to content

Commit

Permalink
Add acceptance test
Browse files Browse the repository at this point in the history
  • Loading branch information
dstdfx committed Feb 4, 2018
1 parent ad333ba commit 9ca19d4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion acceptance/openstack/compute/v2/aggregates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func TestAggregatesUpdate(t *testing.T) {
tools.PrintResource(t, updatedAggregate)
}

func TestAggregatesAddHost(t *testing.T) {
func TestAggregatesAddRemoveHost(t *testing.T) {
client, err := clients.NewComputeV2Client()
if err != nil {
t.Fatalf("Unable to create a compute client: %v", err)
Expand All @@ -121,6 +121,17 @@ func TestAggregatesAddHost(t *testing.T) {
}

tools.PrintResource(t, aggregateWithNewHost)

removeHostOpts := aggregates.RemoveHostOpts{
Host: hostToAdd.HypervisorHostname,
}

aggregateWithRemovedHost, err := aggregates.RemoveHost(client, createdAggregate.ID, removeHostOpts).Extract()
if err != nil {
t.Fatalf("Unable to remove host from aggregate: %v", err)
}

tools.PrintResource(t, aggregateWithRemovedHost)
}

func getHypervisor(t *testing.T, client *gophercloud.ServiceClient) (*hypervisors.Hypervisor, error) {
Expand Down

0 comments on commit 9ca19d4

Please sign in to comment.