Add more detail when unable to schedule cleanup

clean up tests for security group manager v2

move interval to listener -- allows it to be configurable if needed

fix mocks

Enhanced logging for security group manager (from zucchini)

fix merge issues

merge issues
This commit is contained in:
Chiradeep Vittal 2011-09-06 17:22:33 -07:00
parent 1f3c6efb81
commit 3cb4ad4934
12 changed files with 169 additions and 411 deletions

View File

@ -357,7 +357,7 @@ public class MockVmManagerImpl implements MockVmManager {
if (vm == null) {
return new SecurityIngressRuleAnswer(cmd, false, "cant' find the vm: " + cmd.getVmName());
}
boolean update = logSecurityGroupAction(cmd);
MockSecurityRulesVO rules = _mockSecurityDao.findByVmId(cmd.getVmId());
if (rules == null) {
rules = new MockSecurityRulesVO();
@ -368,7 +368,7 @@ public class MockVmManagerImpl implements MockVmManager {
rules.setHostId(vm.getHostId());
_mockSecurityDao.persist(rules);
} else {
} else if (update){
rules.setSeqNum(cmd.getSeqNum());
rules.setSignature(cmd.getSignature());
rules.setRuleSet(cmd.stringifyRules());
@ -379,6 +379,56 @@ public class MockVmManagerImpl implements MockVmManager {
return new SecurityIngressRuleAnswer(cmd);
}
private boolean logSecurityGroupAction(SecurityIngressRulesCmd cmd) {
String action = ", do nothing";
String reason = ", reason=";
MockSecurityRulesVO rule = _mockSecurityDao.findByVmId(cmd.getVmId());
Long currSeqnum = rule == null? null: rule.getSeqNum();
String currSig = rule == null? null: rule.getSignature();
boolean updateSeqnoAndSig = false;
if (currSeqnum != null) {
if (cmd.getSeqNum() > currSeqnum) {
s_logger.info("New seqno received: " + cmd.getSeqNum() + " curr=" + currSeqnum);
updateSeqnoAndSig = true;
if (!cmd.getSignature().equals(currSig)) {
s_logger.info("New seqno received: " + cmd.getSeqNum() + " curr=" + currSeqnum
+ " new signature received:" + cmd.getSignature() + " curr=" + currSig + ", updated iptables");
action = ", updated iptables";
reason = reason + "seqno_increased_sig_changed";
} else {
s_logger.info("New seqno received: " + cmd.getSeqNum() + " curr=" + currSeqnum
+ " no change in signature:" + cmd.getSignature() + ", do nothing");
reason = reason + "seqno_increased_sig_same";
}
} else if (cmd.getSeqNum() < currSeqnum) {
s_logger.info("Older seqno received: " + cmd.getSeqNum() + " curr=" + currSeqnum + ", do nothing");
reason = reason + "seqno_decreased";
} else {
if (!cmd.getSignature().equals(currSig)) {
s_logger.info("Identical seqno received: " + cmd.getSeqNum()
+ " new signature received:" + cmd.getSignature() + " curr=" + currSig + ", updated iptables");
action = ", updated iptables";
reason = reason + "seqno_same_sig_changed";
updateSeqnoAndSig = true;
} else {
s_logger.info("Identical seqno received: " + cmd.getSeqNum() + " curr=" + currSeqnum
+ " no change in signature:" + cmd.getSignature() + ", do nothing");
reason = reason + "seqno_same_sig_same";
}
}
} else {
s_logger.info("New seqno received: " + cmd.getSeqNum() + " old=null");
updateSeqnoAndSig = true;
action = ", updated iptables";
reason = ", seqno_new";
}
s_logger.info("Programmed network rules for vm " + cmd.getVmName() + " seqno=" + cmd.getSeqNum()
+ " signature=" + cmd.getSignature()
+ " guestIp=" + cmd.getGuestIp() + ", numrules="
+ cmd.getRuleSet().length + " total cidrs=" + cmd.getTotalNumCidrs() + action + reason);
return updateSeqnoAndSig;
}
@Override
public Answer SavePassword(SavePasswordCommand cmd) {

View File

@ -17,12 +17,9 @@
*/
package com.cloud.agent.api;
import java.util.Random;
public class CleanupNetworkRulesCmd extends Command implements CronCommand {
static private Random random = new Random();
private int interval = 10*60;
@Override
@ -31,9 +28,9 @@ public class CleanupNetworkRulesCmd extends Command implements CronCommand {
}
public CleanupNetworkRulesCmd() {
public CleanupNetworkRulesCmd(int intervalSecs) {
super();
interval = 8*60 + random.nextInt(120);
interval = intervalSecs;
}

View File

@ -1,233 +0,0 @@
/**
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
*
* This software is licensed under the GNU General Public License v3 or later.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.cloud.api.commands;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import com.cloud.api.ApiConstants;
import com.cloud.api.BaseAsyncCmd;
import com.cloud.api.BaseCmd;
import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.ServerApiException;
import com.cloud.api.response.EgressRuleResponse;
import com.cloud.api.response.SecurityGroupResponse;
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.security.EgressRule;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
import com.cloud.utils.StringUtils;
@Implementation(responseObject = EgressRuleResponse.class, description = "Authorizes a particular ingress rule for this security group")
@SuppressWarnings("rawtypes")
public class AuthorizeSecurityGroupEgressCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(AuthorizeSecurityGroupEgressCmd.class.getName());
private static final String s_name = "authorizesecuritygroupingress";
// ///////////////////////////////////////////////////
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, description = "TCP is default. UDP is the other supported protocol")
private String protocol;
@Parameter(name = ApiConstants.START_PORT, type = CommandType.INTEGER, description = "start port for this ingress rule")
private Integer startPort;
@Parameter(name = ApiConstants.END_PORT, type = CommandType.INTEGER, description = "end port for this ingress rule")
private Integer endPort;
@Parameter(name = ApiConstants.ICMP_TYPE, type = CommandType.INTEGER, description = "type of the icmp message being sent")
private Integer icmpType;
@Parameter(name = ApiConstants.ICMP_CODE, type = CommandType.INTEGER, description = "error code for this icmp message")
private Integer icmpCode;
@Parameter(name=ApiConstants.CIDR_LIST, type=CommandType.LIST, collectionType=CommandType.STRING, description="the cidr list associated")
private List cidrList;
@Parameter(name = ApiConstants.USER_SECURITY_GROUP_LIST, type = CommandType.MAP, description = "user to security group mapping")
private Map userSecurityGroupList;
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="an optional domainId for the security group. If the account parameter is used, domainId must also be used.")
private Long domainId;
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="an optional account for the virtual machine. Must be used with domainId.")
private String accountName;
@Parameter(name=ApiConstants.SECURITY_GROUP_ID, type=CommandType.LONG, description="The ID of the security group. Mutually exclusive with securityGroupName parameter")
private Long securityGroupId;
@Parameter(name=ApiConstants.SECURITY_GROUP_NAME, type=CommandType.STRING, description="The name of the security group. Mutually exclusive with securityGroupName parameter")
private String securityGroupName;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
public String getAccountName() {
return accountName;
}
public List getCidrList() {
return cidrList;
}
public Integer getEndPort() {
return endPort;
}
public Integer getIcmpCode() {
return icmpCode;
}
public Integer getIcmpType() {
return icmpType;
}
public Long getSecurityGroupId() {
if (securityGroupId != null && securityGroupName != null) {
throw new InvalidParameterValueException("securityGroupId and securityGroupName parameters are mutually exclusive");
}
if (securityGroupName != null) {
securityGroupId = _responseGenerator.getSecurityGroupId(securityGroupName, getEntityOwnerId());
if (securityGroupId == null) {
throw new InvalidParameterValueException("Unable to find security group " + securityGroupName + " for account id=" + getEntityOwnerId());
}
securityGroupName = null;
}
if (securityGroupId == null) {
throw new InvalidParameterValueException("Either securityGroupId or securityGroupName is required by authorizeSecurityGroupEgress command");
}
return securityGroupId;
}
public String getProtocol() {
if (protocol == null) {
return "all";
}
return protocol;
}
public Integer getStartPort() {
return startPort;
}
public Map getUserSecurityGroupList() {
return userSecurityGroupList;
}
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public String getCommandName() {
return s_name;
}
public static String getResultObjectName() {
return "securitygroup";
}
@Override
public long getEntityOwnerId() {
Account account = UserContext.current().getCaller();
if ((account == null) || isAdmin(account.getType())) {
if ((domainId != null) && (accountName != null)) {
Account userAccount = _responseGenerator.findAccountByNameDomain(accountName, domainId);
if (userAccount != null) {
return userAccount.getId();
} else {
throw new InvalidParameterValueException("Unable to find account by name " + accountName + " in domain " + domainId);
}
}
}
return account.getId();
}
@Override
public String getEventType() {
return EventTypes.EVENT_SECURITY_GROUP_AUTHORIZE_INGRESS;
}
@Override
public String getEventDescription() {
StringBuilder sb = new StringBuilder();
if (getUserSecurityGroupList() != null) {
sb.append("group list(group/account): ");
Collection userGroupCollection = getUserSecurityGroupList().values();
Iterator iter = userGroupCollection.iterator();
HashMap userGroup = (HashMap) iter.next();
String group = (String) userGroup.get("group");
String authorizedAccountName = (String) userGroup.get("account");
sb.append(group + "/" + authorizedAccountName);
while (iter.hasNext()) {
userGroup = (HashMap) iter.next();
group = (String) userGroup.get("group");
authorizedAccountName = (String) userGroup.get("account");
sb.append(", " + group + "/" + authorizedAccountName);
}
} else if (getCidrList() != null) {
sb.append("cidr list: ");
sb.append(StringUtils.join(getCidrList(), ", "));
} else {
sb.append("<error: no ingress parameters>");
}
return "authorizing ingress to group: " + getSecurityGroupId() + " to " + sb.toString();
}
@Override
public void execute() {
List<? extends EgressRule> egressRules = _securityGroupService.authorizeSecurityGroupEgress(this);
if (egressRules != null && !egressRules.isEmpty()) {
SecurityGroupResponse response = _responseGenerator.createSecurityGroupResponseFromEgressRule(egressRules);
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to authorize security group ingress rule(s)");
}
}
@Override
public AsyncJob.Type getInstanceType() {
return AsyncJob.Type.SecurityGroup;
}
@Override
public Long getInstanceId() {
return getSecurityGroupId();
}
}

View File

@ -1,109 +0,0 @@
/**
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
*
* This software is licensed under the GNU General Public License v3 or later.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.cloud.api.commands;
import org.apache.log4j.Logger;
import com.cloud.api.ApiConstants;
import com.cloud.api.BaseAsyncCmd;
import com.cloud.api.BaseCmd;
import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.ServerApiException;
import com.cloud.api.response.SuccessResponse;
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.security.SecurityGroup;
import com.cloud.user.Account;
@Implementation(responseObject = SuccessResponse.class, description = "Deletes a particular ingress rule from this security group")
public class RevokeSecurityGroupEgressCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(RevokeSecurityGroupEgressCmd.class.getName());
private static final String s_name = "revokesecuritygroupingress";
// ///////////////////////////////////////////////////
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "The ID of the ingress rule")
private Long id;
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
public Long getId() {
return id;
}
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public String getCommandName() {
return s_name;
}
public static String getResultObjectName() {
return "revokesecuritygroupingress";
}
@Override
public long getEntityOwnerId() {
SecurityGroup group = _entityMgr.findById(SecurityGroup.class, getId());
if (group != null) {
return group.getAccountId();
}
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
@Override
public String getEventType() {
return EventTypes.EVENT_SECURITY_GROUP_REVOKE_INGRESS;
}
@Override
public String getEventDescription() {
return "revoking ingress rule id: " + getId();
}
@Override
public void execute() {
boolean result = _securityGroupService.revokeSecurityGroupEgress(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to revoke security group ingress rule");
}
}
@Override
public AsyncJob.Type getInstanceType() {
return AsyncJob.Type.SecurityGroup;
}
@Override
public Long getInstanceId() {
return getId();
}
}

View File

@ -20,12 +20,10 @@ package com.cloud.network.security;
import java.util.List;
import com.cloud.api.commands.AuthorizeSecurityGroupIngressCmd;
import com.cloud.api.commands.AuthorizeSecurityGroupEgressCmd;
import com.cloud.api.commands.CreateSecurityGroupCmd;
import com.cloud.api.commands.DeleteSecurityGroupCmd;
import com.cloud.api.commands.ListSecurityGroupsCmd;
import com.cloud.api.commands.RevokeSecurityGroupIngressCmd;
import com.cloud.api.commands.RevokeSecurityGroupEgressCmd;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.PermissionDeniedException;
import com.cloud.exception.ResourceInUseException;
@ -38,7 +36,6 @@ public interface SecurityGroupService {
*/
public SecurityGroup createSecurityGroup(CreateSecurityGroupCmd command) throws PermissionDeniedException, InvalidParameterValueException;
boolean revokeSecurityGroupIngress(RevokeSecurityGroupIngressCmd cmd);
boolean revokeSecurityGroupEgress(RevokeSecurityGroupEgressCmd cmd);
boolean deleteSecurityGroup(DeleteSecurityGroupCmd cmd) throws ResourceInUseException;
@ -50,6 +47,5 @@ public interface SecurityGroupService {
public List<? extends SecurityGroupRules> searchForSecurityGroupRules(ListSecurityGroupsCmd cmd) throws PermissionDeniedException, InvalidParameterValueException;
public List<? extends IngressRule> authorizeSecurityGroupIngress(AuthorizeSecurityGroupIngressCmd cmd);
public List<? extends EgressRule> authorizeSecurityGroupEgress(AuthorizeSecurityGroupEgressCmd cmd);
}

View File

@ -20,6 +20,7 @@ package com.cloud.network.security;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.log4j.Logger;
@ -51,6 +52,8 @@ public class SecurityGroupListener implements Listener {
public static final Logger s_logger = Logger.getLogger(SecurityGroupListener.class.getName());
private static final int MAX_RETRIES_ON_FAILURE = 3;
private static final int MIN_TIME_BETWEEN_CLEANUPS = 30*60;//30 minutes
private final Random _cleanupRandom = new Random();
SecurityGroupManagerImpl _securityGroupManager;
AgentManager _agentMgr;
@ -81,7 +84,7 @@ public class SecurityGroupListener implements Listener {
@Override
public boolean processAnswers(long agentId, long seq, Answer[] answers) {
Set<Long> affectedVms = new HashSet<Long>();
List<Long> affectedVms = new ArrayList<Long>();
int commandNum = 0;
for (Answer ans: answers) {
if (ans instanceof SecurityIngressRuleAnswer) {
@ -158,13 +161,15 @@ public class SecurityGroupListener implements Listener {
if (cmd instanceof StartupRoutingCommand) {
//if (Boolean.toString(true).equals(host.getDetail("can_bridge_firewall"))) {
try {
CleanupNetworkRulesCmd cleanupCmd = new CleanupNetworkRulesCmd();
int interval = MIN_TIME_BETWEEN_CLEANUPS + _cleanupRandom.nextInt(MIN_TIME_BETWEEN_CLEANUPS/2);
CleanupNetworkRulesCmd cleanupCmd = new CleanupNetworkRulesCmd(interval);
Commands c = new Commands(cleanupCmd);
_agentMgr.send(host.getId(), c, this);
if(s_logger.isInfoEnabled())
s_logger.info("Scheduled network rules cleanup, interval=" + cleanupCmd.getInterval());
} catch (AgentUnavailableException e) {
s_logger.warn("Unable to schedule network rules cleanup");
//usually hypervisors that do not understand sec group rules.
s_logger.debug("Unable to schedule network rules cleanup for host " + host.getId(), e);
}
}
}

View File

@ -266,4 +266,10 @@ public class MockAgentManagerImpl implements AgentManager {
}
@Override
public boolean disconnect(long hostId) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -27,7 +27,9 @@ import com.cloud.network.Networks.TrafficType;
import com.cloud.network.addr.PublicIp;
import com.cloud.network.guru.NetworkGuru;
import com.cloud.network.rules.FirewallRule;
import com.cloud.network.rules.StaticNat;
import com.cloud.network.vpn.PasswordResetElement;
import com.cloud.network.vpn.RemoteAccessVpnElement;
import com.cloud.offering.NetworkOffering;
import com.cloud.offerings.NetworkOfferingVO;
import com.cloud.user.Account;
@ -186,11 +188,7 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
return null;
}
@Override
public PublicIp assignPublicIpAddress(long dcId, Long podId, Account owner, VlanType type, Long networkId) throws InsufficientAddressCapacityException {
// TODO Auto-generated method stub
return null;
}
@Override
public PublicIp assignSourceNatIpAddress(Account owner, Network network, long callerId) throws ConcurrentOperationException, InsufficientAddressCapacityException {
@ -456,4 +454,52 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
return null;
}
@Override
public PublicIp assignPublicIpAddress(long dcId, Long podId, Account owner, VlanType type, Long networkId, String requestedIp) throws InsufficientAddressCapacityException {
// TODO Auto-generated method stub
return null;
}
@Override
public List<? extends RemoteAccessVpnElement> getRemoteAccessVpnElements() {
// TODO Auto-generated method stub
return null;
}
@Override
public String acquireGuestIpAddress(Network network, String requestedIp) {
// TODO Auto-generated method stub
return null;
}
@Override
public String getGlobalGuestDomainSuffix() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getStartIpAddress(long networkId) {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean applyStaticNats(List<? extends StaticNat> staticNats, boolean continueOnError) throws ResourceUnavailableException {
// TODO Auto-generated method stub
return false;
}
@Override
public String getIpInNetwork(long vmId, long networkId) {
// TODO Auto-generated method stub
return null;
}
@Override
public String getIpInNetworkIncludingRemoved(long vmId, long networkId) {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -10,11 +10,6 @@ import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import static org.mockito.Mockito.*;
import com.cloud.agent.AgentManager;
import com.cloud.agent.MockAgentManagerImpl;
import com.cloud.configuration.DefaultInterceptorLibrary;
@ -35,7 +30,6 @@ import com.cloud.utils.component.ComponentLocator;
import com.cloud.utils.component.MockComponentLocator;
import com.cloud.vm.MockUserVmManagerImpl;
import com.cloud.vm.MockVirtualMachineManagerImpl;
import com.cloud.vm.UserVmVO;
import com.cloud.vm.VirtualMachineName;
import com.cloud.vm.dao.UserVmDao;
import com.cloud.vm.dao.UserVmDaoImpl;
@ -71,22 +65,7 @@ public class SecurityGroupManagerImpl2Test extends TestCase {
locator.addManager("AccountManager", MockAccountManagerImpl.class);
locator.makeActive(new DefaultInterceptorLibrary());
_sgMgr = ComponentLocator.inject(SecurityGroupManagerImpl2.class);
_vmDao = spy((UserVmDaoImpl)locator.getDao(UserVmDao.class));
when(_vmDao.findById(anyLong())).thenAnswer(new Answer<UserVmVO>() {
@Override
public UserVmVO answer(InvocationOnMock invocation) throws Throwable {
Object[] args = invocation.getArguments();
Long vmId = (Long) args[0];
String vmName = VirtualMachineName.getVmName(vmId,3, "VM");
UserVmVO result = new UserVmVO(vmId, vmName, vmName, 1, HypervisorType.XenServer, 5, false, false, 1, 3, 1, null, vmName);
result.setHostId(vmId);
return result;
}
});
AgentManager agentMgr = spy(locator.getManager(AgentManager.class));
}
@Override

View File

@ -0,0 +1,15 @@
package com.cloud.storage.dao;
import junit.framework.TestCase;
import com.cloud.storage.StoragePoolStatus;
import com.cloud.utils.component.ComponentLocator;
public class StoragePoolDaoTest extends TestCase {
public void testCountByStatus() {
StoragePoolDaoImpl dao = ComponentLocator.inject(StoragePoolDaoImpl.class);
long count = dao.countPoolsByStatus(StoragePoolStatus.Up);
System.out.println("Found " + count + " storage pools");
}
}

View File

@ -8,6 +8,7 @@ import javax.ejb.Local;
import javax.naming.ConfigurationException;
import com.cloud.acl.ControlledEntity;
import com.cloud.acl.SecurityChecker.AccessType;
import com.cloud.api.commands.CreateAccountCmd;
import com.cloud.api.commands.CreateUserCmd;
import com.cloud.api.commands.DeleteAccountCmd;
@ -291,11 +292,6 @@ public class MockAccountManagerImpl implements Manager, AccountManager {
}
@Override
public void checkAccess(Account account, ControlledEntity... entities) throws PermissionDeniedException {
// TODO Auto-generated method stub
}
@Override
public boolean cleanupAccount(AccountVO account, long callerUserId, Account caller) {
@ -337,4 +333,10 @@ public class MockAccountManagerImpl implements Manager, AccountManager {
return null;
}
@Override
public void checkAccess(Account account, AccessType accessType, ControlledEntity... entities) throws PermissionDeniedException {
// TODO Auto-generated method stub
}
}

View File

@ -268,29 +268,7 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
return null;
}
@Override
public UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> securityGroupIdList, Account owner,
String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair) throws InsufficientCapacityException,
ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException {
// TODO Auto-generated method stub
return null;
}
@Override
public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList,
List<Long> securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData,
String sshKeyPair) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException {
// TODO Auto-generated method stub
return null;
}
@Override
public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList, Account owner, String hostName,
String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair) throws InsufficientCapacityException,
ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException {
// TODO Auto-generated method stub
return null;
}
@Override
public UserVm startVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException {
@ -365,4 +343,30 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
return null;
}
@Override
public UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> securityGroupIdList, Account owner,
String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, String> requestedIps,
String defaultIp, String keyboard) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException,
ResourceAllocationException {
// TODO Auto-generated method stub
return null;
}
@Override
public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList,
List<Long> securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData,
String sshKeyPair, Map<Long, String> requestedIps, String defaultIp, String keyboard) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException,
StorageUnavailableException, ResourceAllocationException {
// TODO Auto-generated method stub
return null;
}
@Override
public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList, Account owner, String hostName,
String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, String> requestedIps, String defaultIp,
String keyboard) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException {
// TODO Auto-generated method stub
return null;
}
}