Skip to content

Commit

Permalink
Added acceptance test for list policy
Browse files Browse the repository at this point in the history
  • Loading branch information
sreinkemeier committed Feb 19, 2018
1 parent 5948873 commit 6fa93ce
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,30 @@ import (

"github.com/gophercloud/gophercloud/acceptance/clients"
"github.com/gophercloud/gophercloud/acceptance/tools"
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/vpnaas/ipsecpolicies"
)

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

allPages, err := ipsecpolicies.List(client, nil).AllPages()
if err != nil {
t.Fatalf("Unable to list IPSec policies: %v", err)
}

allPolicies, err := ipsecpolicies.ExtractPolicies(allPages)
if err != nil {
t.Fatalf("Unable to extract policies: %v", err)
}

for _, policy := range allPolicies {
tools.PrintResource(t, policy)
}
}

func TestPolicyCRUD(t *testing.T) {
client, err := clients.NewNetworkV2Client()
if err != nil {
Expand Down

0 comments on commit 6fa93ce

Please sign in to comment.