Adjust storage acceptance tests accordingly.
diff --git a/acceptance/openstack/storage_test.go b/acceptance/openstack/storage_test.go
index 9a9a65f..e7907d1 100644
--- a/acceptance/openstack/storage_test.go
+++ b/acceptance/openstack/storage_test.go
@@ -242,37 +242,42 @@
}
}()
- lr, err := objects.List(client, objects.ListOpts{
- Full: false,
- Container: cName,
+ pager := objects.List(client, objects.ListOpts{Full: false, Container: cName})
+ ons := make([]string, 0, len(oNames))
+ err = pager.EachPage(func(page pagination.Page) (bool, error) {
+ names, err := objects.ExtractNames(page)
+ if err != nil {
+ return false, err
+ }
+ ons = append(ons, names...)
+
+ return true, nil
})
if err != nil {
t.Error(err)
return
}
- ons, err := objects.ExtractNames(lr)
- if err != nil {
- t.Error(err)
- return
- }
if len(ons) != len(oNames) {
t.Errorf("Expected %d names and got %d", len(oNames), len(ons))
return
}
- lr, err = objects.List(client, objects.ListOpts{
- Full: true,
- Container: cName,
+ pager = objects.List(client, objects.ListOpts{Full: true, Container: cName})
+ ois := make([]objects.Object, 0, len(oNames))
+ err = pager.EachPage(func(page pagination.Page) (bool, error) {
+ info, err := objects.ExtractInfo(page)
+ if err != nil {
+ return false, nil
+ }
+
+ ois = append(ois, info...)
+
+ return true, nil
})
if err != nil {
t.Error(err)
return
}
- ois, err := objects.ExtractInfo(lr)
- if err != nil {
- t.Error(err)
- return
- }
if len(ois) != len(oNames) {
t.Errorf("Expected %d containers and got %d", len(oNames), len(ois))
return