airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [1/5] airavata git commit: adding more customizations to test framework - AIRAVATA-1656
Date Fri, 10 Apr 2015 15:50:25 GMT
Repository: airavata
Updated Branches:
  refs/heads/emailMonitoring 66ac6b928 -> 93d4421b7


adding more customizations to test framework - AIRAVATA-1656


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

Branch: refs/heads/emailMonitoring
Commit: fdb3fc918c771c1a7735891af2cd0e760039e7ad
Parents: bf0fddb
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Wed Apr 8 21:57:01 2015 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Wed Apr 8 21:57:01 2015 -0400

----------------------------------------------------------------------
 .../test-suite/multi-tenanted-airavata/README   |   2 +-
 .../test-suite/multi-tenanted-airavata/pom.xml  |  29 ++++
 .../ApplicationRegister.java                    | 147 +++++++++++--------
 .../ComputeResourceRegister.java                |   2 +-
 .../ExperimentExecution.java                    | 140 ++++++++++--------
 .../FrameworkBootstrapping.java                 |   2 +-
 .../multitenantedairavata/GatewayRegister.java  |  23 ++-
 .../utils/FrameworkUtils.java                   |  54 +++++++
 .../utils/TestFrameworkConstants.java           |   3 +
 .../main/resources/test-framework.properties    |   3 +
 10 files changed, 275 insertions(+), 130 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/fdb3fc91/modules/test-suite/multi-tenanted-airavata/README
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/README b/modules/test-suite/multi-tenanted-airavata/README
index da5abd2..b1e8398 100644
--- a/modules/test-suite/multi-tenanted-airavata/README
+++ b/modules/test-suite/multi-tenanted-airavata/README
@@ -45,7 +45,7 @@ How to run
         * result.file.location
         * Amber input file locations (02_Heat.rst_location, 03_Prod.in_location, prmtop_location)
 3. To run the jar, in the command line type :
-        java -Xmx1024m -jar multi-tenanted-airavata-0.15-SNAPSHOT-jar-with-dependencies.jar
-regApps
+        java -cp ./:./resources:multi-tenanted-airavata-0.15-SNAPSHOT-jar-with-dependencies.jar
org.apache.airavata.testsuite.multitenantedairavata.FrameworkBootstrapping -regApps
 
         You can provide different parameters.
             -regApps = to register gateways, generate SSH keys, register applications

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdb3fc91/modules/test-suite/multi-tenanted-airavata/pom.xml
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/pom.xml b/modules/test-suite/multi-tenanted-airavata/pom.xml
index 9068996..a853d35 100644
--- a/modules/test-suite/multi-tenanted-airavata/pom.xml
+++ b/modules/test-suite/multi-tenanted-airavata/pom.xml
@@ -98,4 +98,33 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>org.apache.airavata.testsuite.multitenantedairavata.FrameworkBootstrapping</mainClass>
+                        </manifest>
+                        <manifestEntries>
+                            <Class-Path>./resources/</Class-Path>
+                        </manifestEntries>
+                    </archive>
+                    <descriptorRefs>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
+                    </descriptorRefs>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id> <!-- this is used for inheritance
merges -->
+                        <phase>package</phase> <!-- bind to the packaging
phase -->
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdb3fc91/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
index fa87d83..0a92f2e 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
@@ -30,6 +30,7 @@ import org.apache.airavata.model.appcatalog.appinterface.DataType;
 import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
 import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
 import org.apache.airavata.model.workspace.Gateway;
+import org.apache.airavata.testsuite.multitenantedairavata.utils.FrameworkUtils;
 import org.apache.airavata.testsuite.multitenantedairavata.utils.TestFrameworkConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,6 +49,7 @@ public class ApplicationRegister {
     private String stampedeResourceId;
     private String trestlesResourceId;
     private String br2ResourceId;
+    private List<String> gatewaysToAvoid;
 
 
     public ApplicationRegister(Airavata.Client airavata) throws Exception {
@@ -55,6 +57,8 @@ public class ApplicationRegister {
         allGateways = getAllGateways(airavata);
         applicationInterfaceListPerGateway = new HashMap<String, String>();
         applicationDeployementListPerGateway = new HashMap<String, String>();
+        FrameworkUtils frameworkUtils = FrameworkUtils.getInstance();
+        gatewaysToAvoid = frameworkUtils.getGatewayListToAvoid();
     }
 
     public List<Gateway> getAllGateways(Airavata.Client client) throws Exception{
@@ -84,42 +88,52 @@ public class ApplicationRegister {
     }
 
     protected void addAmberApplication () throws Exception{
-        for (Gateway gateway : allGateways){
-            // add amber module
-            String amberModuleId = airavata.registerApplicationModule(gateway.getGatewayId(),
-                    createApplicationModule(TestFrameworkConstants.AppcatalogConstants.AMBER_APP_NAME,
"12.0", TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION));
-            System.out.println("Amber Module Id " + amberModuleId);
-
-            // add amber interface
-            String amberInterfaceId = registerAmberInterface(gateway, amberModuleId);
-            applicationInterfaceListPerGateway.put(amberInterfaceId, gateway.getGatewayId());
-
-            // add amber deployment
-            List<String> moduleLoadCMDs = new ArrayList<String>();
-            moduleLoadCMDs.add("module load amber");
-            ApplicationDeploymentDescription amberStampedeDeployment = createApplicationDeployment(amberModuleId,
stampedeResourceId,
-                    "/opt/apps/intel13/mvapich2_1_9/amber/12.0/bin/sander.MPI -O", ApplicationParallelismType.MPI,
-                    TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION, moduleLoadCMDs,
null, null);
-            String amberStampedeAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),amberStampedeDeployment);
-
-            String amberTrestlesAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
-                    createApplicationDeployment(amberModuleId, trestlesResourceId,
-                            "/opt/amber/bin/sander.MPI -O", ApplicationParallelismType.MPI,
-                            TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION,
moduleLoadCMDs, null, null));
-
-            List<String> amberModuleLoadCMDsBr2 = new ArrayList<String>();
-            amberModuleLoadCMDsBr2.add("module load amber/gnu/mpi/12");
-            amberModuleLoadCMDsBr2.add("module swap PrgEnv-cray PrgEnv-gnu");
-            String amberBr2AppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
-                    createApplicationDeployment(amberModuleId, br2ResourceId,
-                            "/N/soft/cle4/amber/gnu/mpi/12/amber12/bin/sander.MPI -O", ApplicationParallelismType.MPI,
-                            TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION,
amberModuleLoadCMDsBr2, null, null));
-
-            applicationDeployementListPerGateway.put(amberStampedeAppDeployId, gateway.getGatewayId());
-            applicationDeployementListPerGateway.put(amberTrestlesAppDeployId, gateway.getGatewayId());
-            applicationDeployementListPerGateway.put(amberBr2AppDeployId, gateway.getGatewayId());
+        for (Gateway gateway : allGateways) {
+                boolean isgatewayValid = true;
+                for (String ovoidGateway : gatewaysToAvoid){
+                    if (gateway.getGatewayId().equals(ovoidGateway)){
+                        isgatewayValid = false;
+                        break;
+                    }
+                }
+                if (isgatewayValid) {
+                    // add amber module
+                    String amberModuleId = airavata.registerApplicationModule(gateway.getGatewayId(),
+                            createApplicationModule(TestFrameworkConstants.AppcatalogConstants.AMBER_APP_NAME,
"12.0", TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION));
+                    System.out.println("Amber Module Id " + amberModuleId);
+
+                    // add amber interface
+                    String amberInterfaceId = registerAmberInterface(gateway, amberModuleId);
+                    applicationInterfaceListPerGateway.put(amberInterfaceId, gateway.getGatewayId());
+
+                    // add amber deployment
+                    List<String> moduleLoadCMDs = new ArrayList<String>();
+                    moduleLoadCMDs.add("module load amber");
+                    ApplicationDeploymentDescription amberStampedeDeployment = createApplicationDeployment(amberModuleId,
stampedeResourceId,
+                            "/opt/apps/intel13/mvapich2_1_9/amber/12.0/bin/sander.MPI -O",
ApplicationParallelismType.MPI,
+                            TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION,
moduleLoadCMDs, null, null);
+                    String amberStampedeAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
amberStampedeDeployment);
+
+                    String amberTrestlesAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
+                            createApplicationDeployment(amberModuleId, trestlesResourceId,
+                                    "/opt/amber/bin/sander.MPI -O", ApplicationParallelismType.MPI,
+                                    TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION,
moduleLoadCMDs, null, null));
+
+                    List<String> amberModuleLoadCMDsBr2 = new ArrayList<String>();
+                    amberModuleLoadCMDsBr2.add("module load amber/gnu/mpi/12");
+                    amberModuleLoadCMDsBr2.add("module swap PrgEnv-cray PrgEnv-gnu");
+                    String amberBr2AppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
+                            createApplicationDeployment(amberModuleId, br2ResourceId,
+                                    "/N/soft/cle4/amber/gnu/mpi/12/amber12/bin/sander.MPI
-O", ApplicationParallelismType.MPI,
+                                    TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION,
amberModuleLoadCMDsBr2, null, null));
+
+                    applicationDeployementListPerGateway.put(amberStampedeAppDeployId, gateway.getGatewayId());
+                    applicationDeployementListPerGateway.put(amberTrestlesAppDeployId, gateway.getGatewayId());
+                    applicationDeployementListPerGateway.put(amberBr2AppDeployId, gateway.getGatewayId());
+                }
         }
 
+
     }
 
     private String registerAmberInterface(Gateway gateway, String amberModuleId) throws org.apache.thrift.TException
{
@@ -187,34 +201,43 @@ public class ApplicationRegister {
 
     protected void addEchoApplication() throws Exception{
         for (Gateway gateway : allGateways){
-            // add echo module
-            String echoModuleId = airavata.registerApplicationModule(gateway.getGatewayId(),
-                    createApplicationModule(TestFrameworkConstants.AppcatalogConstants.ECHO_NAME,
"1.0", TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION));
-            System.out.println("Echo Module Id " + echoModuleId);
-
-            // add amber interface
-            String echoInterfaceId = registerEchoInterface(gateway, echoModuleId);
-            applicationInterfaceListPerGateway.put(echoInterfaceId, gateway.getGatewayId());
-
-            // add amber deployment
-            String echoStampedeAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
-                    createApplicationDeployment(echoModuleId, stampedeResourceId,
-                            "/home1/01437/ogce/production/app_wrappers/echo_wrapper.sh",
ApplicationParallelismType.SERIAL,
-                            TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION,
null, null, null));
-
-            String echoTrestlesAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
-                    createApplicationDeployment(echoModuleId, trestlesResourceId,
-                            "/home/ogce/production/app_wrappers/echo_wrapper.sh", ApplicationParallelismType.SERIAL,
-                            TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION,
null, null, null));
-
-            String echoBr2AppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
-                    createApplicationDeployment(echoModuleId, br2ResourceId,
-                            "/N/u/cgateway/BigRed2/production/app_wrappers/echo_wrapper.sh",
ApplicationParallelismType.SERIAL,
-                            TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION,
null, null, null));
-
-            applicationDeployementListPerGateway.put(echoStampedeAppDeployId, gateway.getGatewayId());
-            applicationDeployementListPerGateway.put(echoTrestlesAppDeployId, gateway.getGatewayId());
-            applicationDeployementListPerGateway.put(echoBr2AppDeployId, gateway.getGatewayId());
+            boolean isgatewayValid = true;
+            for (String ovoidGateway : gatewaysToAvoid){
+                if (gateway.getGatewayId().equals(ovoidGateway)){
+                    isgatewayValid = false;
+                    break;
+                }
+            }
+            if (isgatewayValid) {
+                // add echo module
+                String echoModuleId = airavata.registerApplicationModule(gateway.getGatewayId(),
+                        createApplicationModule(TestFrameworkConstants.AppcatalogConstants.ECHO_NAME,
"1.0", TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION));
+                System.out.println("Echo Module Id " + echoModuleId);
+
+                // add amber interface
+                String echoInterfaceId = registerEchoInterface(gateway, echoModuleId);
+                applicationInterfaceListPerGateway.put(echoInterfaceId, gateway.getGatewayId());
+
+                // add amber deployment
+                String echoStampedeAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
+                        createApplicationDeployment(echoModuleId, stampedeResourceId,
+                                "/home1/01437/ogce/production/app_wrappers/echo_wrapper.sh",
ApplicationParallelismType.SERIAL,
+                                TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION,
null, null, null));
+
+                String echoTrestlesAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
+                        createApplicationDeployment(echoModuleId, trestlesResourceId,
+                                "/home/ogce/production/app_wrappers/echo_wrapper.sh", ApplicationParallelismType.SERIAL,
+                                TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION,
null, null, null));
+
+                String echoBr2AppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
+                        createApplicationDeployment(echoModuleId, br2ResourceId,
+                                "/N/u/cgateway/BigRed2/production/app_wrappers/echo_wrapper.sh",
ApplicationParallelismType.SERIAL,
+                                TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION,
null, null, null));
+
+                applicationDeployementListPerGateway.put(echoStampedeAppDeployId, gateway.getGatewayId());
+                applicationDeployementListPerGateway.put(echoTrestlesAppDeployId, gateway.getGatewayId());
+                applicationDeployementListPerGateway.put(echoBr2AppDeployId, gateway.getGatewayId());
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdb3fc91/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ComputeResourceRegister.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ComputeResourceRegister.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ComputeResourceRegister.java
index ebb1451..c6e2513 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ComputeResourceRegister.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ComputeResourceRegister.java
@@ -109,7 +109,7 @@ public class ComputeResourceRegister {
                 } else if (resourceName.contains("bigred2")) {
                     //Register BigRedII
                     bigredResourceId = registerComputeHost("bigred2.uits.iu.edu", "IU BigRed
II Cluster",
-                            ResourceJobManagerType.PBS, "push", "/opt/torque/torque-4.2.3.1/bin/",
SecurityProtocol.SSH_KEYS, 22, "aprun -n");
+                            ResourceJobManagerType.PBS, "push", "/opt/torque/torque-5.0.1/bin/",
SecurityProtocol.SSH_KEYS, 22, "aprun -n");
                     System.out.println("BigredII Resource Id is " + bigredResourceId);
                 }
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdb3fc91/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ExperimentExecution.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ExperimentExecution.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ExperimentExecution.java
index 807dd1d..cc6bca6 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ExperimentExecution.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ExperimentExecution.java
@@ -38,6 +38,7 @@ import org.apache.airavata.model.messaging.event.MessageType;
 import org.apache.airavata.model.util.ExperimentModelUtil;
 import org.apache.airavata.model.workspace.Project;
 import org.apache.airavata.model.workspace.experiment.*;
+import org.apache.airavata.testsuite.multitenantedairavata.utils.FrameworkUtils;
 import org.apache.airavata.testsuite.multitenantedairavata.utils.PropertyFileType;
 import org.apache.airavata.testsuite.multitenantedairavata.utils.PropertyReader;
 import org.apache.airavata.testsuite.multitenantedairavata.utils.TestFrameworkConstants;
@@ -62,6 +63,8 @@ public class ExperimentExecution {
     private Map<String, List<Project>> projectsMap;
     private PropertyReader propertyReader;
     private PrintWriter resultWriter;
+    private String testUser;
+    private List<String> gatewaysToAvoid;
 
     public ExperimentExecution(Airavata.Client airavata,
                                Map<String, String> tokenMap ) throws Exception {
@@ -69,6 +72,9 @@ public class ExperimentExecution {
         this.csTokens = tokenMap;
         this.appInterfaceMap = getApplicationMap(tokenMap);
         this.propertyReader = new PropertyReader();
+        FrameworkUtils frameworkUtils = FrameworkUtils.getInstance();
+        testUser = frameworkUtils.getTestUserName();
+        gatewaysToAvoid = frameworkUtils.getGatewayListToAvoid();
         this.projectsMap = getProjects(tokenMap);
         this.experimentsWithTokens = new HashMap<String, String>();
         this.experimentsWithGateway = new HashMap<String, String>();
@@ -118,9 +124,15 @@ public class ExperimentExecution {
         try {
             if (tokenMap != null && !tokenMap.isEmpty()){
                 for (String gatewayId : tokenMap.keySet()){
-                    if (!gatewayId.equals("php_reference_gateway")){
-                        String userName = "testUser_" + gatewayId;
-                        List<Project> allUserProjects = airavata.getAllUserProjects(gatewayId,
userName);
+                    boolean isgatewayValid = true;
+                    for (String ovoidGateway : gatewaysToAvoid){
+                        if (gatewayId.equals(ovoidGateway)){
+                            isgatewayValid = false;
+                            break;
+                        }
+                    }
+                    if (isgatewayValid){
+                        List<Project> allUserProjects = airavata.getAllUserProjects(gatewayId,
testUser);
                         projectsMap.put(gatewayId, allUserProjects);
                     }
                 }
@@ -287,9 +299,8 @@ public class ExperimentExecution {
                         if (projectsPerGateway != null && !projectsPerGateway.isEmpty()){
                             projectID = projectsPerGateway.get(0).getProjectID();
                         }
-                        String userName = "testUser_" + gatewayId;
                         Experiment simpleExperiment =
-                                ExperimentModelUtil.createSimpleExperiment(projectID, userName,
"Amber Experiment", "Amber Experiment run", appId, applicationInputs);
+                                ExperimentModelUtil.createSimpleExperiment(projectID, testUser,
"Amber Experiment", "Amber Experiment run", appId, applicationInputs);
                         simpleExperiment.setExperimentOutputs(appOutputs);
                         String experimentId;
                         Map<String, String> computeResources = airavata.getAvailableAppInterfaceComputeResources(appId);
@@ -341,69 +352,76 @@ public class ExperimentExecution {
     public void createEchoExperiment () throws Exception{
         try {
             for (String gatewayId : csTokens.keySet()) {
-                if (!gatewayId.equals("php_reference_gateway")){
-                    String token = csTokens.get(gatewayId);
-                    Map<String, String> appsWithNames = appInterfaceMap.get(gatewayId);
-                    for (String appId : appsWithNames.keySet()) {
-                        String appName = appsWithNames.get(appId);
-                        if (appName.equals(TestFrameworkConstants.AppcatalogConstants.ECHO_NAME))
{
-                            List<InputDataObjectType> applicationInputs = airavata.getApplicationInputs(appId);
-                            List<OutputDataObjectType> appOutputs = airavata.getApplicationOutputs(appId);
-                            for (InputDataObjectType inputDataObjectType : applicationInputs)
{
-                                if (inputDataObjectType.getName().equalsIgnoreCase("input_to_Echo"))
{
-                                    inputDataObjectType.setValue("Hello World !!!");
+                    boolean isgatewayValid = true;
+                    for (String ovoidGateway : gatewaysToAvoid){
+                        if (gatewayId.equals(ovoidGateway)){
+                            isgatewayValid = false;
+                            break;
+                        }
+                    }
+                    if (isgatewayValid) {
+                        String token = csTokens.get(gatewayId);
+                        Map<String, String> appsWithNames = appInterfaceMap.get(gatewayId);
+                        for (String appId : appsWithNames.keySet()) {
+                            String appName = appsWithNames.get(appId);
+                            if (appName.equals(TestFrameworkConstants.AppcatalogConstants.ECHO_NAME))
{
+                                List<InputDataObjectType> applicationInputs = airavata.getApplicationInputs(appId);
+                                List<OutputDataObjectType> appOutputs = airavata.getApplicationOutputs(appId);
+                                for (InputDataObjectType inputDataObjectType : applicationInputs)
{
+                                    if (inputDataObjectType.getName().equalsIgnoreCase("input_to_Echo"))
{
+                                        inputDataObjectType.setValue("Hello World !!!");
+                                    }
                                 }
-                            }
 
-                            List<Project> projectsPerGateway = projectsMap.get(gatewayId);
-                            String projectID = null;
-                            if (projectsPerGateway != null && !projectsPerGateway.isEmpty()){
-                                projectID = projectsPerGateway.get(0).getProjectID();
-                            }
-                            Experiment simpleExperiment =
-                                    ExperimentModelUtil.createSimpleExperiment(projectID,
"admin", "Echo Experiment", "Echo Experiment run", appId, applicationInputs);
-                            simpleExperiment.setExperimentOutputs(appOutputs);
-                            String experimentId;
-                            Map<String, String> computeResources = airavata.getAvailableAppInterfaceComputeResources(appId);
-                            if (computeResources != null && computeResources.size()
!= 0) {
-                                for (String id : computeResources.keySet()) {
-                                    String resourceName = computeResources.get(id);
-                                    if (resourceName.equals(TestFrameworkConstants.AppcatalogConstants.TRESTLES_RESOURCE_NAME))
{
-                                        ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling(id,
4, 1, 1, "normal", 20, 0, 1, null);
-                                        UserConfigurationData userConfigurationData = new
UserConfigurationData();
-                                        userConfigurationData.setAiravataAutoSchedule(false);
-                                        userConfigurationData.setOverrideManualScheduledParams(false);
-                                        userConfigurationData.setComputationalResourceScheduling(scheduling);
-                                        simpleExperiment.setUserConfigurationData(userConfigurationData);
-                                        experimentId = airavata.createExperiment(gatewayId,
simpleExperiment);
-                                        experimentsWithTokens.put(experimentId, token);
-                                        experimentsWithGateway.put(experimentId, gatewayId);
-                                    } else if (resourceName.equals(TestFrameworkConstants.AppcatalogConstants.STAMPEDE_RESOURCE_NAME))
{
-                                        ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling(id,
4, 1, 1, "normal", 20, 0, 1, null);
-                                        UserConfigurationData userConfigurationData = new
UserConfigurationData();
-                                        userConfigurationData.setAiravataAutoSchedule(false);
-                                        userConfigurationData.setOverrideManualScheduledParams(false);
-                                        userConfigurationData.setComputationalResourceScheduling(scheduling);
-                                        simpleExperiment.setUserConfigurationData(userConfigurationData);
-                                        experimentId = airavata.createExperiment(gatewayId,
simpleExperiment);
-                                        experimentsWithTokens.put(experimentId, token);
-                                        experimentsWithGateway.put(experimentId, gatewayId);
-                                    }else if (resourceName.equals(TestFrameworkConstants.AppcatalogConstants.BR2_RESOURCE_NAME))
{
-                                        ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling(id,
4, 1, 1, "normal", 20, 0, 1, null);
-                                        UserConfigurationData userConfigurationData = new
UserConfigurationData();
-                                        userConfigurationData.setAiravataAutoSchedule(false);
-                                        userConfigurationData.setOverrideManualScheduledParams(false);
-                                        userConfigurationData.setComputationalResourceScheduling(scheduling);
-                                        simpleExperiment.setUserConfigurationData(userConfigurationData);
-                                        experimentId = airavata.createExperiment(gatewayId,
simpleExperiment);
-                                        experimentsWithTokens.put(experimentId, token);
-                                        experimentsWithGateway.put(experimentId, gatewayId);
+                                List<Project> projectsPerGateway = projectsMap.get(gatewayId);
+                                String projectID = null;
+                                if (projectsPerGateway != null && !projectsPerGateway.isEmpty())
{
+                                    projectID = projectsPerGateway.get(0).getProjectID();
+                                }
+                                Experiment simpleExperiment =
+                                        ExperimentModelUtil.createSimpleExperiment(projectID,
"admin", "Echo Experiment", "Echo Experiment run", appId, applicationInputs);
+                                simpleExperiment.setExperimentOutputs(appOutputs);
+                                String experimentId;
+                                Map<String, String> computeResources = airavata.getAvailableAppInterfaceComputeResources(appId);
+                                if (computeResources != null && computeResources.size()
!= 0) {
+                                    for (String id : computeResources.keySet()) {
+                                        String resourceName = computeResources.get(id);
+                                        if (resourceName.equals(TestFrameworkConstants.AppcatalogConstants.TRESTLES_RESOURCE_NAME))
{
+                                            ComputationalResourceScheduling scheduling =
ExperimentModelUtil.createComputationResourceScheduling(id, 4, 1, 1, "normal", 20, 0, 1, null);
+                                            UserConfigurationData userConfigurationData =
new UserConfigurationData();
+                                            userConfigurationData.setAiravataAutoSchedule(false);
+                                            userConfigurationData.setOverrideManualScheduledParams(false);
+                                            userConfigurationData.setComputationalResourceScheduling(scheduling);
+                                            simpleExperiment.setUserConfigurationData(userConfigurationData);
+                                            experimentId = airavata.createExperiment(gatewayId,
simpleExperiment);
+                                            experimentsWithTokens.put(experimentId, token);
+                                            experimentsWithGateway.put(experimentId, gatewayId);
+                                        } else if (resourceName.equals(TestFrameworkConstants.AppcatalogConstants.STAMPEDE_RESOURCE_NAME))
{
+                                            ComputationalResourceScheduling scheduling =
ExperimentModelUtil.createComputationResourceScheduling(id, 4, 1, 1, "normal", 20, 0, 1, null);
+                                            UserConfigurationData userConfigurationData =
new UserConfigurationData();
+                                            userConfigurationData.setAiravataAutoSchedule(false);
+                                            userConfigurationData.setOverrideManualScheduledParams(false);
+                                            userConfigurationData.setComputationalResourceScheduling(scheduling);
+                                            simpleExperiment.setUserConfigurationData(userConfigurationData);
+                                            experimentId = airavata.createExperiment(gatewayId,
simpleExperiment);
+                                            experimentsWithTokens.put(experimentId, token);
+                                            experimentsWithGateway.put(experimentId, gatewayId);
+                                        } else if (resourceName.equals(TestFrameworkConstants.AppcatalogConstants.BR2_RESOURCE_NAME))
{
+                                            ComputationalResourceScheduling scheduling =
ExperimentModelUtil.createComputationResourceScheduling(id, 4, 1, 1, "normal", 20, 0, 1, null);
+                                            UserConfigurationData userConfigurationData =
new UserConfigurationData();
+                                            userConfigurationData.setAiravataAutoSchedule(false);
+                                            userConfigurationData.setOverrideManualScheduledParams(false);
+                                            userConfigurationData.setComputationalResourceScheduling(scheduling);
+                                            simpleExperiment.setUserConfigurationData(userConfigurationData);
+                                            experimentId = airavata.createExperiment(gatewayId,
simpleExperiment);
+                                            experimentsWithTokens.put(experimentId, token);
+                                            experimentsWithGateway.put(experimentId, gatewayId);
+                                        }
                                     }
                                 }
                             }
                         }
                     }
-                }
 
             }
         }catch (Exception e){

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdb3fc91/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
index 1c03d8e..a3b3825 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/FrameworkBootstrapping.java
@@ -67,7 +67,7 @@ public class FrameworkBootstrapping {
                 logger.info("Gateways created...");
                 setup.getGatewayRegister().registerSSHKeys();
                 logger.info("Registered SSH keys to each gateway...");
-                tokens = readTokens();
+//                tokens = readTokens();
                 setup.getComputeResourceRegister().addComputeResources();
                 setup.getComputeResourceRegister().registerGatewayResourceProfile();
                 setup.getApplicationRegister().addApplications();

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdb3fc91/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/GatewayRegister.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/GatewayRegister.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/GatewayRegister.java
index 0059e27..7f40976 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/GatewayRegister.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/GatewayRegister.java
@@ -36,6 +36,7 @@ import org.apache.airavata.model.error.AiravataSystemException;
 import org.apache.airavata.model.error.InvalidRequestException;
 import org.apache.airavata.model.workspace.Gateway;
 import org.apache.airavata.model.workspace.Project;
+import org.apache.airavata.testsuite.multitenantedairavata.utils.FrameworkUtils;
 import org.apache.airavata.testsuite.multitenantedairavata.utils.PropertyFileType;
 import org.apache.airavata.testsuite.multitenantedairavata.utils.PropertyReader;
 import org.apache.airavata.testsuite.multitenantedairavata.utils.TestFrameworkConstants;
@@ -55,6 +56,9 @@ public class GatewayRegister {
     private int gatewayCount;
     private Map<String, String> tokenMap;
     private Map<String, String> projectMap;
+    private String testUser;
+    private String testProject;
+    private List<String> gatewaysToAvoid;
 
     public GatewayRegister(Airavata.Client client) throws Exception{
         try {
@@ -62,6 +66,10 @@ public class GatewayRegister {
             this.tokenMap = new HashMap<String, String>();
             this.projectMap = new HashMap<String, String>();
             propertyReader = new PropertyReader();
+            testUser = propertyReader.readProperty(TestFrameworkConstants.FrameworkPropertiesConstants.TEST_USER,
PropertyFileType.TEST_FRAMEWORK);
+            testProject = propertyReader.readProperty(TestFrameworkConstants.FrameworkPropertiesConstants.TEST_PROJECT,
PropertyFileType.TEST_FRAMEWORK);
+            FrameworkUtils frameworkUtils = FrameworkUtils.getInstance();
+            gatewaysToAvoid = frameworkUtils.getGatewayListToAvoid();
         }catch (Exception e){
             logger.error("Error while initializing setup step", e);
             throw new Exception("Error while initializing setup step", e);
@@ -104,8 +112,8 @@ public class GatewayRegister {
 
     public void createProject (String gatewayId) throws Exception{
         Project project = new Project();
-        project.setName("testProj_" + gatewayId);
-        project.setOwner("testUser_" + gatewayId);
+        project.setName(testProject);
+        project.setOwner(testUser);
         String projectId = airavata.createProject(gatewayId, project);
         projectMap.put(projectId, gatewayId);
     }
@@ -130,12 +138,19 @@ public class GatewayRegister {
             SSHCredentialWriter writer = new SSHCredentialWriter(dbUtil);
             List<Gateway> allGateways = airavata.getAllGateways();
             for (Gateway gateway : allGateways){
-                if (!gateway.getGatewayId().equals("php_reference_gateway")){
+                boolean isgatewayValid = true;
+                for (String ovoidGateway : gatewaysToAvoid){
+                    if (gateway.getGatewayId().equals(ovoidGateway)){
+                        isgatewayValid = false;
+                        break;
+                    }
+                }
+                if (isgatewayValid) {
                     SSHCredential sshCredential = new SSHCredential();
                     sshCredential.setGateway(gateway.getGatewayId());
                     String token = TokenGenerator.generateToken(gateway.getGatewayId(), null);
                     sshCredential.setToken(token);
-                    sshCredential.setPortalUserName("testuser");
+                    sshCredential.setPortalUserName(testUser);
                     FileInputStream privateKeyStream = new FileInputStream(privateKeyPath);
                     File filePri = new File(privateKeyPath);
                     byte[] bFilePri = new byte[(int) filePri.length()];

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdb3fc91/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/FrameworkUtils.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/FrameworkUtils.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/FrameworkUtils.java
new file mode 100644
index 0000000..cdc1304
--- /dev/null
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/FrameworkUtils.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+package org.apache.airavata.testsuite.multitenantedairavata.utils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class FrameworkUtils {
+    private static PropertyReader propertyReader;
+
+    private static FrameworkUtils ourInstance = new FrameworkUtils();
+
+    public static FrameworkUtils getInstance() {
+        return ourInstance;
+    }
+
+    public FrameworkUtils() {
+        propertyReader = new PropertyReader();
+    }
+
+    public List<String> getGatewayListToAvoid (){
+        String listOfGateways = propertyReader.readProperty(TestFrameworkConstants.FrameworkPropertiesConstants.GATEWAYS_TOSKIP,
PropertyFileType.TEST_FRAMEWORK);
+        String[] gateways = listOfGateways.split(",");
+        return Arrays.asList(gateways);
+    }
+
+    public String getTestUserName (){
+        return propertyReader.readProperty(TestFrameworkConstants.FrameworkPropertiesConstants.TEST_USER,
PropertyFileType.TEST_FRAMEWORK);
+    }
+
+    public String getTesProjectName (){
+        return propertyReader.readProperty(TestFrameworkConstants.FrameworkPropertiesConstants.TEST_PROJECT,
PropertyFileType.TEST_FRAMEWORK);
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdb3fc91/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
index 35cc6d1..c0ea2c4 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
@@ -48,6 +48,9 @@ public class TestFrameworkConstants {
         public static final String SSH_USERNAME = "ssh.username";
         public static final String TOKEN_WRITE_LOCATION = "token.file.location";
         public static final String RESULT_WRITE_LOCATION = "result.file.location";
+        public static final String GATEWAYS_TOSKIP = "gateways.toskip";
+        public static final String TEST_USER = "test.user";
+        public static final String TEST_PROJECT = "test.project";
     }
 
     public static final class GatewayConstants {

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdb3fc91/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.properties
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.properties
b/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.properties
index 3a66eb1..65a6554 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.properties
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.properties
@@ -32,6 +32,9 @@ ssh.password=
 ssh.username=ogce
 token.file.location=/tmp/
 result.file.location=/tmp/test_framework_results/
+gateways.toskip=default,php_reference_gateway,ultrascan,umass
+test.user=testUser
+test.project=testProject
 
 # Application Inputs
 # Amber input file locations


Mime
View raw message