mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
integration test is passed again
This commit is contained in:
parent
fdb523d219
commit
e8259e38c2
@ -40,10 +40,22 @@
|
||||
<module>storage/datamotion</module>
|
||||
<module>storage/cache</module>
|
||||
<module>storage/snapshot</module>
|
||||
<module>storage/integration-test</module>
|
||||
<module>components-api</module>
|
||||
<module>schema</module>
|
||||
<module>network</module>
|
||||
<module>service</module>
|
||||
</modules>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>integration-test</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>nonoss</name>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>storage/integration-test</module>
|
||||
</modules>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
@ -59,6 +59,7 @@ import com.cloud.host.dao.HostDao;
|
||||
import com.cloud.host.dao.HostDaoImpl;
|
||||
import com.cloud.host.dao.HostDetailsDaoImpl;
|
||||
import com.cloud.host.dao.HostTagsDaoImpl;
|
||||
import com.cloud.hypervisor.HypervisorGuruManager;
|
||||
import com.cloud.resource.ResourceManager;
|
||||
import com.cloud.server.ManagementServer;
|
||||
import com.cloud.server.auth.UserAuthenticator;
|
||||
@ -251,6 +252,11 @@ public class ChildTestConfiguration extends TestConfiguration {
|
||||
public AlertManager alertMgr() {
|
||||
return Mockito.mock(AlertManager.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public HypervisorGuruManager hypervisorGuruMgr() {
|
||||
return Mockito.mock(HypervisorGuruManager.class);
|
||||
}
|
||||
|
||||
public static class Library implements TypeFilter {
|
||||
|
||||
|
||||
@ -64,6 +64,7 @@ import org.testng.AssertJUnit;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.cloud.agent.AgentManager;
|
||||
import com.cloud.agent.api.Command;
|
||||
import com.cloud.dc.ClusterVO;
|
||||
import com.cloud.dc.DataCenterVO;
|
||||
import com.cloud.dc.HostPodVO;
|
||||
@ -75,6 +76,7 @@ import com.cloud.host.Host;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.host.Host.Type;
|
||||
import com.cloud.host.dao.HostDao;
|
||||
import com.cloud.hypervisor.HypervisorGuruManager;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.org.Cluster.ClusterType;
|
||||
import com.cloud.org.Managed.ManagedState;
|
||||
@ -87,6 +89,7 @@ import com.cloud.storage.SnapshotVO;
|
||||
import com.cloud.storage.Storage;
|
||||
import com.cloud.storage.StoragePoolStatus;
|
||||
import com.cloud.storage.VMTemplateVO;
|
||||
import com.cloud.storage.Storage.ImageFormat;
|
||||
import com.cloud.storage.Storage.StoragePoolType;
|
||||
import com.cloud.storage.Storage.TemplateType;
|
||||
import com.cloud.storage.dao.SnapshotDao;
|
||||
@ -133,6 +136,8 @@ public class SnapshotTest extends CloudStackTestNGBase {
|
||||
@Inject
|
||||
AgentManager agentMgr;
|
||||
@Inject
|
||||
HypervisorGuruManager hyGuruMgr;
|
||||
@Inject
|
||||
DataStoreManager dataStoreMgr;
|
||||
@Inject
|
||||
ResourceManager resourceMgr;
|
||||
@ -244,6 +249,7 @@ public class SnapshotTest extends CloudStackTestNGBase {
|
||||
DataObject templateOnStore = store.create(template);
|
||||
TemplateObjectTO to = new TemplateObjectTO();
|
||||
to.setPath(this.getImageInstallPath());
|
||||
to.setFormat(ImageFormat.VHD);
|
||||
CopyCmdAnswer answer = new CopyCmdAnswer(to);
|
||||
templateOnStore.processEvent(Event.CreateOnlyRequested);
|
||||
templateOnStore.processEvent(Event.OperationSuccessed, answer);
|
||||
@ -261,6 +267,8 @@ public class SnapshotTest extends CloudStackTestNGBase {
|
||||
Mockito.when(epSelector.select(Mockito.any(DataObject.class), Mockito.any(DataObject.class))).thenReturn(ep);
|
||||
Mockito.when(epSelector.select(Mockito.any(DataObject.class))).thenReturn(ep);
|
||||
Mockito.when(epSelector.select(Mockito.any(DataStore.class))).thenReturn(ep);
|
||||
Mockito.when(hyGuruMgr.getGuruProcessedCommandTargetHost(Mockito.anyLong(), Mockito.any(Command.class))).thenReturn(this.host.getId());
|
||||
|
||||
}
|
||||
|
||||
public DataStore createPrimaryDataStore() {
|
||||
|
||||
@ -65,6 +65,7 @@ import org.testng.AssertJUnit;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.cloud.agent.AgentManager;
|
||||
import com.cloud.agent.api.Command;
|
||||
import com.cloud.dc.ClusterVO;
|
||||
import com.cloud.dc.DataCenterVO;
|
||||
import com.cloud.dc.HostPodVO;
|
||||
@ -78,6 +79,7 @@ import com.cloud.host.Host.Type;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.host.dao.HostDao;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.hypervisor.HypervisorGuruManager;
|
||||
import com.cloud.org.Cluster.ClusterType;
|
||||
import com.cloud.org.Managed.ManagedState;
|
||||
import com.cloud.resource.ResourceManager;
|
||||
@ -85,6 +87,7 @@ import com.cloud.resource.ResourceState;
|
||||
import com.cloud.storage.DataStoreRole;
|
||||
import com.cloud.storage.ScopeType;
|
||||
import com.cloud.storage.Storage;
|
||||
import com.cloud.storage.Storage.ImageFormat;
|
||||
import com.cloud.storage.StoragePoolStatus;
|
||||
import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
|
||||
import com.cloud.storage.VMTemplateVO;
|
||||
@ -140,6 +143,8 @@ public class VolumeTest extends CloudStackTestNGBase {
|
||||
VolumeDataFactory volFactory;
|
||||
@Inject
|
||||
EndPointSelector epSelector;
|
||||
@Inject
|
||||
HypervisorGuruManager hyGuruMgr;
|
||||
long primaryStoreId;
|
||||
VMTemplateVO image;
|
||||
String imageStoreName = "testImageStore";
|
||||
@ -192,7 +197,7 @@ public class VolumeTest extends CloudStackTestNGBase {
|
||||
imageStore = new ImageStoreVO();
|
||||
imageStore.setName(imageStoreName);
|
||||
imageStore.setDataCenterId(dcId);
|
||||
imageStore.setProviderName("CloudStack ImageStore Provider");
|
||||
imageStore.setProviderName(DataStoreProvider.NFS_IMAGE);
|
||||
imageStore.setRole(DataStoreRole.Image);
|
||||
imageStore.setUrl(this.getSecondaryStorage());
|
||||
imageStore.setUuid(UUID.randomUUID().toString());
|
||||
@ -236,6 +241,7 @@ public class VolumeTest extends CloudStackTestNGBase {
|
||||
DataObject templateOnStore = store.create(template);
|
||||
TemplateObjectTO to = new TemplateObjectTO();
|
||||
to.setPath(this.getImageInstallPath());
|
||||
to.setFormat(ImageFormat.VHD);
|
||||
CopyCmdAnswer answer = new CopyCmdAnswer(to);
|
||||
templateOnStore.processEvent(Event.CreateOnlyRequested);
|
||||
templateOnStore.processEvent(Event.OperationSuccessed, answer);
|
||||
@ -253,6 +259,7 @@ public class VolumeTest extends CloudStackTestNGBase {
|
||||
Mockito.when(epSelector.select(Mockito.any(DataObject.class), Mockito.any(DataObject.class))).thenReturn(ep);
|
||||
Mockito.when(epSelector.select(Mockito.any(DataObject.class))).thenReturn(ep);
|
||||
Mockito.when(epSelector.select(Mockito.any(DataStore.class))).thenReturn(ep);
|
||||
Mockito.when(hyGuruMgr.getGuruProcessedCommandTargetHost(Mockito.anyLong(), Mockito.any(Command.class))).thenReturn(this.host.getId());
|
||||
}
|
||||
|
||||
public DataStore createPrimaryDataStore() {
|
||||
@ -297,7 +304,7 @@ public class VolumeTest extends CloudStackTestNGBase {
|
||||
pool.setPoolType(StoragePoolType.NetworkFilesystem);
|
||||
pool.setPodId(podId);
|
||||
pool.setScope(ScopeType.CLUSTER);
|
||||
pool.setStorageProviderName("cloudstack primary data store provider");
|
||||
pool.setStorageProviderName(DataStoreProvider.DEFAULT_PRIMARY);
|
||||
pool = this.primaryStoreDao.persist(pool);
|
||||
DataStore store = this.dataStoreMgr.getPrimaryDataStore(pool.getId());
|
||||
return store;
|
||||
|
||||
@ -61,7 +61,6 @@
|
||||
<bean id="dataStoreManagerImpl" class="org.apache.cloudstack.storage.datastore.DataStoreManagerImpl" />
|
||||
<bean id="primaryDataStoreProviderManagerImpl" class="org.apache.cloudstack.storage.datastore.manager.PrimaryDataStoreProviderManagerImpl" />
|
||||
<bean id="imageStoreProviderManagerImpl" class="org.apache.cloudstack.storage.image.manager.ImageStoreProviderManagerImpl" />
|
||||
<bean id="hypervsiorHostEndPointRpcServer" class="org.apache.cloudstack.storage.HypervsiorHostEndPointRpcServer" />
|
||||
<bean id="iSCSI" class="org.apache.cloudstack.storage.datastore.type.ISCSI" />
|
||||
<bean id="ISO" class="org.apache.cloudstack.storage.image.format.ISO" />
|
||||
<bean id="templateDataFactoryImpl" class="org.apache.cloudstack.storage.image.TemplateDataFactoryImpl" />
|
||||
@ -88,4 +87,5 @@
|
||||
<bean id="swiftImageStoreProviderImpl" class="org.apache.cloudstack.storage.datastore.provider.SwiftImageStoreProviderImpl" />
|
||||
<bean id="BAREMETAL" class="org.apache.cloudstack.storage.image.format.BAREMETAL" />
|
||||
<bean id="storagePoolAutomationImpl" class="com.cloud.storage.StoragePoolAutomationImpl" />
|
||||
<bean id="AccountGuestVlanMapDaoImpl" class="com.cloud.network.dao.AccountGuestVlanMapDaoImpl" />
|
||||
</beans>
|
||||
|
||||
@ -45,6 +45,11 @@
|
||||
<artifactId>cloud-framework-ipc</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cloudstack</groupId>
|
||||
<artifactId>cloud-secondary-storage</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cloudstack</groupId>
|
||||
<artifactId>cloud-engine-api</artifactId>
|
||||
|
||||
@ -24,6 +24,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
|
||||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
|
||||
import org.apache.cloudstack.storage.command.CopyCommand;
|
||||
import org.apache.cloudstack.storage.command.DownloadCommand;
|
||||
import org.apache.cloudstack.storage.resource.LocalNfsSecondaryStorageResource;
|
||||
|
||||
import com.cloud.agent.Listener;
|
||||
import com.cloud.agent.api.Answer;
|
||||
@ -37,7 +38,7 @@ public class LocalHostEndpoint implements EndPoint {
|
||||
private ScheduledExecutorService executor;
|
||||
ServerResource resource;
|
||||
public LocalHostEndpoint() {
|
||||
//FIXME resource = new LocalNfsSecondaryStorageResource();
|
||||
resource = new LocalNfsSecondaryStorageResource();
|
||||
executor = Executors.newScheduledThreadPool(10);
|
||||
}
|
||||
@Override
|
||||
|
||||
@ -853,6 +853,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
|
||||
TemplateObjectTO newVol = new TemplateObjectTO();
|
||||
newVol.setUuid(snapshotvdi.getUuid(conn));
|
||||
newVol.setPath(newVol.getUuid());
|
||||
newVol.setFormat(ImageFormat.VHD);
|
||||
return new CopyCmdAnswer(newVol);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
|
||||
@ -179,7 +179,6 @@ CREATE TABLE `cloud`.`snapshot_store_ref` (
|
||||
`update_count` bigint unsigned,
|
||||
`updated` datetime,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `fk_snapshot_store_ref__store_id` FOREIGN KEY `fk_snapshot_store_ref__store_id` (`store_id`) REFERENCES `image_store` (`id`) ON DELETE CASCADE,
|
||||
INDEX `i_snapshot_store_ref__store_id`(`store_id`),
|
||||
CONSTRAINT `fk_snapshot_store_ref__snapshot_id` FOREIGN KEY `fk_snapshot_store_ref__snapshot_id` (`snapshot_id`) REFERENCES `snapshots` (`id`),
|
||||
INDEX `i_snapshot_store_ref__snapshot_id`(`snapshot_id`)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user