Repository: wso2/testgrid
Issue: Validate input for config name property

**Description:**
eg:
```yaml
deploymentConfig:
  deploymentPatterns:
    - name: 'scenario tests'
      description: 'dummy'
      remoteRepository: "https://github.com/ballerina-platform/ballerina-lang.git"
      remoteBranch: "ballerina-scenarios"
      dir: .
      scripts:
        - name: 'default'
          type: SHELL
          file: product-scenarios/deployment-data.sh
```

Above configuration causes the following

```bash
[INFO] : 2019-01-05, 13:33:32 : Preparing workspace for testplan : data-integration_scenario tests_OracleJDK-8_MySQL-5.7_Ubuntu-18.04_run1
[INFO] : 2019-01-05, 13:33:32 :  Creating workspace and builds sub-directories
[data-integration@2] Running shell script
+ rm -r -f /testgrid/testgrid-home/jobs/data-integration/data-integration_scenario tests_OracleJDK-8_MySQL-5.7_Ubuntu-18.04_run1/
+ mkdir -p /testgrid/testgrid-home/jobs/data-integration/data-integration_scenario tests_OracleJDK-8_MySQL-5.7_Ubuntu-18.04_run1
+ mkdir -p /testgrid/testgrid-home/jobs/data-integration/data-integration_scenario tests_OracleJDK-8_MySQL-5.7_Ubuntu-18.04_run1/builds
+ mkdir -p /testgrid/testgrid-home/jobs/data-integration/data-integration_scenario tests_OracleJDK-8_MySQL-5.7_Ubuntu-18.04_run1/workspace
+ cd /testgrid/testgrid-home/jobs/data-integration/data-integration_scenario tests_OracleJDK-8_MySQL-5.7_Ubuntu-18.04_run1/workspace
+ echo Workspace directory content:
Workspace directory content:
+ ls /testgrid/testgrid-home/jobs/data-integration/data-integration_scenario tests_OracleJDK-8_MySQL-5.7_Ubuntu-18.04_run1/
ls: cannot access 'tests_OracleJDK-8_MySQL-5.7_Ubuntu-18.04_run1/': No such file or directory
/testgrid/testgrid-home/jobs/data-integration/data-integration_scenario:
script returned exit code 2
```


Changed files:
core/src/main/java/org/wso2/testgrid/core/command/GenerateTestPlanCommand.java

diff --git a/core/src/main/java/org/wso2/testgrid/core/command/GenerateTestPlanCommand.java b/core/src/main/java/org/wso2/testgrid/core/command/GenerateTestPlanCommand.java
index cf196217..08824cfa 100644
--- a/core/src/main/java/org/wso2/testgrid/core/command/GenerateTestPlanCommand.java
+++ b/core/src/main/java/org/wso2/testgrid/core/command/GenerateTestPlanCommand.java
@@ -324,6 +324,7 @@ public class GenerateTestPlanCommand implements Command {
         representer.getPropertyUtils().setSkipMissingProperties(true); // Skip missing properties in testgrid.yaml
         TestgridYaml testgridYaml = new Yaml(new Constructor(TestgridYaml.class), representer)
                 .loadAs(testgridYamlContent, TestgridYaml.class);
+        validateDeploymentConfigName(testgridYaml);
         insertJobConfigFilePropertiesTo(testgridYaml, jobConfigFile);
 
         if (logger.isDebugEnabled()) {
@@ -332,6 +333,18 @@ public class GenerateTestPlanCommand implements Command {
         return testgridYaml;
     }
 
+    /**
+     * Validate deploymentConfig name and replace invalid characters with '-'.
+     *
+     * @param testgridYaml testgridYaml
+     */
+    private void validateDeploymentConfigName(TestgridYaml testgridYaml) {
+        for (DeploymentConfig.DeploymentPattern deploymentPattern : testgridYaml.getDeploymentConfig()
+                .getDeploymentPatterns()) {
+            deploymentPattern.setName(deploymentPattern.getName().replaceAll("[^a-zA-Z0-9:/]", "-"));
+        }
+    }
+
     /**
      * Reads the @{@link JobConfigFile} and add its content into {@link TestgridYaml}.
      *