Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO
private SearchBuilder<SnapshotDataStoreVO> searchFilteringStoreIdEqStoreRoleEqStateNeqRefCntNeq;
protected SearchBuilder<SnapshotDataStoreVO> searchFilteringStoreIdEqStateEqStoreRoleEqIdEqUpdateCountEqSnapshotIdEqVolumeIdEq;
private SearchBuilder<SnapshotDataStoreVO> stateSearch;
private SearchBuilder<SnapshotDataStoreVO> idStateNeqSearch;
private SearchBuilder<SnapshotDataStoreVO> idStateNinSearch;
protected SearchBuilder<SnapshotVO> snapshotVOSearch;
private SearchBuilder<SnapshotDataStoreVO> snapshotCreatedSearch;
private SearchBuilder<SnapshotDataStoreVO> dataStoreAndInstallPathSearch;
Expand Down Expand Up @@ -146,10 +146,10 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
stateSearch.done();


idStateNeqSearch = createSearchBuilder();
idStateNeqSearch.and(SNAPSHOT_ID, idStateNeqSearch.entity().getSnapshotId(), SearchCriteria.Op.EQ);
idStateNeqSearch.and(STATE, idStateNeqSearch.entity().getState(), SearchCriteria.Op.NEQ);
idStateNeqSearch.done();
idStateNinSearch = createSearchBuilder();
idStateNinSearch.and(SNAPSHOT_ID, idStateNinSearch.entity().getSnapshotId(), SearchCriteria.Op.EQ);
idStateNinSearch.and(STATE, idStateNinSearch.entity().getState(), SearchCriteria.Op.NOTIN);
idStateNinSearch.done();

snapshotVOSearch = snapshotDao.createSearchBuilder();
snapshotVOSearch.and(VOLUME_ID, snapshotVOSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
Expand Down Expand Up @@ -480,15 +480,15 @@ public List<SnapshotDataStoreVO> findBySnapshotId(long snapshotId) {

@Override
public List<SnapshotDataStoreVO> findBySnapshotIdWithNonDestroyedState(long snapshotId) {
SearchCriteria<SnapshotDataStoreVO> sc = idStateNeqSearch.create();
SearchCriteria<SnapshotDataStoreVO> sc = idStateNinSearch.create();
sc.setParameters(SNAPSHOT_ID, snapshotId);
sc.setParameters(STATE, State.Destroyed.name());
return listBy(sc);
}

@Override
public List<SnapshotDataStoreVO> findBySnapshotIdAndNotInDestroyedHiddenState(long snapshotId) {
SearchCriteria<SnapshotDataStoreVO> sc = idStateNeqSearch.create();
SearchCriteria<SnapshotDataStoreVO> sc = idStateNinSearch.create();
sc.setParameters(SNAPSHOT_ID, snapshotId);
sc.setParameters(STATE, State.Destroyed.name(), State.Hidden.name());
return listBy(sc);
Expand Down
16 changes: 11 additions & 5 deletions test/integration/smoke/test_secondary_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ def test_01_sys_vm_start(self):
'Up',
"Check state of primary storage pools is Up or not"
)
for _ in range(2):
# Poll until all SSVMs are Running, or timeout after 3 minutes
timeout = 180
interval = 15
list_ssvm_response = []
while timeout > 0:
list_ssvm_response = list_ssvms(
self.apiclient,
systemvmtype='secondarystoragevm',
Expand All @@ -154,10 +158,12 @@ def test_01_sys_vm_start(self):
"Check list System VMs response"
)

for ssvm in list_ssvm_response:
if ssvm.state != 'Running':
time.sleep(30)
continue
if all(ssvm.state == 'Running' for ssvm in list_ssvm_response):
break

time.sleep(interval)
timeout -= interval

for ssvm in list_ssvm_response:
self.assertEqual(
ssvm.state,
Expand Down
Loading