mirror of https://github.com/apache/cloudstack.git
fix test failures
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
39d07a0905
commit
a485605e7a
|
|
@ -153,7 +153,7 @@ public class VolumeJoinVOToDiskConverter {
|
|||
// Properties
|
||||
da.setActive("true");
|
||||
da.setBootable(String.valueOf(Volume.Type.ROOT.equals(vol.getVolumeType())));
|
||||
da.setIface("virtio");
|
||||
da.setIface("virtio_scsi");
|
||||
da.setLogicalName(vol.getName());
|
||||
da.setReadOnly("false");
|
||||
da.setPassDiscard("false");
|
||||
|
|
|
|||
|
|
@ -70,11 +70,11 @@ public class OvfXmlUtilTest {
|
|||
String instanceConfig = OvfXmlUtil.getConfigMetadataXml(vm, mock(Logger.class));
|
||||
assertNotNull(instanceConfig);
|
||||
assertTrue(instanceConfig.contains("ovf:CloudStackMetadata_Type"));
|
||||
assertTrue(instanceConfig.contains("<NetworkId>6965c1cf-8d44-4622-82e2-4dbbe4a58355</NetworkId>"));
|
||||
assertTrue(instanceConfig.contains("<NetworkId>6aff2178-a323-4148-a592-edbd47b93229</NetworkId>"));
|
||||
|
||||
Pair<String, String> result = OvfXmlUtil.getVmNicDetailFromStoredConfig(instanceConfig, "6965c1cf-8d44-4622-82e2-4dbbe4a58355", mock(Logger.class));
|
||||
Pair<String, String> result = OvfXmlUtil.getVmNicDetailFromStoredConfig(instanceConfig, "6aff2178-a323-4148-a592-edbd47b93229", mock(Logger.class));
|
||||
assertNotNull(result);
|
||||
assertEquals("1e:01:50:00:00:fd", result.first());
|
||||
assertEquals("10.1.1.103", result.second());
|
||||
assertEquals("02:01:00:cf:00:05", result.first());
|
||||
assertEquals("10.1.1.40", result.second());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,31 @@ import java.util.Optional;
|
|||
import java.util.TimeZone;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.command.admin.backup.CloneBackupOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.backup.ImportBackupOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.backup.UpdateBackupOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.user.backup.CreateBackupCmd;
|
||||
import org.apache.cloudstack.api.command.user.backup.CreateBackupScheduleCmd;
|
||||
import org.apache.cloudstack.api.command.user.backup.DeleteBackupScheduleCmd;
|
||||
import org.apache.cloudstack.api.command.user.backup.ListBackupOfferingsCmd;
|
||||
import org.apache.cloudstack.api.command.user.backup.ListBackupScheduleCmd;
|
||||
import org.apache.cloudstack.api.response.BackupResponse;
|
||||
import org.apache.cloudstack.backup.dao.BackupDao;
|
||||
import org.apache.cloudstack.backup.dao.BackupDetailsDao;
|
||||
import org.apache.cloudstack.backup.dao.BackupOfferingDao;
|
||||
import org.apache.cloudstack.backup.dao.BackupOfferingDetailsDao;
|
||||
import org.apache.cloudstack.backup.dao.BackupScheduleDao;
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
import org.apache.cloudstack.framework.config.ConfigKey;
|
||||
import org.apache.cloudstack.framework.config.impl.ConfigDepotImpl;
|
||||
import org.apache.cloudstack.framework.jobs.AsyncJobManager;
|
||||
import org.apache.cloudstack.framework.jobs.impl.AsyncJobVO;
|
||||
import org.apache.cloudstack.reservation.ReservationVO;
|
||||
import org.apache.cloudstack.reservation.dao.ReservationDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
|
|
@ -58,32 +83,6 @@ import org.mockito.junit.MockitoJUnitRunner;
|
|||
import org.mockito.stubbing.Answer;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.command.admin.backup.CloneBackupOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.backup.ImportBackupOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.backup.UpdateBackupOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.user.backup.CreateBackupCmd;
|
||||
import org.apache.cloudstack.api.command.user.backup.CreateBackupScheduleCmd;
|
||||
import org.apache.cloudstack.api.command.user.backup.DeleteBackupScheduleCmd;
|
||||
import org.apache.cloudstack.api.command.user.backup.ListBackupOfferingsCmd;
|
||||
import org.apache.cloudstack.api.command.user.backup.ListBackupScheduleCmd;
|
||||
import org.apache.cloudstack.api.response.BackupResponse;
|
||||
import org.apache.cloudstack.backup.dao.BackupDao;
|
||||
import org.apache.cloudstack.backup.dao.BackupDetailsDao;
|
||||
import org.apache.cloudstack.backup.dao.BackupOfferingDetailsDao;
|
||||
import org.apache.cloudstack.backup.dao.BackupOfferingDao;
|
||||
import org.apache.cloudstack.backup.dao.BackupScheduleDao;
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
import org.apache.cloudstack.framework.config.ConfigKey;
|
||||
import org.apache.cloudstack.framework.config.impl.ConfigDepotImpl;
|
||||
import org.apache.cloudstack.framework.jobs.AsyncJobManager;
|
||||
import org.apache.cloudstack.framework.jobs.impl.AsyncJobVO;
|
||||
import org.apache.cloudstack.reservation.ReservationVO;
|
||||
import org.apache.cloudstack.reservation.dao.ReservationDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
|
||||
|
||||
import com.cloud.alert.AlertManager;
|
||||
import com.cloud.api.query.dao.UserVmJoinDao;
|
||||
import com.cloud.api.query.vo.UserVmJoinVO;
|
||||
|
|
@ -274,6 +273,7 @@ public class BackupManagerTest {
|
|||
private String[] datastoresPossibleValues = {"e9804933-8609-4de3-bccc-6278072a496c", "datastore-name"};
|
||||
private AutoCloseable closeable;
|
||||
private ConfigDepotImpl configDepotImpl;
|
||||
private ConfigKey backupFrameworkConfigKey = BackupManager.BackupFrameworkEnabled;
|
||||
private boolean updatedConfigKeyDepot = false;
|
||||
private MockedStatic<DbUtil> dbUtilMockedStatic;
|
||||
private final List<String> mockedGlobalLocks = new ArrayList<>();
|
||||
|
|
@ -341,7 +341,10 @@ public class BackupManagerTest {
|
|||
dbUtilMockedStatic.close();
|
||||
closeable.close();
|
||||
if (updatedConfigKeyDepot) {
|
||||
ReflectionTestUtils.setField(BackupManager.BackupFrameworkEnabled, "s_depot", configDepotImpl);
|
||||
ConfigKey configKey = BackupManager.BackupFrameworkEnabled;
|
||||
ReflectionTestUtils.setField(configKey, "s_depot", configDepotImpl);
|
||||
ReflectionTestUtils.setField(configKey, "_value", null);
|
||||
updatedConfigKeyDepot = false;
|
||||
}
|
||||
CallContext.unregister();
|
||||
}
|
||||
|
|
@ -350,6 +353,7 @@ public class BackupManagerTest {
|
|||
ConfigKey configKey = BackupManager.BackupFrameworkEnabled;
|
||||
this.configDepotImpl = (ConfigDepotImpl) ReflectionTestUtils.getField(configKey, "s_depot");
|
||||
ConfigDepotImpl configDepot = Mockito.mock(ConfigDepotImpl.class);
|
||||
ReflectionTestUtils.setField(configKey, "_value", null);
|
||||
Mockito.when(configDepot.getConfigStringValue(Mockito.eq(BackupManager.BackupFrameworkEnabled.key()),
|
||||
Mockito.eq(ConfigKey.Scope.Global), Mockito.isNull())).thenReturn("true");
|
||||
Mockito.when(configDepot.getConfigStringValue(Mockito.eq(BackupManager.BackupFrameworkEnabled.key()),
|
||||
|
|
|
|||
Loading…
Reference in New Issue