You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ke...@apache.org on 2012/06/26 17:20:25 UTC

[4/58] git commit: fixing a bunch of line endings in the test directory

fixing a bunch of line endings in the test directory


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/dcceb9d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/dcceb9d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/dcceb9d5

Branch: refs/heads/master
Commit: dcceb9d59b7fc711ef15173b6b766a539e9f7f7a
Parents: e984c3c0
Author: David Nalley <da...@gnsa.us>
Authored: Tue Jun 26 11:19:19 2012 -0400
Committer: David Nalley <da...@gnsa.us>
Committed: Tue Jun 26 11:19:19 2012 -0400

----------------------------------------------------------------------
 test/scripts/checkOutOfMemory.sh                   |   30 +-
 .../src/com/cloud/sample/UserCloudAPIExecutor.java |  338 +-
 .../com/cloud/test/longrun/BuildGuestNetwork.java  |  224 +-
 .../com/cloud/test/longrun/PerformanceWithAPI.java |  382 +-
 test/src/com/cloud/test/longrun/User.java          |  442 ++--
 .../src/com/cloud/test/longrun/VirtualMachine.java |  198 +-
 test/src/com/cloud/test/longrun/guestNetwork.java  |  182 +-
 .../cloud/test/regression/DelegatedAdminTest.java  |  232 +-
 test/src/com/cloud/test/regression/Deploy.java     |  188 +-
 .../com/cloud/test/regression/EventsApiTest.java   |  322 +-
 test/src/com/cloud/test/regression/HA.java         |  124 +-
 .../cloud/test/regression/LoadBalancingTest.java   |  258 +-
 .../cloud/test/regression/PortForwardingTest.java  |  244 +-
 test/src/com/cloud/test/regression/SanityTest.java |  136 +-
 test/src/com/cloud/test/regression/Test.java       |  140 +-
 test/src/com/cloud/test/regression/TestCase.java   |  134 +-
 test/src/com/cloud/test/regression/VMApiTest.java  |  136 +-
 .../cloud/test/stress/StressTestDirectAttach.java  | 3024 +++++++-------
 test/src/com/cloud/test/stress/WgetTest.java       |  290 +-
 test/src/com/cloud/test/ui/AddAndDeleteAISO.java   |  200 +-
 .../com/cloud/test/ui/AddAndDeleteATemplate.java   |  196 +-
 test/src/com/cloud/test/utils/ConsoleProxy.java    |  192 +-
 test/src/com/cloud/test/utils/IpSqlGenerator.java  |  144 +-
 test/src/com/cloud/test/utils/ProxyLoadTemp.java   |  210 +-
 test/src/com/cloud/test/utils/SignRequest.java     |  172 +-
 .../src/com/cloud/test/utils/SqlDataGenerator.java |   64 +-
 test/src/com/cloud/test/utils/TestClient.java      |  730 ++--
 test/src/com/cloud/test/utils/UtilsForTest.java    |  392 +-
 28 files changed, 4662 insertions(+), 4662 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/dcceb9d5/test/scripts/checkOutOfMemory.sh
----------------------------------------------------------------------
diff --git a/test/scripts/checkOutOfMemory.sh b/test/scripts/checkOutOfMemory.sh
index 9baf0df..a3c0492 100755
--- a/test/scripts/checkOutOfMemory.sh
+++ b/test/scripts/checkOutOfMemory.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash
 # Copyright 2012 Citrix Systems, Inc. Licensed under the
 # Apache License, Version 2.0 (the "License"); you may not use this
 # file except in compliance with the License.  Citrix Systems, Inc.
@@ -16,18 +16,18 @@
 
  
 
-
-while true
-do
-sleep 600
-pid=`ps -ef | grep 'management.jmxremote' | grep -v 'cloud-management' | grep -v grep | awk '{print \$2}'`
-if grep -q java.lang.OutOfMemoryError /var/log/vmops/vmops.log
-then
-while true
-do
-t=$(date  +"%h%d_%H_%M_%S")
-jmap -dump:format=b,file=/root/dump/heap.bin.$t $pid
-sleep 1800
-done
-fi
+
+while true
+do
+sleep 600
+pid=`ps -ef | grep 'management.jmxremote' | grep -v 'cloud-management' | grep -v grep | awk '{print \$2}'`
+if grep -q java.lang.OutOfMemoryError /var/log/vmops/vmops.log
+then
+while true
+do
+t=$(date  +"%h%d_%H_%M_%S")
+jmap -dump:format=b,file=/root/dump/heap.bin.$t $pid
+sleep 1800
+done
+fi
 done
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/dcceb9d5/test/src/com/cloud/sample/UserCloudAPIExecutor.java
----------------------------------------------------------------------
diff --git a/test/src/com/cloud/sample/UserCloudAPIExecutor.java b/test/src/com/cloud/sample/UserCloudAPIExecutor.java
index d558ac2..7a28808 100644
--- a/test/src/com/cloud/sample/UserCloudAPIExecutor.java
+++ b/test/src/com/cloud/sample/UserCloudAPIExecutor.java
@@ -10,176 +10,176 @@
 // limitations under the License.
 // 
 // Automatically generated by addcopyright.py at 04/03/2012
-package com.cloud.sample;
-
-import java.io.FileInputStream;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import javax.crypto.Mac;
-import javax.crypto.spec.SecretKeySpec;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.methods.GetMethod;
-
-import com.cloud.utils.encoding.Base64;
-
-/**
+package com.cloud.sample;
+
+import java.io.FileInputStream;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.methods.GetMethod;
+
+import com.cloud.utils.encoding.Base64;
+
+/**
 *
  *
  *
  *
- *
- * 
- * 
- * 
- * 
- */
-
-/**
- * Sample CloudStack Management User API Executor.
- * 
- * Prerequisites: - Edit usercloud.properties to include your host, apiUrl, apiKey, and secretKey - Use ./executeUserAPI.sh to
- * execute this test class
- * 
- * @author will
- * 
- */
-public class UserCloudAPIExecutor {
-    public static void main(String[] args) {
-        // Host
-        String host = null;
-
-        // Fully qualified URL with http(s)://host:port
-        String apiUrl = null;
-
-        // ApiKey and secretKey as given by your CloudStack vendor
-        String apiKey = null;
-        String secretKey = null;
-
-        try {
-            Properties prop = new Properties();
-            prop.load(new FileInputStream("usercloud.properties"));
-
-            // host
-            host = prop.getProperty("host");
-            if (host == null) {
-                System.out.println("Please specify a valid host in the format of http(s)://:/client/api in your usercloud.properties file.");
-            }
-
-            // apiUrl
-            apiUrl = prop.getProperty("apiUrl");
-            if (apiUrl == null) {
-                System.out.println("Please specify a valid API URL in the format of command=&param1=&param2=... in your usercloud.properties file.");
-            }
-
-            // apiKey
-            apiKey = prop.getProperty("apiKey");
-            if (apiKey == null) {
-                System.out.println("Please specify your API Key as provided by your CloudStack vendor in your usercloud.properties file.");
-            }
-
-            // secretKey
-            secretKey = prop.getProperty("secretKey");
-            if (secretKey == null) {
-                System.out.println("Please specify your secret Key as provided by your CloudStack vendor in your usercloud.properties file.");
-            }
-
-            if (apiUrl == null || apiKey == null || secretKey == null) {
-                return;
-            }
-
-            System.out.println("Constructing API call to host = '" + host + "' with API command = '" + apiUrl + "' using apiKey = '" + apiKey + "' and secretKey = '" + secretKey + "'");
-
-            // Step 1: Make sure your APIKey is URL encoded
-            String encodedApiKey = URLEncoder.encode(apiKey, "UTF-8");
-
-            // Step 2: URL encode each parameter value, then sort the parameters and apiKey in
-            // alphabetical order, and then toLowerCase all the parameters, parameter values and apiKey.
-            // Please note that if any parameters with a '&' as a value will cause this test client to fail since we are using
-            // '&' to delimit
-            // the string
-            List<String> sortedParams = new ArrayList<String>();
-            sortedParams.add("apikey=" + encodedApiKey.toLowerCase());
-            StringTokenizer st = new StringTokenizer(apiUrl, "&");
-            String url = null;
-            boolean first = true;
-            while (st.hasMoreTokens()) {
-                String paramValue = st.nextToken();
-                String param = paramValue.substring(0, paramValue.indexOf("="));
-                String value = URLEncoder.encode(paramValue.substring(paramValue.indexOf("=") + 1, paramValue.length()), "UTF-8");
-                if (first) {
-                    url = param + "=" + value;
-                    first = false;
-                } else {
-                    url = url + "&" + param + "=" + value;
-                }
-                sortedParams.add(param.toLowerCase() + "=" + value.toLowerCase());
-            }
-            Collections.sort(sortedParams);
-
-            System.out.println("Sorted Parameters: " + sortedParams);
-
-            // Step 3: Construct the sorted URL and sign and URL encode the sorted URL with your secret key
-            String sortedUrl = null;
-            first = true;
-            for (String param : sortedParams) {
-                if (first) {
-                    sortedUrl = param;
-                    first = false;
-                } else {
-                    sortedUrl = sortedUrl + "&" + param;
-                }
-            }
-            System.out.println("sorted URL : " + sortedUrl);
-            String encodedSignature = signRequest(sortedUrl, secretKey);
-
-            // Step 4: Construct the final URL we want to send to the CloudStack Management Server
-            // Final result should look like:
-            // http(s)://://client/api?&apiKey=&signature=
-            String finalUrl = host + "?" + url + "&apiKey=" + apiKey + "&signature=" + encodedSignature;
-            System.out.println("final URL : " + finalUrl);
-
-            // Step 5: Perform a HTTP GET on this URL to execute the command
-            HttpClient client = new HttpClient();
-            HttpMethod method = new GetMethod(finalUrl);
-            int responseCode = client.executeMethod(method);
-            if (responseCode == 200) {
-                // SUCCESS!
-                System.out.println("Successfully executed command");
-            } else {
-                // FAILED!
-                System.out.println("Unable to execute command with response code: " + responseCode);
-            }
-
-        } catch (Throwable t) {
-            System.out.println(t);
-        }
-    }
-
-    /**
-     * 1. Signs a string with a secret key using SHA-1 2. Base64 encode the result 3. URL encode the final result
-     * 
-     * @param request
-     * @param key
-     * @return
-     */
-    public static String signRequest(String request, String key) {
-        try {
-            Mac mac = Mac.getInstance("HmacSHA1");
-            SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "HmacSHA1");
-            mac.init(keySpec);
-            mac.update(request.getBytes());
-            byte[] encryptedBytes = mac.doFinal();
-            return URLEncoder.encode(Base64.encodeBytes(encryptedBytes), "UTF-8");
-        } catch (Exception ex) {
-            System.out.println(ex);
-        }
-        return null;
-    }
-}
+ *
+ * 
+ * 
+ * 
+ * 
+ */
+
+/**
+ * Sample CloudStack Management User API Executor.
+ * 
+ * Prerequisites: - Edit usercloud.properties to include your host, apiUrl, apiKey, and secretKey - Use ./executeUserAPI.sh to
+ * execute this test class
+ * 
+ * @author will
+ * 
+ */
+public class UserCloudAPIExecutor {
+    public static void main(String[] args) {
+        // Host
+        String host = null;
+
+        // Fully qualified URL with http(s)://host:port
+        String apiUrl = null;
+
+        // ApiKey and secretKey as given by your CloudStack vendor
+        String apiKey = null;
+        String secretKey = null;
+
+        try {
+            Properties prop = new Properties();
+            prop.load(new FileInputStream("usercloud.properties"));
+
+            // host
+            host = prop.getProperty("host");
+            if (host == null) {
+                System.out.println("Please specify a valid host in the format of http(s)://:/client/api in your usercloud.properties file.");
+            }
+
+            // apiUrl
+            apiUrl = prop.getProperty("apiUrl");
+            if (apiUrl == null) {
+                System.out.println("Please specify a valid API URL in the format of command=&param1=&param2=... in your usercloud.properties file.");
+            }
+
+            // apiKey
+            apiKey = prop.getProperty("apiKey");
+            if (apiKey == null) {
+                System.out.println("Please specify your API Key as provided by your CloudStack vendor in your usercloud.properties file.");
+            }
+
+            // secretKey
+            secretKey = prop.getProperty("secretKey");
+            if (secretKey == null) {
+                System.out.println("Please specify your secret Key as provided by your CloudStack vendor in your usercloud.properties file.");
+            }
+
+            if (apiUrl == null || apiKey == null || secretKey == null) {
+                return;
+            }
+
+            System.out.println("Constructing API call to host = '" + host + "' with API command = '" + apiUrl + "' using apiKey = '" + apiKey + "' and secretKey = '" + secretKey + "'");
+
+            // Step 1: Make sure your APIKey is URL encoded
+            String encodedApiKey = URLEncoder.encode(apiKey, "UTF-8");
+
+            // Step 2: URL encode each parameter value, then sort the parameters and apiKey in
+            // alphabetical order, and then toLowerCase all the parameters, parameter values and apiKey.
+            // Please note that if any parameters with a '&' as a value will cause this test client to fail since we are using
+            // '&' to delimit
+            // the string
+            List<String> sortedParams = new ArrayList<String>();
+            sortedParams.add("apikey=" + encodedApiKey.toLowerCase());
+            StringTokenizer st = new StringTokenizer(apiUrl, "&");
+            String url = null;
+            boolean first = true;
+            while (st.hasMoreTokens()) {
+                String paramValue = st.nextToken();
+                String param = paramValue.substring(0, paramValue.indexOf("="));
+                String value = URLEncoder.encode(paramValue.substring(paramValue.indexOf("=") + 1, paramValue.length()), "UTF-8");
+                if (first) {
+                    url = param + "=" + value;
+                    first = false;
+                } else {
+                    url = url + "&" + param + "=" + value;
+                }
+                sortedParams.add(param.toLowerCase() + "=" + value.toLowerCase());
+            }
+            Collections.sort(sortedParams);
+
+            System.out.println("Sorted Parameters: " + sortedParams);
+
+            // Step 3: Construct the sorted URL and sign and URL encode the sorted URL with your secret key
+            String sortedUrl = null;
+            first = true;
+            for (String param : sortedParams) {
+                if (first) {
+                    sortedUrl = param;
+                    first = false;
+                } else {
+                    sortedUrl = sortedUrl + "&" + param;
+                }
+            }
+            System.out.println("sorted URL : " + sortedUrl);
+            String encodedSignature = signRequest(sortedUrl, secretKey);
+
+            // Step 4: Construct the final URL we want to send to the CloudStack Management Server
+            // Final result should look like:
+            // http(s)://://client/api?&apiKey=&signature=
+            String finalUrl = host + "?" + url + "&apiKey=" + apiKey + "&signature=" + encodedSignature;
+            System.out.println("final URL : " + finalUrl);
+
+            // Step 5: Perform a HTTP GET on this URL to execute the command
+            HttpClient client = new HttpClient();
+            HttpMethod method = new GetMethod(finalUrl);
+            int responseCode = client.executeMethod(method);
+            if (responseCode == 200) {
+                // SUCCESS!
+                System.out.println("Successfully executed command");
+            } else {
+                // FAILED!
+                System.out.println("Unable to execute command with response code: " + responseCode);
+            }
+
+        } catch (Throwable t) {
+            System.out.println(t);
+        }
+    }
+
+    /**
+     * 1. Signs a string with a secret key using SHA-1 2. Base64 encode the result 3. URL encode the final result
+     * 
+     * @param request
+     * @param key
+     * @return
+     */
+    public static String signRequest(String request, String key) {
+        try {
+            Mac mac = Mac.getInstance("HmacSHA1");
+            SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "HmacSHA1");
+            mac.init(keySpec);
+            mac.update(request.getBytes());
+            byte[] encryptedBytes = mac.doFinal();
+            return URLEncoder.encode(Base64.encodeBytes(encryptedBytes), "UTF-8");
+        } catch (Exception ex) {
+            System.out.println(ex);
+        }
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/dcceb9d5/test/src/com/cloud/test/longrun/BuildGuestNetwork.java
----------------------------------------------------------------------
diff --git a/test/src/com/cloud/test/longrun/BuildGuestNetwork.java b/test/src/com/cloud/test/longrun/BuildGuestNetwork.java
index bdd56a2..236c9ea 100644
--- a/test/src/com/cloud/test/longrun/BuildGuestNetwork.java
+++ b/test/src/com/cloud/test/longrun/BuildGuestNetwork.java
@@ -10,115 +10,115 @@
 // limitations under the License.
 // 
 // Automatically generated by addcopyright.py at 04/03/2012
-package com.cloud.test.longrun;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Random;
-
-
-import org.apache.log4j.Logger;
-
-
-public class BuildGuestNetwork {
-
-	public static final Logger s_logger= Logger.getLogger(BuildGuestNetwork.class.getClass());
-	private static final int _apiPort=8096;
-	private static final int _developerPort=8080;
-	private static final String _apiUrl = "/client/api";
-	private static int numVM=1;
-	private static long zoneId=-1L; 
-	private static long templateId=3;
-	private static long serviceOfferingId=1;
-	
-
-
-		public static void main (String[] args){
-			
-			List<String> argsList = Arrays.asList(args);
-			Iterator<String> iter = argsList.iterator();
-			String host = "http://localhost";
-			int numThreads = 1;
-			
-			while (iter.hasNext()){
-				String arg = iter.next();
-				if (arg.equals("-h")){
-					host="http://"+iter.next();
-				}
-				if (arg.equals("-t")){
-					numThreads=Integer.parseInt(iter.next());
-				}	
-				if (arg.equals("-n")){
-					numVM=Integer.parseInt(iter.next());
-				}
-				if (arg.equals("-z")){
-					zoneId=Integer.parseInt(iter.next());
-				}
-				
-				if (arg.equals("-e")){
-					templateId=Integer.parseInt(iter.next());
-				}
-				
-				if (arg.equals("-s")){
-					serviceOfferingId=Integer.parseInt(iter.next());
-				}
-			}
-			
-			final String server = host + ":" + _apiPort + "/";
-			final String developerServer = host + ":" + _developerPort + _apiUrl;
-			s_logger.info("Starting test in "+numThreads+" thread(s). Each thread is launching "+numVM+" VMs");
-			
-			for (int i=0; i<numThreads; i++){
-				new Thread(new Runnable() {
-					public  void run() {
-						try{
-
-						String username = null;
-						String singlePrivateIp=null;
-						Random ran = new Random();
-						username = Math.abs(ran.nextInt())+ "-user";
-						
-						//Create User
-						User myUser = new User(username,username, server, developerServer);
-						try{
-							myUser.launchUser();
-							myUser.registerUser();
-						}catch (Exception e){
-							s_logger.warn("Error code: ", e);
-						}
-						
-						if (myUser.getUserId()!=null){
-							s_logger.info("User "+myUser.getUserName()+" was created successfully, starting VM creation");
-							//create VMs for the user
-							for (int i=0; i<numVM; i++){
-								//Create a new VM, add it to the list of user's VMs
-								VirtualMachine myVM = new VirtualMachine(myUser.getUserId());
-								myVM.deployVM(zoneId, serviceOfferingId, templateId, myUser.getDeveloperServer(), myUser.getApiKey(), myUser.getSecretKey());
-								myUser.getVirtualMachines().add(myVM);
-								singlePrivateIp=myVM.getPrivateIp();
-								
-								if (singlePrivateIp!=null){
-									s_logger.info("VM with private Ip "+singlePrivateIp+" was successfully created");
-								}
-								else{
-									s_logger.info("Problems with VM creation for a user"+myUser.getUserName());
-									s_logger.info("Deployment failed");
-									break;
-								}			
-							}
-							
-							s_logger.info("Deployment done..."+numVM+" VMs were created.");
-						}
-
-						}catch (Exception e){
-							s_logger.error(e);
-						}
-					}
-				}).start();
-		
-			}
-		}
-	
-	
-}
+package com.cloud.test.longrun;
+
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Random;
+
+
+import org.apache.log4j.Logger;
+
+
+public class BuildGuestNetwork {
+
+	public static final Logger s_logger= Logger.getLogger(BuildGuestNetwork.class.getClass());
+	private static final int _apiPort=8096;
+	private static final int _developerPort=8080;
+	private static final String _apiUrl = "/client/api";
+	private static int numVM=1;
+	private static long zoneId=-1L; 
+	private static long templateId=3;
+	private static long serviceOfferingId=1;
+	
+
+
+		public static void main (String[] args){
+			
+			List<String> argsList = Arrays.asList(args);
+			Iterator<String> iter = argsList.iterator();
+			String host = "http://localhost";
+			int numThreads = 1;
+			
+			while (iter.hasNext()){
+				String arg = iter.next();
+				if (arg.equals("-h")){
+					host="http://"+iter.next();
+				}
+				if (arg.equals("-t")){
+					numThreads=Integer.parseInt(iter.next());
+				}	
+				if (arg.equals("-n")){
+					numVM=Integer.parseInt(iter.next());
+				}
+				if (arg.equals("-z")){
+					zoneId=Integer.parseInt(iter.next());
+				}
+				
+				if (arg.equals("-e")){
+					templateId=Integer.parseInt(iter.next());
+				}
+				
+				if (arg.equals("-s")){
+					serviceOfferingId=Integer.parseInt(iter.next());
+				}
+			}
+			
+			final String server = host + ":" + _apiPort + "/";
+			final String developerServer = host + ":" + _developerPort + _apiUrl;
+			s_logger.info("Starting test in "+numThreads+" thread(s). Each thread is launching "+numVM+" VMs");
+			
+			for (int i=0; i<numThreads; i++){
+				new Thread(new Runnable() {
+					public  void run() {
+						try{
+
+						String username = null;
+						String singlePrivateIp=null;
+						Random ran = new Random();
+						username = Math.abs(ran.nextInt())+ "-user";
+						
+						//Create User
+						User myUser = new User(username,username, server, developerServer);
+						try{
+							myUser.launchUser();
+							myUser.registerUser();
+						}catch (Exception e){
+							s_logger.warn("Error code: ", e);
+						}
+						
+						if (myUser.getUserId()!=null){
+							s_logger.info("User "+myUser.getUserName()+" was created successfully, starting VM creation");
+							//create VMs for the user
+							for (int i=0; i<numVM; i++){
+								//Create a new VM, add it to the list of user's VMs
+								VirtualMachine myVM = new VirtualMachine(myUser.getUserId());
+								myVM.deployVM(zoneId, serviceOfferingId, templateId, myUser.getDeveloperServer(), myUser.getApiKey(), myUser.getSecretKey());
+								myUser.getVirtualMachines().add(myVM);
+								singlePrivateIp=myVM.getPrivateIp();
+								
+								if (singlePrivateIp!=null){
+									s_logger.info("VM with private Ip "+singlePrivateIp+" was successfully created");
+								}
+								else{
+									s_logger.info("Problems with VM creation for a user"+myUser.getUserName());
+									s_logger.info("Deployment failed");
+									break;
+								}			
+							}
+							
+							s_logger.info("Deployment done..."+numVM+" VMs were created.");
+						}
+
+						}catch (Exception e){
+							s_logger.error(e);
+						}
+					}
+				}).start();
+		
+			}
+		}
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/dcceb9d5/test/src/com/cloud/test/longrun/PerformanceWithAPI.java
----------------------------------------------------------------------
diff --git a/test/src/com/cloud/test/longrun/PerformanceWithAPI.java b/test/src/com/cloud/test/longrun/PerformanceWithAPI.java
index b68641f..0e67d26 100644
--- a/test/src/com/cloud/test/longrun/PerformanceWithAPI.java
+++ b/test/src/com/cloud/test/longrun/PerformanceWithAPI.java
@@ -10,196 +10,196 @@
 // limitations under the License.
 // 
 // Automatically generated by addcopyright.py at 04/03/2012
-package com.cloud.test.longrun;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URLEncoder;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Random;
-
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.log4j.Logger;
-
+package com.cloud.test.longrun;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URLEncoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Random;
+
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.log4j.Logger;
+
 import com.cloud.test.stress.TestClientWithAPI;
-
-
-
-public class PerformanceWithAPI {
-	
-public static final Logger s_logger= Logger.getLogger(PerformanceWithAPI.class.getClass());
-private static final int _retry=10;
-private static final int _apiPort=8096;
-private static int numVM=2;
-private static final long _zoneId=-1L;
-private static final long _templateId=3;
-private static final long _serviceOfferingId=1;
-private static final String _apiUrl = "/client/api";
-private static final int _developerPort=8080;
-
-
-
-	public static void main (String[] args){
-		
-		List<String> argsList = Arrays.asList(args);
-		Iterator<String> iter = argsList.iterator();
-		String host = "http://localhost";
-		int numThreads = 1;
-		
-		while (iter.hasNext()){
-			String arg = iter.next();
-			if (arg.equals("-h")){
-				host="http://"+iter.next();
-			}
-			if (arg.equals("-t")){
-				numThreads=Integer.parseInt(iter.next());
-			}	
-			if (arg.equals("-n")){
-				numVM=Integer.parseInt(iter.next());
-			}
-		}
-		
-		final String server = host + ":" + _apiPort + "/";
-		final String developerServer = host + ":" + _developerPort + _apiUrl;
-		
-		s_logger.info("Starting test in "+numThreads+" thread(s). Each thread is launching "+numVM+" VMs");
-		
-		for (int i=0; i<numThreads; i++){
-			new Thread(new Runnable() {
-				public  void run() {
-					try{
-
-					String username = null;
-					String singlePrivateIp=null;
-					String singlePublicIp=null;
-					Random ran = new Random();
-					username = Math.abs(ran.nextInt())+ "-user";
-					
-					//Create User
-					User myUser = new User(username,username, server, developerServer);
-					try{
-						myUser.launchUser();
-						myUser.registerUser();
-					}catch (Exception e){
-						s_logger.warn("Error code: ", e);
-					}
-					
-					if (myUser.getUserId()!=null){
-						s_logger.info("User "+myUser.getUserName()+" was created successfully, starting VM creation");
-						//create VMs for the user
-						for (int i=0; i<numVM; i++){
-							//Create a new VM, add it to the list of user's VMs
-							VirtualMachine myVM = new VirtualMachine(myUser.getUserId());
-							myVM.deployVM(_zoneId, _serviceOfferingId, _templateId, myUser.getDeveloperServer(), myUser.getApiKey(), myUser.getSecretKey());
-							myUser.getVirtualMachines().add(myVM);
-							singlePrivateIp=myVM.getPrivateIp();
-							
-							if (singlePrivateIp!=null){
-								s_logger.info("VM with private Ip "+singlePrivateIp+" was successfully created");
-							}
-							else{
-								s_logger.info("Problems with VM creation for a user"+myUser.getUserName());
-								break;
-							}
-							
-							
-						//get public IP address for the User				
-							myUser.retrievePublicIp(_zoneId);
-							singlePublicIp=myUser.getPublicIp().get(myUser.getPublicIp().size()-1);
-							if (singlePublicIp!=null){
-								s_logger.info("Successfully got public Ip "+singlePublicIp+" for user "+myUser.getUserName());
-							}
-							else{
-								s_logger.info("Problems with getting public Ip address for user"+myUser.getUserName());
-								break;
-							}
-							
-							
-						//create ForwardProxy rules for user's VMs
-							int responseCode = CreateForwardingRule(myUser, singlePrivateIp, singlePublicIp, "22", "22");
-							if (responseCode==500)
-								break;
-						}
-						
-						s_logger.info("Deployment successful..."+numVM+" VMs were created. Waiting for 5 min before performance test");
-						Thread.sleep(300000L); // Wait 
-						
-						
-						//Start performance test for the user
-						s_logger.info("Starting performance test for Guest network that has "+myUser.getPublicIp().size()+" public IP addresses");		
-						for (int j=0; j<myUser.getPublicIp().size(); j++){
-							s_logger.info("Starting test for user which has "+myUser.getVirtualMachines().size()+" vms. Public IP for the user is "+myUser.getPublicIp().get(j)+" , number of retries is "+_retry+" , private IP address of the machine is"+myUser.getVirtualMachines().get(j).getPrivateIp());
-							guestNetwork myNetwork =new guestNetwork(myUser.getPublicIp().get(j), _retry);
-							myNetwork.setVirtualMachines(myUser.getVirtualMachines());
-							new Thread(myNetwork).start();
-						}
-						
-					}
-					}catch (Exception e){
-						s_logger.error(e);
-					}
-				}
-			}).start();
-	
-		}
-	}
-
-	private static int CreateForwardingRule(User myUser, String privateIp, String publicIp, String publicPort, String privatePort) throws IOException{
-		String encodedPrivateIp=URLEncoder.encode(""+privateIp, "UTF-8");
-		String encodedPublicIp=URLEncoder.encode(""+publicIp, "UTF-8");
-		String encodedPrivatePort=URLEncoder.encode(""+privatePort, "UTF-8");
-		String encodedPublicPort=URLEncoder.encode(""+publicPort, "UTF-8");
-		String encodedApiKey = URLEncoder.encode(myUser.getApiKey(), "UTF-8");
-		int responseCode=500;
-		
-		
-		String requestToSign = "apiKey=" + encodedApiKey
-		+ "&command=createOrUpdateIpForwardingRule&privateIp="
-		+ encodedPrivateIp + "&privatePort=" + encodedPrivatePort
-		+ "&protocol=tcp&publicIp="
-		+ encodedPublicIp + "&publicPort="+encodedPublicPort;
-		
-		requestToSign = requestToSign.toLowerCase();
-		s_logger.info("Request to sign is "+requestToSign);
-		
-		String signature = TestClientWithAPI.signRequest(requestToSign, myUser.getSecretKey());
-		String encodedSignature = URLEncoder.encode(signature, "UTF-8");
-
-		String url = myUser.getDeveloperServer() + "?command=createOrUpdateIpForwardingRule"
-		+ "&publicIp=" + encodedPublicIp
-		+ "&publicPort="+encodedPublicPort+"&privateIp=" + encodedPrivateIp
-		+ "&privatePort=" + encodedPrivatePort + "&protocol=tcp&apiKey=" + encodedApiKey
-		+ "&signature=" + encodedSignature;
-		
-		s_logger.info("Trying to create IP forwarding rule: "+url);
-		HttpClient client = new HttpClient();
-		HttpMethod method = new GetMethod(url);
-		responseCode = client.executeMethod(method);
-		s_logger.info("create ip forwarding rule response code: "
-				+ responseCode);
-		if (responseCode == 200) {
-			s_logger.info("The rule is created successfully");
-		} else if (responseCode == 500) {
-			InputStream is = method.getResponseBodyAsStream();
-			Map<String, String> errorInfo = TestClientWithAPI.getSingleValueFromXML(is,
-					new String[] { "errorCode", "description" });
-			s_logger
-					.error("create ip forwarding rule (linux) test failed with errorCode: "
-							+ errorInfo.get("errorCode")
-							+ " and description: "
-							+ errorInfo.get("description"));
-		} else {
-			s_logger.error("internal error processing request: "
-					+ method.getStatusText());
-		}
-		return responseCode;
-	}
-	
-
+
+
+
+public class PerformanceWithAPI {
+	
+public static final Logger s_logger= Logger.getLogger(PerformanceWithAPI.class.getClass());
+private static final int _retry=10;
+private static final int _apiPort=8096;
+private static int numVM=2;
+private static final long _zoneId=-1L;
+private static final long _templateId=3;
+private static final long _serviceOfferingId=1;
+private static final String _apiUrl = "/client/api";
+private static final int _developerPort=8080;
+
+
+
+	public static void main (String[] args){
+		
+		List<String> argsList = Arrays.asList(args);
+		Iterator<String> iter = argsList.iterator();
+		String host = "http://localhost";
+		int numThreads = 1;
+		
+		while (iter.hasNext()){
+			String arg = iter.next();
+			if (arg.equals("-h")){
+				host="http://"+iter.next();
+			}
+			if (arg.equals("-t")){
+				numThreads=Integer.parseInt(iter.next());
+			}	
+			if (arg.equals("-n")){
+				numVM=Integer.parseInt(iter.next());
+			}
+		}
+		
+		final String server = host + ":" + _apiPort + "/";
+		final String developerServer = host + ":" + _developerPort + _apiUrl;
+		
+		s_logger.info("Starting test in "+numThreads+" thread(s). Each thread is launching "+numVM+" VMs");
+		
+		for (int i=0; i<numThreads; i++){
+			new Thread(new Runnable() {
+				public  void run() {
+					try{
+
+					String username = null;
+					String singlePrivateIp=null;
+					String singlePublicIp=null;
+					Random ran = new Random();
+					username = Math.abs(ran.nextInt())+ "-user";
+					
+					//Create User
+					User myUser = new User(username,username, server, developerServer);
+					try{
+						myUser.launchUser();
+						myUser.registerUser();
+					}catch (Exception e){
+						s_logger.warn("Error code: ", e);
+					}
+					
+					if (myUser.getUserId()!=null){
+						s_logger.info("User "+myUser.getUserName()+" was created successfully, starting VM creation");
+						//create VMs for the user
+						for (int i=0; i<numVM; i++){
+							//Create a new VM, add it to the list of user's VMs
+							VirtualMachine myVM = new VirtualMachine(myUser.getUserId());
+							myVM.deployVM(_zoneId, _serviceOfferingId, _templateId, myUser.getDeveloperServer(), myUser.getApiKey(), myUser.getSecretKey());
+							myUser.getVirtualMachines().add(myVM);
+							singlePrivateIp=myVM.getPrivateIp();
+							
+							if (singlePrivateIp!=null){
+								s_logger.info("VM with private Ip "+singlePrivateIp+" was successfully created");
+							}
+							else{
+								s_logger.info("Problems with VM creation for a user"+myUser.getUserName());
+								break;
+							}
+							
+							
+						//get public IP address for the User				
+							myUser.retrievePublicIp(_zoneId);
+							singlePublicIp=myUser.getPublicIp().get(myUser.getPublicIp().size()-1);
+							if (singlePublicIp!=null){
+								s_logger.info("Successfully got public Ip "+singlePublicIp+" for user "+myUser.getUserName());
+							}
+							else{
+								s_logger.info("Problems with getting public Ip address for user"+myUser.getUserName());
+								break;
+							}
+							
+							
+						//create ForwardProxy rules for user's VMs
+							int responseCode = CreateForwardingRule(myUser, singlePrivateIp, singlePublicIp, "22", "22");
+							if (responseCode==500)
+								break;
+						}
+						
+						s_logger.info("Deployment successful..."+numVM+" VMs were created. Waiting for 5 min before performance test");
+						Thread.sleep(300000L); // Wait 
+						
+						
+						//Start performance test for the user
+						s_logger.info("Starting performance test for Guest network that has "+myUser.getPublicIp().size()+" public IP addresses");		
+						for (int j=0; j<myUser.getPublicIp().size(); j++){
+							s_logger.info("Starting test for user which has "+myUser.getVirtualMachines().size()+" vms. Public IP for the user is "+myUser.getPublicIp().get(j)+" , number of retries is "+_retry+" , private IP address of the machine is"+myUser.getVirtualMachines().get(j).getPrivateIp());
+							guestNetwork myNetwork =new guestNetwork(myUser.getPublicIp().get(j), _retry);
+							myNetwork.setVirtualMachines(myUser.getVirtualMachines());
+							new Thread(myNetwork).start();
+						}
+						
+					}
+					}catch (Exception e){
+						s_logger.error(e);
+					}
+				}
+			}).start();
+	
+		}
+	}
+
+	private static int CreateForwardingRule(User myUser, String privateIp, String publicIp, String publicPort, String privatePort) throws IOException{
+		String encodedPrivateIp=URLEncoder.encode(""+privateIp, "UTF-8");
+		String encodedPublicIp=URLEncoder.encode(""+publicIp, "UTF-8");
+		String encodedPrivatePort=URLEncoder.encode(""+privatePort, "UTF-8");
+		String encodedPublicPort=URLEncoder.encode(""+publicPort, "UTF-8");
+		String encodedApiKey = URLEncoder.encode(myUser.getApiKey(), "UTF-8");
+		int responseCode=500;
+		
+		
+		String requestToSign = "apiKey=" + encodedApiKey
+		+ "&command=createOrUpdateIpForwardingRule&privateIp="
+		+ encodedPrivateIp + "&privatePort=" + encodedPrivatePort
+		+ "&protocol=tcp&publicIp="
+		+ encodedPublicIp + "&publicPort="+encodedPublicPort;
+		
+		requestToSign = requestToSign.toLowerCase();
+		s_logger.info("Request to sign is "+requestToSign);
+		
+		String signature = TestClientWithAPI.signRequest(requestToSign, myUser.getSecretKey());
+		String encodedSignature = URLEncoder.encode(signature, "UTF-8");
+
+		String url = myUser.getDeveloperServer() + "?command=createOrUpdateIpForwardingRule"
+		+ "&publicIp=" + encodedPublicIp
+		+ "&publicPort="+encodedPublicPort+"&privateIp=" + encodedPrivateIp
+		+ "&privatePort=" + encodedPrivatePort + "&protocol=tcp&apiKey=" + encodedApiKey
+		+ "&signature=" + encodedSignature;
+		
+		s_logger.info("Trying to create IP forwarding rule: "+url);
+		HttpClient client = new HttpClient();
+		HttpMethod method = new GetMethod(url);
+		responseCode = client.executeMethod(method);
+		s_logger.info("create ip forwarding rule response code: "
+				+ responseCode);
+		if (responseCode == 200) {
+			s_logger.info("The rule is created successfully");
+		} else if (responseCode == 500) {
+			InputStream is = method.getResponseBodyAsStream();
+			Map<String, String> errorInfo = TestClientWithAPI.getSingleValueFromXML(is,
+					new String[] { "errorCode", "description" });
+			s_logger
+					.error("create ip forwarding rule (linux) test failed with errorCode: "
+							+ errorInfo.get("errorCode")
+							+ " and description: "
+							+ errorInfo.get("description"));
+		} else {
+			s_logger.error("internal error processing request: "
+					+ method.getStatusText());
+		}
+		return responseCode;
+	}
+	
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/dcceb9d5/test/src/com/cloud/test/longrun/User.java
----------------------------------------------------------------------
diff --git a/test/src/com/cloud/test/longrun/User.java b/test/src/com/cloud/test/longrun/User.java
index 8ada429..7ff4674 100644
--- a/test/src/com/cloud/test/longrun/User.java
+++ b/test/src/com/cloud/test/longrun/User.java
@@ -10,225 +10,225 @@
 // limitations under the License.
 // 
 // Automatically generated by addcopyright.py at 04/03/2012
-package com.cloud.test.longrun;
-import java.util.ArrayList;
-import java.util.Map;
-import java.io.InputStream;
-import java.io.IOException;
-import java.net.URLEncoder;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpException;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.log4j.Logger;
-
+package com.cloud.test.longrun;
+import java.util.ArrayList;
+import java.util.Map;
+import java.io.InputStream;
+import java.io.IOException;
+import java.net.URLEncoder;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.log4j.Logger;
+
 import com.cloud.test.stress.TestClientWithAPI;
-
-
-
-public class User {
-	public static final Logger s_logger= Logger.getLogger(User.class.getClass());
-	
-	private ArrayList<VirtualMachine> virtualMachines;
-	private ArrayList<String> publicIp;
-	private String server;
-	private String developerServer;
-	private String userName;
-	private String userId;
-	private String apiKey;
-	private String secretKey;
-	private String password;
-	private String encryptedPassword;
-	
-
-	public User(String userName, String password, String server, String developerServer)
-	{
-		this.server=server;
-		this.developerServer=developerServer;
-		this.userName=userName;
-		this.password=password;
-		this.virtualMachines = new ArrayList<VirtualMachine>();
-		this.publicIp = new ArrayList<String>();
-	}
-	
-	public ArrayList<VirtualMachine> getVirtualMachines() {
-		return virtualMachines;
-	}
-
-
-	public void setVirtualMachines(ArrayList<VirtualMachine> virtualMachines) {
-		this.virtualMachines = virtualMachines;
-	}
-
-
-	public String getUserId() {
-		return userId;
-	}
-
-
-	public void setUserId(String userId) {
-		this.userId = userId;
-	}
-	
-
-	public ArrayList<String> getPublicIp() {
-		return publicIp;
-	}
-
-
-	public void setPublicIp(ArrayList<String> publicIp) {
-		this.publicIp = publicIp;
-	}
-
-
-
-	public String getServer() {
-		return server;
-	}
-
-
-
-	public void setServer(String server) {
-		this.server = server;
-	}
-
-
-
-	public String getUserName() {
-		return userName;
-	}
-
-
-
-	public void setUserName(String userName) {
-		this.userName = userName;
-	}
-
-
-	public String getApiKey() {
-		return apiKey;
-	}
-
-	public void setApiKey(String apiKey) {
-		this.apiKey = apiKey;
-	}
-
-	public String getPassword() {
-		return password;
-	}
-
-	public void setPassword(String password) {
-		this.password = password;
-	}
-	
-	public String getSecretKey() {
-		return secretKey;
-	}
-
-	public void setSecretKey(String secretKey) {
-		this.secretKey = secretKey;
-	}
-	
-	
-
-	public String getDeveloperServer() {
-		return developerServer;
-	}
-
-	public void setDeveloperServer(String developerServer) {
-		this.developerServer = developerServer;
-	}
-
-	public void launchUser() throws IOException {
-		String encodedUsername = URLEncoder.encode(this.getUserName(), "UTF-8");
-		this.encryptedPassword=TestClientWithAPI.createMD5Password(this.getPassword());
-		String encodedPassword = URLEncoder.encode(this.encryptedPassword, "UTF-8");
-		String url = this.server + "?command=createUser&username=" + encodedUsername
-				+ "&password=" + encodedPassword
-				+ "&firstname=Test&lastname=Test&email=alena@vmops.com&domainId=1";
-		String userIdStr=null;
-		HttpClient client = new HttpClient();
-		HttpMethod method = new GetMethod(url);
-		int responseCode = client.executeMethod(method);
-
-		if (responseCode == 200) {
-			InputStream is = method.getResponseBodyAsStream();
-			Map<String, String> userIdValues = TestClientWithAPI.getSingleValueFromXML(is,
-					new String[] { "id" });
-			userIdStr = userIdValues.get("id");
-			if ((userIdStr != null) && (Long.parseLong(userIdStr)!=-1)) {
-				this.setUserId(userIdStr);
-			}
-		}
-	}
-	
-	public void retrievePublicIp(long zoneId) throws IOException{
-		
-		String encodedApiKey = URLEncoder.encode(this.apiKey, "UTF-8");
-		String encodedZoneId=URLEncoder.encode(""+zoneId,"UTF-8");
-		String requestToSign = "apiKey=" + encodedApiKey
-				+ "&command=associateIpAddress" + "&zoneId="+encodedZoneId;
-		requestToSign = requestToSign.toLowerCase();
-		String signature = TestClientWithAPI.signRequest(requestToSign, this.secretKey);
-		String encodedSignature = URLEncoder.encode(signature, "UTF-8");
-
-		String url = this.developerServer + "?command=associateIpAddress" + "&apiKey="
-				+ encodedApiKey + "&zoneId="+encodedZoneId+"&signature="
-				+ encodedSignature;
-
-		HttpClient client = new HttpClient();
-		HttpMethod method = new GetMethod(url);
-		int responseCode=client.executeMethod(method);
-		if (responseCode == 200) {
-			InputStream is = method.getResponseBodyAsStream();
-			Map<String, String> values = TestClientWithAPI.getSingleValueFromXML(is,
-					new String[] { "ipaddress" });
-			this.getPublicIp().add(values.get("ipaddress"));
-			s_logger.info("Ip address is " + values.get("ipaddress"));
-		} else if (responseCode == 500) {
-			InputStream is = method.getResponseBodyAsStream();
-			Map<String, String> errorInfo = TestClientWithAPI.getSingleValueFromXML(is,
-					new String[] { "errorcode", "description" });
-			s_logger.error("associate ip test failed with errorCode: "
-					+ errorInfo.get("errorCode") + " and description: "
-					+ errorInfo.get("description"));
-		} else {
-			s_logger.error("internal error processing request: "
-					+ method.getStatusText());
-		}
-		
-	}
-	
-		public void registerUser()throws HttpException, IOException{
-	 
-			String encodedUsername = URLEncoder.encode(this.userName, "UTF-8");
-			String encodedPassword = URLEncoder.encode(this.password, "UTF-8");
-			String url = server + "?command=register&username=" + encodedUsername
-					+ "&domainid=1";
-			s_logger.info("registering: " + this.userName+" with url "+url);
-			HttpClient client = new HttpClient();
-			HttpMethod method = new GetMethod(url);
-			int responseCode = client.executeMethod(method);
-			if (responseCode == 200) {
-				InputStream is = method.getResponseBodyAsStream();
-				Map<String, String> requestKeyValues = TestClientWithAPI.getSingleValueFromXML(is,
-						new String[] { "apikey", "secretkey" });
-				this.setApiKey(requestKeyValues.get("apikey"));
-				this.setSecretKey(requestKeyValues.get("secretkey"));
-			} else if (responseCode == 500) {
-				InputStream is = method.getResponseBodyAsStream();
-				Map<String, String> errorInfo = TestClientWithAPI.getSingleValueFromXML(is,
-						new String[] { "errorcode", "description" });
-				s_logger.error("registration failed with errorCode: "
-						+ errorInfo.get("errorCode") + " and description: "
-						+ errorInfo.get("description"));
-			} else {
-				s_logger.error("internal error processing request: "
-						+ method.getStatusText());
-			}
-		}
-		
-}
-
-
+
+
+
+public class User {
+	public static final Logger s_logger= Logger.getLogger(User.class.getClass());
+	
+	private ArrayList<VirtualMachine> virtualMachines;
+	private ArrayList<String> publicIp;
+	private String server;
+	private String developerServer;
+	private String userName;
+	private String userId;
+	private String apiKey;
+	private String secretKey;
+	private String password;
+	private String encryptedPassword;
+	
+
+	public User(String userName, String password, String server, String developerServer)
+	{
+		this.server=server;
+		this.developerServer=developerServer;
+		this.userName=userName;
+		this.password=password;
+		this.virtualMachines = new ArrayList<VirtualMachine>();
+		this.publicIp = new ArrayList<String>();
+	}
+	
+	public ArrayList<VirtualMachine> getVirtualMachines() {
+		return virtualMachines;
+	}
+
+
+	public void setVirtualMachines(ArrayList<VirtualMachine> virtualMachines) {
+		this.virtualMachines = virtualMachines;
+	}
+
+
+	public String getUserId() {
+		return userId;
+	}
+
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+	
+
+	public ArrayList<String> getPublicIp() {
+		return publicIp;
+	}
+
+
+	public void setPublicIp(ArrayList<String> publicIp) {
+		this.publicIp = publicIp;
+	}
+
+
+
+	public String getServer() {
+		return server;
+	}
+
+
+
+	public void setServer(String server) {
+		this.server = server;
+	}
+
+
+
+	public String getUserName() {
+		return userName;
+	}
+
+
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
+
+	public String getApiKey() {
+		return apiKey;
+	}
+
+	public void setApiKey(String apiKey) {
+		this.apiKey = apiKey;
+	}
+
+	public String getPassword() {
+		return password;
+	}
+
+	public void setPassword(String password) {
+		this.password = password;
+	}
+	
+	public String getSecretKey() {
+		return secretKey;
+	}
+
+	public void setSecretKey(String secretKey) {
+		this.secretKey = secretKey;
+	}
+	
+	
+
+	public String getDeveloperServer() {
+		return developerServer;
+	}
+
+	public void setDeveloperServer(String developerServer) {
+		this.developerServer = developerServer;
+	}
+
+	public void launchUser() throws IOException {
+		String encodedUsername = URLEncoder.encode(this.getUserName(), "UTF-8");
+		this.encryptedPassword=TestClientWithAPI.createMD5Password(this.getPassword());
+		String encodedPassword = URLEncoder.encode(this.encryptedPassword, "UTF-8");
+		String url = this.server + "?command=createUser&username=" + encodedUsername
+				+ "&password=" + encodedPassword
+				+ "&firstname=Test&lastname=Test&email=alena@vmops.com&domainId=1";
+		String userIdStr=null;
+		HttpClient client = new HttpClient();
+		HttpMethod method = new GetMethod(url);
+		int responseCode = client.executeMethod(method);
+
+		if (responseCode == 200) {
+			InputStream is = method.getResponseBodyAsStream();
+			Map<String, String> userIdValues = TestClientWithAPI.getSingleValueFromXML(is,
+					new String[] { "id" });
+			userIdStr = userIdValues.get("id");
+			if ((userIdStr != null) && (Long.parseLong(userIdStr)!=-1)) {
+				this.setUserId(userIdStr);
+			}
+		}
+	}
+	
+	public void retrievePublicIp(long zoneId) throws IOException{
+		
+		String encodedApiKey = URLEncoder.encode(this.apiKey, "UTF-8");
+		String encodedZoneId=URLEncoder.encode(""+zoneId,"UTF-8");
+		String requestToSign = "apiKey=" + encodedApiKey
+				+ "&command=associateIpAddress" + "&zoneId="+encodedZoneId;
+		requestToSign = requestToSign.toLowerCase();
+		String signature = TestClientWithAPI.signRequest(requestToSign, this.secretKey);
+		String encodedSignature = URLEncoder.encode(signature, "UTF-8");
+
+		String url = this.developerServer + "?command=associateIpAddress" + "&apiKey="
+				+ encodedApiKey + "&zoneId="+encodedZoneId+"&signature="
+				+ encodedSignature;
+
+		HttpClient client = new HttpClient();
+		HttpMethod method = new GetMethod(url);
+		int responseCode=client.executeMethod(method);
+		if (responseCode == 200) {
+			InputStream is = method.getResponseBodyAsStream();
+			Map<String, String> values = TestClientWithAPI.getSingleValueFromXML(is,
+					new String[] { "ipaddress" });
+			this.getPublicIp().add(values.get("ipaddress"));
+			s_logger.info("Ip address is " + values.get("ipaddress"));
+		} else if (responseCode == 500) {
+			InputStream is = method.getResponseBodyAsStream();
+			Map<String, String> errorInfo = TestClientWithAPI.getSingleValueFromXML(is,
+					new String[] { "errorcode", "description" });
+			s_logger.error("associate ip test failed with errorCode: "
+					+ errorInfo.get("errorCode") + " and description: "
+					+ errorInfo.get("description"));
+		} else {
+			s_logger.error("internal error processing request: "
+					+ method.getStatusText());
+		}
+		
+	}
+	
+		public void registerUser()throws HttpException, IOException{
+	 
+			String encodedUsername = URLEncoder.encode(this.userName, "UTF-8");
+			String encodedPassword = URLEncoder.encode(this.password, "UTF-8");
+			String url = server + "?command=register&username=" + encodedUsername
+					+ "&domainid=1";
+			s_logger.info("registering: " + this.userName+" with url "+url);
+			HttpClient client = new HttpClient();
+			HttpMethod method = new GetMethod(url);
+			int responseCode = client.executeMethod(method);
+			if (responseCode == 200) {
+				InputStream is = method.getResponseBodyAsStream();
+				Map<String, String> requestKeyValues = TestClientWithAPI.getSingleValueFromXML(is,
+						new String[] { "apikey", "secretkey" });
+				this.setApiKey(requestKeyValues.get("apikey"));
+				this.setSecretKey(requestKeyValues.get("secretkey"));
+			} else if (responseCode == 500) {
+				InputStream is = method.getResponseBodyAsStream();
+				Map<String, String> errorInfo = TestClientWithAPI.getSingleValueFromXML(is,
+						new String[] { "errorcode", "description" });
+				s_logger.error("registration failed with errorCode: "
+						+ errorInfo.get("errorCode") + " and description: "
+						+ errorInfo.get("description"));
+			} else {
+				s_logger.error("internal error processing request: "
+						+ method.getStatusText());
+			}
+		}
+		
+}
+
+

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/dcceb9d5/test/src/com/cloud/test/longrun/VirtualMachine.java
----------------------------------------------------------------------
diff --git a/test/src/com/cloud/test/longrun/VirtualMachine.java b/test/src/com/cloud/test/longrun/VirtualMachine.java
index a865c11..24cd206 100644
--- a/test/src/com/cloud/test/longrun/VirtualMachine.java
+++ b/test/src/com/cloud/test/longrun/VirtualMachine.java
@@ -10,103 +10,103 @@
 // limitations under the License.
 // 
 // Automatically generated by addcopyright.py at 04/03/2012
-package com.cloud.test.longrun;
-
-import java.io.InputStream;
-import java.net.URLEncoder;
-import java.util.Map;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.log4j.Logger;
-
+package com.cloud.test.longrun;
+
+import java.io.InputStream;
+import java.net.URLEncoder;
+import java.util.Map;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.log4j.Logger;
+
 import com.cloud.test.stress.TestClientWithAPI;
-
-
-import java.io.IOException;
-
-
-public class VirtualMachine {
-	public static final Logger s_logger= Logger.getLogger(VirtualMachine.class.getClass());
-	
-	private String privateIp;
-	private String userId;
-	
-	
-	public VirtualMachine(String userId){
-		this.userId=userId;
-	}
-	
-	
-	public String getPrivateIp() {
-		return privateIp;
-	}
-
-
-	public void setPrivateIp(String privateIp) {
-		this.privateIp = privateIp;
-	}
-
-
-	public String getUserId() {
-		return userId;
-	}
-
-
-	public void setUserId(String userId) {
-		this.userId = userId;
-	}
-
-
-	public void deployVM(long zoneId, long serviceOfferingId, long templateId, String server, String apiKey, String secretKey) throws IOException{
-
-		String encodedZoneId = URLEncoder.encode("" + zoneId, "UTF-8");
-		String encodedServiceOfferingId = URLEncoder.encode(""
-				+ serviceOfferingId, "UTF-8");
-		String encodedTemplateId = URLEncoder.encode("" + templateId,
-		"UTF-8");
-		String encodedApiKey=URLEncoder.encode(apiKey, "UTF-8");
-		String requestToSign = "apiKey=" + encodedApiKey
-		+ "&command=deployVirtualMachine&serviceOfferingId="
-		+ encodedServiceOfferingId + "&templateId="
-		+ encodedTemplateId + "&zoneId=" + encodedZoneId;
-		
-		requestToSign = requestToSign.toLowerCase();
-		String signature = TestClientWithAPI.signRequest(requestToSign, secretKey);
-		String encodedSignature = URLEncoder.encode(signature, "UTF-8");
-		String url = server + "?command=deployVirtualMachine"
-		+ "&zoneId=" + encodedZoneId + "&serviceOfferingId="
-		+ encodedServiceOfferingId + "&templateId="
-		+ encodedTemplateId + "&apiKey=" + encodedApiKey
-		+ "&signature=" + encodedSignature;
-		
-		s_logger.info("Sending this request to deploy a VM: "+url);
-		HttpClient client = new HttpClient();
-		HttpMethod method = new GetMethod(url);
-		int responseCode = client.executeMethod(method);
-		s_logger.info("deploy linux vm response code: " + responseCode);
-		if (responseCode == 200) {
-			InputStream is = method.getResponseBodyAsStream();
-			Map<String, String> values = TestClientWithAPI.getSingleValueFromXML(is,
-					new String[] { "id", "ipaddress" });
-			long linuxVMId = Long.parseLong(values.get("id"));
-			s_logger.info("got linux virtual machine id: " + linuxVMId);
-			this.setPrivateIp(values.get("ipaddress"));
-
-		} else if (responseCode == 500) {
-			InputStream is = method.getResponseBodyAsStream();
-			Map<String, String> errorInfo = TestClientWithAPI.getSingleValueFromXML(is,
-					new String[] { "errorcode", "description" });
-			s_logger.error("deploy linux vm test failed with errorCode: "
-					+ errorInfo.get("errorCode") + " and description: "
-					+ errorInfo.get("description"));
-		} else {
-			s_logger.error("internal error processing request: "
-					+ method.getStatusText());
-		}
-	}
-	
-		
-
-}
+
+
+import java.io.IOException;
+
+
+public class VirtualMachine {
+	public static final Logger s_logger= Logger.getLogger(VirtualMachine.class.getClass());
+	
+	private String privateIp;
+	private String userId;
+	
+	
+	public VirtualMachine(String userId){
+		this.userId=userId;
+	}
+	
+	
+	public String getPrivateIp() {
+		return privateIp;
+	}
+
+
+	public void setPrivateIp(String privateIp) {
+		this.privateIp = privateIp;
+	}
+
+
+	public String getUserId() {
+		return userId;
+	}
+
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+
+	public void deployVM(long zoneId, long serviceOfferingId, long templateId, String server, String apiKey, String secretKey) throws IOException{
+
+		String encodedZoneId = URLEncoder.encode("" + zoneId, "UTF-8");
+		String encodedServiceOfferingId = URLEncoder.encode(""
+				+ serviceOfferingId, "UTF-8");
+		String encodedTemplateId = URLEncoder.encode("" + templateId,
+		"UTF-8");
+		String encodedApiKey=URLEncoder.encode(apiKey, "UTF-8");
+		String requestToSign = "apiKey=" + encodedApiKey
+		+ "&command=deployVirtualMachine&serviceOfferingId="
+		+ encodedServiceOfferingId + "&templateId="
+		+ encodedTemplateId + "&zoneId=" + encodedZoneId;
+		
+		requestToSign = requestToSign.toLowerCase();
+		String signature = TestClientWithAPI.signRequest(requestToSign, secretKey);
+		String encodedSignature = URLEncoder.encode(signature, "UTF-8");
+		String url = server + "?command=deployVirtualMachine"
+		+ "&zoneId=" + encodedZoneId + "&serviceOfferingId="
+		+ encodedServiceOfferingId + "&templateId="
+		+ encodedTemplateId + "&apiKey=" + encodedApiKey
+		+ "&signature=" + encodedSignature;
+		
+		s_logger.info("Sending this request to deploy a VM: "+url);
+		HttpClient client = new HttpClient();
+		HttpMethod method = new GetMethod(url);
+		int responseCode = client.executeMethod(method);
+		s_logger.info("deploy linux vm response code: " + responseCode);
+		if (responseCode == 200) {
+			InputStream is = method.getResponseBodyAsStream();
+			Map<String, String> values = TestClientWithAPI.getSingleValueFromXML(is,
+					new String[] { "id", "ipaddress" });
+			long linuxVMId = Long.parseLong(values.get("id"));
+			s_logger.info("got linux virtual machine id: " + linuxVMId);
+			this.setPrivateIp(values.get("ipaddress"));
+
+		} else if (responseCode == 500) {
+			InputStream is = method.getResponseBodyAsStream();
+			Map<String, String> errorInfo = TestClientWithAPI.getSingleValueFromXML(is,
+					new String[] { "errorcode", "description" });
+			s_logger.error("deploy linux vm test failed with errorCode: "
+					+ errorInfo.get("errorCode") + " and description: "
+					+ errorInfo.get("description"));
+		} else {
+			s_logger.error("internal error processing request: "
+					+ method.getStatusText());
+		}
+	}
+	
+		
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/dcceb9d5/test/src/com/cloud/test/longrun/guestNetwork.java
----------------------------------------------------------------------
diff --git a/test/src/com/cloud/test/longrun/guestNetwork.java b/test/src/com/cloud/test/longrun/guestNetwork.java
index 54f2df9..e9bafcd 100644
--- a/test/src/com/cloud/test/longrun/guestNetwork.java
+++ b/test/src/com/cloud/test/longrun/guestNetwork.java
@@ -10,94 +10,94 @@
 // limitations under the License.
 // 
 // Automatically generated by addcopyright.py at 04/03/2012
-package com.cloud.test.longrun;
-import java.util.ArrayList;
-import java.util.Random;
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
-import com.trilead.ssh2.Connection;
-import com.trilead.ssh2.Session;
-
-
-public class guestNetwork implements Runnable{
-	public static final Logger s_logger= Logger.getLogger(guestNetwork.class.getClass());
-	
-	private String publicIp;
-	private ArrayList<VirtualMachine> virtualMachines;
-	private int retryNum;
-	
-	public guestNetwork(String publicIp, int retryNum){
-		this.publicIp=publicIp;
-		this.retryNum=retryNum;	
-	}
-	
-	public ArrayList<VirtualMachine> getVirtualMachines() {
-		return virtualMachines;
-	}
-
-	public void setVirtualMachines(ArrayList<VirtualMachine> virtualMachines) {
-		this.virtualMachines = virtualMachines;
-	}
-
-	public void run(){
-		NDC.push("Following thread has started"+Thread.currentThread().getName());
-		int retry = 0;
-					
-				//Start copying files between machines in the network
-				s_logger.info("The size of the array is " + this.virtualMachines.size());
-				while (true) {
-					try {
-					if (retry > 0) {
-						s_logger.info("Retry attempt : " + retry
-								+ " ...sleeping 120 seconds before next attempt");
-						Thread.sleep(120000);
-					}
-					for (VirtualMachine vm: this.virtualMachines ){
-						
-							s_logger.info("Attempting to SSH into linux host " + this.publicIp
-									+ " with retry attempt: " + retry);
-							Connection conn = new Connection(this.publicIp);
-							conn.connect(null, 600000, 600000);
-
-							s_logger.info("SSHed successfully into linux host " + this.publicIp);
-
-							boolean isAuthenticated = conn.authenticateWithPassword("root",
-									"password");
-
-							if (isAuthenticated == false) {
-								s_logger.info("Authentication failed");
-							}
-							//execute copy command
-							Session sess = conn.openSession();
-							String fileName;
-							Random ran = new Random();
-							fileName=Math.abs(ran.nextInt())+"-file";
-							String copyCommand = new String ("./scpScript "+vm.getPrivateIp()+" "+fileName);
-							s_logger.info("Executing " + copyCommand);
-							sess.execCommand(copyCommand);
-							Thread.sleep(120000);
-							sess.close();
-							
-							//execute wget command
-							sess = conn.openSession();
-							String downloadCommand = new String ("wget http://172.16.0.220/scripts/checkDiskSpace.sh; chmod +x *sh; ./checkDiskSpace.sh; rm -rf checkDiskSpace.sh");
-							s_logger.info("Executing " + downloadCommand);
-							sess.execCommand(downloadCommand);
-							Thread.sleep(120000);
-							sess.close();
-							
-							//close the connection
-							conn.close();
-						}
-					}catch (Exception ex) {
-							s_logger.error(ex);
-							retry++;
-							if (retry == retryNum) {
-								s_logger.info("Performance Guest Network test failed with error "
-										+ ex.getMessage()) ;
-							}
-					}		
-					}
-
-	}	
-}
+package com.cloud.test.longrun;
+import java.util.ArrayList;
+import java.util.Random;
+import org.apache.log4j.Logger;
+import org.apache.log4j.NDC;
+import com.trilead.ssh2.Connection;
+import com.trilead.ssh2.Session;
+
+
+public class guestNetwork implements Runnable{
+	public static final Logger s_logger= Logger.getLogger(guestNetwork.class.getClass());
+	
+	private String publicIp;
+	private ArrayList<VirtualMachine> virtualMachines;
+	private int retryNum;
+	
+	public guestNetwork(String publicIp, int retryNum){
+		this.publicIp=publicIp;
+		this.retryNum=retryNum;	
+	}
+	
+	public ArrayList<VirtualMachine> getVirtualMachines() {
+		return virtualMachines;
+	}
+
+	public void setVirtualMachines(ArrayList<VirtualMachine> virtualMachines) {
+		this.virtualMachines = virtualMachines;
+	}
+
+	public void run(){
+		NDC.push("Following thread has started"+Thread.currentThread().getName());
+		int retry = 0;
+					
+				//Start copying files between machines in the network
+				s_logger.info("The size of the array is " + this.virtualMachines.size());
+				while (true) {
+					try {
+					if (retry > 0) {
+						s_logger.info("Retry attempt : " + retry
+								+ " ...sleeping 120 seconds before next attempt");
+						Thread.sleep(120000);
+					}
+					for (VirtualMachine vm: this.virtualMachines ){
+						
+							s_logger.info("Attempting to SSH into linux host " + this.publicIp
+									+ " with retry attempt: " + retry);
+							Connection conn = new Connection(this.publicIp);
+							conn.connect(null, 600000, 600000);
+
+							s_logger.info("SSHed successfully into linux host " + this.publicIp);
+
+							boolean isAuthenticated = conn.authenticateWithPassword("root",
+									"password");
+
+							if (isAuthenticated == false) {
+								s_logger.info("Authentication failed");
+							}
+							//execute copy command
+							Session sess = conn.openSession();
+							String fileName;
+							Random ran = new Random();
+							fileName=Math.abs(ran.nextInt())+"-file";
+							String copyCommand = new String ("./scpScript "+vm.getPrivateIp()+" "+fileName);
+							s_logger.info("Executing " + copyCommand);
+							sess.execCommand(copyCommand);
+							Thread.sleep(120000);
+							sess.close();
+							
+							//execute wget command
+							sess = conn.openSession();
+							String downloadCommand = new String ("wget http://172.16.0.220/scripts/checkDiskSpace.sh; chmod +x *sh; ./checkDiskSpace.sh; rm -rf checkDiskSpace.sh");
+							s_logger.info("Executing " + downloadCommand);
+							sess.execCommand(downloadCommand);
+							Thread.sleep(120000);
+							sess.close();
+							
+							//close the connection
+							conn.close();
+						}
+					}catch (Exception ex) {
+							s_logger.error(ex);
+							retry++;
+							if (retry == retryNum) {
+								s_logger.info("Performance Guest Network test failed with error "
+										+ ex.getMessage()) ;
+							}
+					}		
+					}
+
+	}	
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/dcceb9d5/test/src/com/cloud/test/regression/DelegatedAdminTest.java
----------------------------------------------------------------------
diff --git a/test/src/com/cloud/test/regression/DelegatedAdminTest.java b/test/src/com/cloud/test/regression/DelegatedAdminTest.java
index 74e5f2a..6ade35f 100644
--- a/test/src/com/cloud/test/regression/DelegatedAdminTest.java
+++ b/test/src/com/cloud/test/regression/DelegatedAdminTest.java
@@ -10,119 +10,119 @@
 // limitations under the License.
 // 
 // Automatically generated by addcopyright.py at 04/03/2012
-package com.cloud.test.regression;
-
-
-import java.util.HashMap;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import com.cloud.test.regression.ApiCommand.ResponseType;
-
-public class DelegatedAdminTest extends TestCase{
-	
-public static final Logger s_logger = Logger.getLogger(DelegatedAdminTest.class.getName());
-
-	public DelegatedAdminTest(){
-		this.setClient();
-		this.setParam(new HashMap<String, String>());
-	}
-	
-	public boolean executeTest(){
-		int error=0;
-	
-		for (Document eachElement: this.getInputFile()) {
-			
-			Element rootElement = eachElement.getDocumentElement();
-			NodeList commandLst = rootElement.getElementsByTagName("command");
-			
-			//Analyze each command, send request and build the array list of api commands
-			for (int i=0; i<commandLst.getLength(); i++) {
-				boolean verify = false;
-				Node fstNode = commandLst.item(i);
-			    Element fstElmnt = (Element) fstNode;
-			    
-			    //new command
-				ApiCommand api = new ApiCommand(fstElmnt, this.getParam(), this.getCommands());
-				
-				if ((eachElement.getElementsByTagName("delegated_admin_verify_part2").getLength() != 0) && !(api.getName().equals("registerUserKeys"))) {
-					if (api.getName().startsWith("list")) {
-					    
-					    if (this.denyToExecute()) {
-	                        api.setResponseType(ResponseType.EMPTY);
-	                    }
-						verify = true;
-					}
-					
-					if (this.denyToExecute()) {
-					    api.setResponseType(ResponseType.ERROR);
-					}
-				}
-				
-				//send a command
-				api.sendCommand(this.getClient(), null);
-				
-				//verify the response of the command
-				if ((verify == true) && !(api.getResponseType() == ResponseType.ERROR || api.getResponseType() == ResponseType.EMPTY)) {
-					s_logger.error("Test case " + api.getTestCaseInfo() + " failed. Command that was supposed to fail, passed. The command was sent with the following url " + api.getUrl());
-					error++;
-				} 
-				else if ((verify == true) && (api.getResponseType() == ResponseType.ERROR || api.getResponseType() == ResponseType.EMPTY)) {
-					s_logger.info("Test case " + api.getTestCaseInfo() + " passed");
-				}
-				else if ((api.getResponseType() == ResponseType.ERROR) && (api.getResponseCode() == 200)) {
-					s_logger.error("Test case " + api.getTestCaseInfo() + " failed. Command that was supposed to fail, passed. The command was sent with the following url " + api.getUrl());
-					error++;
-				}
-				else if ((api.getResponseType() != ResponseType.ERROR) && (api.getResponseCode() == 200)) {
-					//set parameters for the future use
-					if (api.setParam(this.getParam()) == false) {
-						s_logger.error("Exiting the test...Command " + api.getName() + " didn't return parameters needed for the future use. The command was sent with url " + api.getUrl());
-						return false;
-					}
-					else if (api.getTestCaseInfo() != null){
-						s_logger.info("Test case " + api.getTestCaseInfo() + " passed");
-					}
-				}
-				else if ((api.getResponseType() != ResponseType.ERROR) && (api.getResponseCode() != 200)) {
-					s_logger.error("Test case  " + api.getTestCaseInfo() + " failed with an error code " + api.getResponseCode() + " . Command was sent with url  " + api.getUrl());
-					if (api.getRequired() == true) {
-						s_logger.info("The command is required for the future use, so exiging");
-						return false;
-					}
-					error++;
-				}
-				else if (api.getTestCaseInfo() != null){
-						s_logger.info("Test case " + api.getTestCaseInfo() +  " passed");
-				
-				}	
-			}
-		}
-		
-		if (error != 0)
-			return false;
-		else
-			return true;
-	}
-	
-	public boolean denyToExecute () {
-		boolean result = true;
-		Integer level1 = Integer.valueOf(this.getParam().get("domainlevel1"));
-		Integer level2 = Integer.valueOf(this.getParam().get("domainlevel2"));
-		String domain1 = this.getParam().get("domainname1");
-		String domain2 = this.getParam().get("domainname2");
-		
-		if (this.getParam().get("accounttype2").equals("1")) {
-			result = false;
-		}
-		else if ((level2.compareTo(level1) < 0) && (domain1.startsWith(domain2)) && (this.getParam().get("accounttype2").equals("2"))) {
-			result = false;
-		}
-		
-		return result;
-	}
-}
+package com.cloud.test.regression;
+
+
+import java.util.HashMap;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import com.cloud.test.regression.ApiCommand.ResponseType;
+
+public class DelegatedAdminTest extends TestCase{
+	
+public static final Logger s_logger = Logger.getLogger(DelegatedAdminTest.class.getName());
+
+	public DelegatedAdminTest(){
+		this.setClient();
+		this.setParam(new HashMap<String, String>());
+	}
+	
+	public boolean executeTest(){
+		int error=0;
+	
+		for (Document eachElement: this.getInputFile()) {
+			
+			Element rootElement = eachElement.getDocumentElement();
+			NodeList commandLst = rootElement.getElementsByTagName("command");
+			
+			//Analyze each command, send request and build the array list of api commands
+			for (int i=0; i<commandLst.getLength(); i++) {
+				boolean verify = false;
+				Node fstNode = commandLst.item(i);
+			    Element fstElmnt = (Element) fstNode;
+			    
+			    //new command
+				ApiCommand api = new ApiCommand(fstElmnt, this.getParam(), this.getCommands());
+				
+				if ((eachElement.getElementsByTagName("delegated_admin_verify_part2").getLength() != 0) && !(api.getName().equals("registerUserKeys"))) {
+					if (api.getName().startsWith("list")) {
+					    
+					    if (this.denyToExecute()) {
+	                        api.setResponseType(ResponseType.EMPTY);
+	                    }
+						verify = true;
+					}
+					
+					if (this.denyToExecute()) {
+					    api.setResponseType(ResponseType.ERROR);
+					}
+				}
+				
+				//send a command
+				api.sendCommand(this.getClient(), null);
+				
+				//verify the response of the command
+				if ((verify == true) && !(api.getResponseType() == ResponseType.ERROR || api.getResponseType() == ResponseType.EMPTY)) {
+					s_logger.error("Test case " + api.getTestCaseInfo() + " failed. Command that was supposed to fail, passed. The command was sent with the following url " + api.getUrl());
+					error++;
+				} 
+				else if ((verify == true) && (api.getResponseType() == ResponseType.ERROR || api.getResponseType() == ResponseType.EMPTY)) {
+					s_logger.info("Test case " + api.getTestCaseInfo() + " passed");
+				}
+				else if ((api.getResponseType() == ResponseType.ERROR) && (api.getResponseCode() == 200)) {
+					s_logger.error("Test case " + api.getTestCaseInfo() + " failed. Command that was supposed to fail, passed. The command was sent with the following url " + api.getUrl());
+					error++;
+				}
+				else if ((api.getResponseType() != ResponseType.ERROR) && (api.getResponseCode() == 200)) {
+					//set parameters for the future use
+					if (api.setParam(this.getParam()) == false) {
+						s_logger.error("Exiting the test...Command " + api.getName() + " didn't return parameters needed for the future use. The command was sent with url " + api.getUrl());
+						return false;
+					}
+					else if (api.getTestCaseInfo() != null){
+						s_logger.info("Test case " + api.getTestCaseInfo() + " passed");
+					}
+				}
+				else if ((api.getResponseType() != ResponseType.ERROR) && (api.getResponseCode() != 200)) {
+					s_logger.error("Test case  " + api.getTestCaseInfo() + " failed with an error code " + api.getResponseCode() + " . Command was sent with url  " + api.getUrl());
+					if (api.getRequired() == true) {
+						s_logger.info("The command is required for the future use, so exiging");
+						return false;
+					}
+					error++;
+				}
+				else if (api.getTestCaseInfo() != null){
+						s_logger.info("Test case " + api.getTestCaseInfo() +  " passed");
+				
+				}	
+			}
+		}
+		
+		if (error != 0)
+			return false;
+		else
+			return true;
+	}
+	
+	public boolean denyToExecute () {
+		boolean result = true;
+		Integer level1 = Integer.valueOf(this.getParam().get("domainlevel1"));
+		Integer level2 = Integer.valueOf(this.getParam().get("domainlevel2"));
+		String domain1 = this.getParam().get("domainname1");
+		String domain2 = this.getParam().get("domainname2");
+		
+		if (this.getParam().get("accounttype2").equals("1")) {
+			result = false;
+		}
+		else if ((level2.compareTo(level1) < 0) && (domain1.startsWith(domain2)) && (this.getParam().get("accounttype2").equals("2"))) {
+			result = false;
+		}
+		
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/dcceb9d5/test/src/com/cloud/test/regression/Deploy.java
----------------------------------------------------------------------
diff --git a/test/src/com/cloud/test/regression/Deploy.java b/test/src/com/cloud/test/regression/Deploy.java
index 81f601a..c3875bd 100644
--- a/test/src/com/cloud/test/regression/Deploy.java
+++ b/test/src/com/cloud/test/regression/Deploy.java
@@ -10,101 +10,101 @@
 // limitations under the License.
 // 
 // Automatically generated by addcopyright.py at 04/03/2012
-package com.cloud.test.regression;
-
+package com.cloud.test.regression;
+
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class Deploy extends TestCase{
-	public static final Logger s_logger = Logger.getLogger(Deploy.class.getName());
-	
-	public Deploy(){
-		this.setClient();
-		this.setParam(new HashMap<String, String>());
-	}
-
-	
-	public boolean executeTest() {
-		int error=0;	
-		Element rootElement = this.getInputFile().get(0).getDocumentElement();
-		NodeList commandLst = rootElement.getElementsByTagName("command");
-		
-		//Analyze each command, send request and build the array list of api commands
-		for (int i=0; i<commandLst.getLength(); i++) {
-			Node fstNode = commandLst.item(i);
-		    Element fstElmnt = (Element) fstNode;
-		    
-		    //new command
-			ApiCommand api = new ApiCommand(fstElmnt, this.getParam(), this.getCommands());
-			
-			//send a command
-			api.sendCommand(this.getClient(), null);
-			
-			
-			//verify the response of the command
-			if (api.getResponseCode() != 200) {
-				error++;
-				s_logger.error("The command " + api.getUrl() + " failed");
-			}
-			else {
-				s_logger.info("The command " + api.getUrl() + " passsed");
-			}
-		}
-			if (error != 0)
-				return false;
-			else
-				return true;
-	}
-		
-	
-	public static void main (String[] args) {
-		
-		List<String> argsList = Arrays.asList(args);
-		Iterator<String> iter = argsList.iterator();
-		String host = null;
-		String file = null;
-		
-		while (iter.hasNext()) {
-			String arg = iter.next();
-			// management server host
-			if (arg.equals("-h")) {
-				host = iter.next();
-			}
-			if (arg.equals("-f")) {
-				file = iter.next();
-			}
-		}
-		
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class Deploy extends TestCase{
+	public static final Logger s_logger = Logger.getLogger(Deploy.class.getName());
+	
+	public Deploy(){
+		this.setClient();
+		this.setParam(new HashMap<String, String>());
+	}
+
+	
+	public boolean executeTest() {
+		int error=0;	
+		Element rootElement = this.getInputFile().get(0).getDocumentElement();
+		NodeList commandLst = rootElement.getElementsByTagName("command");
+		
+		//Analyze each command, send request and build the array list of api commands
+		for (int i=0; i<commandLst.getLength(); i++) {
+			Node fstNode = commandLst.item(i);
+		    Element fstElmnt = (Element) fstNode;
+		    
+		    //new command
+			ApiCommand api = new ApiCommand(fstElmnt, this.getParam(), this.getCommands());
+			
+			//send a command
+			api.sendCommand(this.getClient(), null);
+			
+			
+			//verify the response of the command
+			if (api.getResponseCode() != 200) {
+				error++;
+				s_logger.error("The command " + api.getUrl() + " failed");
+			}
+			else {
+				s_logger.info("The command " + api.getUrl() + " passsed");
+			}
+		}
+			if (error != 0)
+				return false;
+			else
+				return true;
+	}
+		
+	
+	public static void main (String[] args) {
+		
+		List<String> argsList = Arrays.asList(args);
+		Iterator<String> iter = argsList.iterator();
+		String host = null;
+		String file = null;
+		
+		while (iter.hasNext()) {
+			String arg = iter.next();
+			// management server host
+			if (arg.equals("-h")) {
+				host = iter.next();
+			}
+			if (arg.equals("-f")) {
+				file = iter.next();
+			}
+		}
+		
 		Deploy deploy = new Deploy ();
 		
 		ArrayList<String> inputFile = new ArrayList<String>();
-		inputFile.add(file);
-		deploy.setInputFile(inputFile);
-		deploy.setTestCaseName("Management server deployment");
-		deploy.getParam().put("hostip", host);
-		deploy.getParam().put("apicommands", "../metadata/func/commands");
-		deploy.setCommands();
-		
-		s_logger.info("Starting deployment against host " + host);
-		
-		boolean result = deploy.executeTest();
-		if (result == false) {
-     	   s_logger.error("DEPLOYMENT FAILED");
-     	   System.exit(1);
-        }
-        else {
-     	   s_logger.info("DEPLOYMENT IS SUCCESSFUL");
-        }
-		
-	} 
-	
-}
-
+		inputFile.add(file);
+		deploy.setInputFile(inputFile);
+		deploy.setTestCaseName("Management server deployment");
+		deploy.getParam().put("hostip", host);
+		deploy.getParam().put("apicommands", "../metadata/func/commands");
+		deploy.setCommands();
+		
+		s_logger.info("Starting deployment against host " + host);
+		
+		boolean result = deploy.executeTest();
+		if (result == false) {
+     	   s_logger.error("DEPLOYMENT FAILED");
+     	   System.exit(1);
+        }
+        else {
+     	   s_logger.info("DEPLOYMENT IS SUCCESSFUL");
+        }
+		
+	} 
+	
+}
+