From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Shallow scan errors with:
Traceback (most recent call last):
File "test_rest.py", line 1272, in test_iso_scan_shallow
'/storagepools/kimchi_isos/storagevolumes/').read())[0]
IndexError: list index out of range
Because of shallow scan finished before volume creation finshed.
Since we change creation of volume to async task,
we need to wait it finish before issue shallow scan.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
tests/test_rest.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/test_rest.py b/tests/test_rest.py
index 812afb7..f90b7e7 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -1264,7 +1264,9 @@ class RestTests(unittest.TestCase):
'capacity': 1073741824, # 1 GiB
'type': 'file',
'format': 'iso'}
- model.storagevolumes_create('pool-3', params)
+ task_info = model.storagevolumes_create('pool-3', params)
+ wait_task(self._task_lookup, task_info['id'])
+
storagevolume = json.loads(self.request(
'/storagepools/kimchi_isos/storagevolumes/').read())[0]
--
1.9.1