From 063e423b45a1cd94e1824275577389631e657a1d Mon Sep 17 00:00:00 2001 From: Kalaiyarasiganeshalingam Date: Sat, 23 Nov 2024 15:46:54 +0530 Subject: [PATCH] Update script Fix reviewed comments and test failure Update script Convert to log error Update script Update the script to support 17 and 21 Update capp Update reuest url --- .../config/deployer/ConfigDeployer.java | 141 +++++++++--------- distribution/src/scripts/micro-integrator.sh | 34 +++-- .../carbonserver/CarbonServerManager.java | 13 -- .../src/test/resources/bin/integrator.sh | 32 ++-- .../src/test/resources/bin/integrator.sh | 32 ++-- .../src/test/resources/bin/integrator.sh | 32 ++-- .../ApiWithConfigurablePropertyTestCase.java | 23 +-- .../artifacts/ESB/server/conf/file.properties | 1 + ...testApiWithConfigurationProperty_1.0.0.car | Bin 3852 -> 3115 bytes .../ESB/serviceCatalog/micro-integrator.sh | 37 +++-- .../src/test/resources/bin/integrator.sh | 32 ++-- .../enableCorrelation/micro-integrator.sh | 32 ++-- .../artifacts/ESB/vfs/micro-integrator.sh | 32 ++-- .../src/test/resources/bin/integrator.sh | 32 ++-- .../src/test/resources/bin/integrator.sh | 32 ++-- .../ESB/server/bin/micro-integrator.sh | 37 +++-- .../src/test/resources/bin/integrator.sh | 32 ++-- .../src/test/resources/bin/integrator.sh | 32 ++-- .../src/test/resources/bin/integrator.sh | 32 ++-- .../src/test/resources/bin/integrator.sh | 32 ++-- 20 files changed, 400 insertions(+), 270 deletions(-) diff --git a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/deployment/config/deployer/ConfigDeployer.java b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/deployment/config/deployer/ConfigDeployer.java index fa8418a88d..3921e0d6ac 100644 --- a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/deployment/config/deployer/ConfigDeployer.java +++ b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/deployment/config/deployer/ConfigDeployer.java @@ -22,7 +22,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.synapse.commons.property.PropertyHolder; -import org.apache.synapse.commons.resolvers.ResolverFactory; import org.apache.synapse.transport.nhttp.config.SslSenderTrustStoreHolder; import org.wso2.micro.application.deployer.CarbonApplication; import org.wso2.micro.application.deployer.config.ApplicationConfiguration; @@ -32,13 +31,17 @@ import java.io.File; import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; import java.security.cert.Certificate; +import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.util.ArrayList; import java.util.Enumeration; @@ -55,7 +58,6 @@ public class ConfigDeployer implements AppDeploymentHandler { private static final String LOCAL_CONFIG_FILE_NAME = "config.properties"; private static final String GLOBAL_CONFIG_FILE_NAME = "file.properties"; - private static final String IS_CERT_DEPLOYMENT_ENABLED = "isCertDeploymentEnabled"; private Properties globalProperties; public static final char URL_SEPARATOR_CHAR = '/'; @@ -64,7 +66,8 @@ public ConfigDeployer() { } @Override - public void deployArtifacts(CarbonApplication carbonApp, AxisConfiguration axisConfig) throws DeploymentException { + public void deployArtifacts(CarbonApplication carbonApp, AxisConfiguration axisConfig) + throws DeploymentException { if (log.isDebugEnabled()) { log.debug("Deploying properties - " + carbonApp.getAppName()); } @@ -77,15 +80,16 @@ public void deployArtifacts(CarbonApplication carbonApp, AxisConfiguration axisC artifacts.add(dep.getArtifact()); } } - deployConfigArtifacts(artifacts, carbonApp.getAppNameWithVersion()); + deployConfigArtifacts(artifacts); } @Override - public void undeployArtifacts(CarbonApplication carbonApp, AxisConfiguration axisConfig) throws DeploymentException { + public void undeployArtifacts(CarbonApplication carbonApp, AxisConfiguration axisConfig) + throws DeploymentException { } - private void deployConfigArtifacts(List artifacts, String parentAppName) { + private void deployConfigArtifacts(List artifacts) { artifacts.stream().filter(artifact -> PROPERTY_TYPE.equals(artifact.getType())).forEach(artifact -> { if (log.isDebugEnabled()) { log.debug("Deploying config artifact: " + artifact.getName()); @@ -102,14 +106,16 @@ private void writePropertyToMap(Artifact artifact) { Path globalPropertiesFilePath = confFolder.resolve(GLOBAL_CONFIG_FILE_NAME) ; Path serverConfPropertyPath = confFolder.resolve(LOCAL_CONFIG_FILE_NAME); String configFilePath = artifact.getExtractedPath() + File.separator + LOCAL_CONFIG_FILE_NAME; - processConfFile(configFilePath, globalPropertiesFilePath.toString(), serverConfPropertyPath.toString()); + processConfFile(artifact.getName(), configFilePath, globalPropertiesFilePath.toString(), + serverConfPropertyPath.toString()); } else { log.error("config/property type must have a single file which declares " + "config. But " + files.size() + " files found."); } } - public void processConfFile(String configFilePath, String globalPropertiesFilePath, String serverConfPropertyPath) { + private void processConfFile(String integrationName, String configFilePath, String globalPropertiesFilePath, + String serverConfPropertyPath) { File configFile = new File(configFilePath); // Load capp conf property file Properties configProperties = loadPropertiesFromFile(configFile); @@ -119,39 +125,32 @@ public void processConfFile(String configFilePath, String globalPropertiesFilePa Properties serverConfigProperties = loadPropertiesFromFile(new File(serverConfPropertyPath)); Properties newServerConfigProperties = new Properties(); - String isCertDeploymentEnabled = getValueOfKey(IS_CERT_DEPLOYMENT_ENABLED); - if (isCertDeploymentEnabled == null) { - isCertDeploymentEnabled = "true"; - } - PropertyHolder.getInstance().setProperty(IS_CERT_DEPLOYMENT_ENABLED, isCertDeploymentEnabled); if (serverConfigProperties.size() == 0 && configProperties.size() == 0 ) { - log.info("No configuration is used in the integration"); + if (log.isDebugEnabled()) { + log.debug(String.format("No configuration is used in the integration[%s]", integrationName)); + } } else { - if (serverConfigProperties.size() > 0) { - for (Map.Entry entry : serverConfigProperties.entrySet()) { - String key = entry.getKey().toString(); - String type = entry.getValue().toString(); - if (configProperties.containsKey(key)) { - type = configProperties.getProperty(key); - configProperties.remove(key); - } - newServerConfigProperties.setProperty(key, type); - processConfigProperties(key, type); + for (Map.Entry entry : serverConfigProperties.entrySet()) { + String key = entry.getKey().toString(); + String type = entry.getValue().toString(); + if (configProperties.containsKey(key)) { + type = configProperties.getProperty(key); + configProperties.remove(key); } + newServerConfigProperties.setProperty(key, type); + processConfigProperties(key, type); } - if (configProperties.size() > 0) { - for (Map.Entry entry : configProperties.entrySet()) { - String key = entry.getKey().toString(); - String type = entry.getValue().toString(); - newServerConfigProperties.setProperty(key, type); - processConfigProperties(key, type); - } + for (Map.Entry entry : configProperties.entrySet()) { + String key = entry.getKey().toString(); + String type = entry.getValue().toString(); + newServerConfigProperties.setProperty(key, type); + processConfigProperties(key, type); } writeServerConfFile(serverConfPropertyPath, newServerConfigProperties); } } - public void processConfigProperties(String key, String type) { + private void processConfigProperties(String key, String type) { String value = getValueOfKey(key); if (value != null) { if (Objects.equals(type, "cert")) { @@ -160,8 +159,8 @@ public void processConfigProperties(String key, String type) { if (PropertyHolder.getInstance().hasKey(key)) { String oldValue = PropertyHolder.getInstance().getPropertyValue(key); if (!Objects.equals(oldValue, value)) { - log.error(String.format("The value:[%s] of the key:[%s] has been " + - "replaced with the new value:[%s].", oldValue, key, value)); + log.info(String.format("The value of the key:[%s] has been " + + "replaced with the new value.", key)); } } PropertyHolder.getInstance().setProperty(key, value); @@ -170,39 +169,46 @@ public void processConfigProperties(String key, String type) { } } - public void deployCert(String key, String path) { - if (ResolverFactory.getInstance().getResolver("$config:" + IS_CERT_DEPLOYMENT_ENABLED).resolve(). - equals("true")) { - // Load the truststore properties - char[] password = SslSenderTrustStoreHolder.getInstance().getPassword().toCharArray(); - String type = SslSenderTrustStoreHolder.getInstance().getType(); - Path trustStorePath = Paths.get(getHome(), SslSenderTrustStoreHolder.getInstance().getLocation()); - try (FileInputStream trustStoreStream = new FileInputStream(trustStorePath.toFile())) { - KeyStore trustStore = KeyStore.getInstance(type); - trustStore.load(trustStoreStream, password); - if (!trustStore.containsAlias(key)) { - // Load the certificate file - CertificateFactory certFactory = CertificateFactory.getInstance("X.509"); - try (FileInputStream certStream = new FileInputStream(path)) { - Certificate cert = certFactory.generateCertificate(certStream); - // Add the certificate to the truststore - trustStore.setCertificateEntry(key, cert); - log.info("Certificate added with alias: " + key); - } - // Save the truststore with the new certificate - try (FileOutputStream outputStream = new FileOutputStream(trustStorePath.toFile())) { - trustStore.store(outputStream, password); - log.info("Truststore updated successfully at: " + trustStorePath); - } + private void deployCert(String key, String path) { + // Load the truststore properties + char[] password = SslSenderTrustStoreHolder.getInstance().getPassword().toCharArray(); + String type = SslSenderTrustStoreHolder.getInstance().getType(); + Path trustStorePath = Paths.get(getHome(), SslSenderTrustStoreHolder.getInstance().getLocation()); + try (FileInputStream trustStoreStream = new FileInputStream(trustStorePath.toFile())) { + KeyStore trustStore = KeyStore.getInstance(type); + trustStore.load(trustStoreStream, password); + if (!trustStore.containsAlias(key)) { + // Load the certificate file + CertificateFactory certFactory = CertificateFactory.getInstance("X.509"); + try (FileInputStream certStream = new FileInputStream(path)) { + Certificate cert = certFactory.generateCertificate(certStream); + // Add the certificate to the truststore + trustStore.setCertificateEntry(key, cert); + log.info("Certificate added with alias: " + key); + } + // Save the truststore with the new certificate + try (FileOutputStream outputStream = new FileOutputStream(trustStorePath.toFile())) { + trustStore.store(outputStream, password); + log.info("Truststore updated successfully at: " + trustStorePath); } - } catch (Exception e) { - e.printStackTrace(); - System.err.println("Failed to import certificate: " + e.getMessage()); + } else { + log.info(String.format("The trust store already contains a certificate " + + "with the alias [%s].", key)); } + } catch (FileNotFoundException e) { + log.error(String.format("File not found for importing the certificate: %s", key)); + } catch (IOException e) { + log.error(String.format("Certificate import failed: %s", key)); + } catch (CertificateException e) { + log.error(String.format("An error occurred while processing the certificate: %s", key)); + } catch (KeyStoreException e) { + log.error(String.format("An error occurred while processing the truststore: %s", key)); + } catch (NoSuchAlgorithmException e) { + log.error(String.format("An error occurred while loading the certificate: %s", key)); } } - public void writeServerConfFile(String file, Properties newServerConfigProperties) { + private void writeServerConfFile(String file, Properties newServerConfigProperties) { try (FileWriter writer = new FileWriter(file)) { Enumeration propertyNames = newServerConfigProperties.propertyNames(); while (propertyNames.hasMoreElements()) { @@ -211,17 +217,18 @@ public void writeServerConfFile(String file, Properties newServerConfigPropertie writer.write(key + ":" + value + "\n"); } } catch (IOException e) { - System.err.println("Failed to add the config.properties file to the server conf folder: " + e.getMessage()); + log.error("Failed to add the config.properties file to the server conf folder: " + + e.getMessage()); } } - public Properties loadPropertiesFromFile(File file) { + private Properties loadPropertiesFromFile(File file) { Properties properties = new Properties(); if (file.exists()) { try (FileInputStream serverConfigFileReader = new FileInputStream(file)) { properties.load(serverConfigFileReader); } catch (IOException e) { - log.debug("Error occurred while loading properties from file:" + e.getMessage()); + log.error("Error occurred while loading properties from file:" + e.getMessage()); } } return properties; @@ -238,7 +245,7 @@ private String getValueOfKey(String key) { return value; } - public String getHome() { + private String getHome() { String carbonHome = System.getProperty("carbon.home"); if (carbonHome == null || "".equals(carbonHome) || ".".equals(carbonHome)) { carbonHome = getSystemDependentPath(new File(".").getAbsolutePath()); @@ -246,7 +253,7 @@ public String getHome() { return carbonHome; } - public String getSystemDependentPath(String path) { + private String getSystemDependentPath(String path) { return path.replace(URL_SEPARATOR_CHAR, File.separatorChar); } } diff --git a/distribution/src/scripts/micro-integrator.sh b/distribution/src/scripts/micro-integrator.sh index 1a41b06ecf..853048427a 100644 --- a/distribution/src/scripts/micro-integrator.sh +++ b/distribution/src/scripts/micro-integrator.sh @@ -131,14 +131,20 @@ export_env_file() { # Read the .env file and export each variable to the environment while IFS='=' read -r key value; do - # Ignore lines starting with '#' (comments) or empty lines - if [ ! "$key" =~ ^# ] && [ "$key" != "" ]; then - # Trim surrounding whitespace from key and value - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # Export the key-value pair to the environment - export "$key=$value" - fi + # Ignore lines starting with '#' (comments) or empty lines + case "$key" in + \#*|"") + # Skip comments or empty lines + continue + ;; + *) + # Trim surrounding whitespace from key and value + key=$(echo "$key" | xargs) + value=$(echo "$value" | xargs) + # Export the key-value pair to the environment + export "$key=$value" + ;; + esac done < "$file_path" echo "Environment variables loaded from $file_path." @@ -168,14 +174,16 @@ do else args="$args $c" fi - echo "11111111111111111111111111 $c" # Check if the argument starts with --env-file= - if [ "$c" = "--env-file=*" ]; then - echo "_____________________ env file __________" - # Extract the file path from the argument + case "$c" in + --env-file=*) file_path="${c#--env-file=}" export_env_file "$file_path" - fi + ;; + *) + continue + ;; + esac done if [ "$ARGUMENT" = "car" ]; then diff --git a/integration/automation-extensions/src/main/java/org/wso2/esb/integration/common/extensions/carbonserver/CarbonServerManager.java b/integration/automation-extensions/src/main/java/org/wso2/esb/integration/common/extensions/carbonserver/CarbonServerManager.java index 57f3234d92..58efba38c5 100644 --- a/integration/automation-extensions/src/main/java/org/wso2/esb/integration/common/extensions/carbonserver/CarbonServerManager.java +++ b/integration/automation-extensions/src/main/java/org/wso2/esb/integration/common/extensions/carbonserver/CarbonServerManager.java @@ -40,9 +40,6 @@ import java.io.File; import java.io.IOException; import java.net.Socket; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; @@ -138,16 +135,6 @@ public synchronized void startServerUsingCarbonHome(String carbonHome, Map headers = new HashMap<>(); - URL endpoint = new URL(getApiInvocationURL("apiConfig/test")); + URL endpoint = new URL(getApiInvocationURL("apiConfig/test_api")); HttpResponse httpResponse = HttpRequestUtil.doGet(endpoint.toString(), headers); Assert.assertEquals(httpResponse.getResponseCode(), 200); Assert.assertEquals(StringUtils.normalizeSpace(httpResponse.getData()), @@ -65,7 +62,7 @@ public void testConfigurablePropertyWithSystemProperty() throws IOException, Aut commands.put("-Dmsg", "Hi"); serverConfigurationManager.restartMicroIntegrator(commands); Map headers = new HashMap<>(); - URL endpoint = new URL(getApiInvocationURL("apiConfig/test")); + URL endpoint = new URL(getApiInvocationURL("apiConfig/test_api")); HttpResponse httpResponse = HttpRequestUtil.doGet(endpoint.toString(), headers); Assert.assertEquals(httpResponse.getResponseCode(), 200); Assert.assertEquals(StringUtils.normalizeSpace(httpResponse.getData()), @@ -76,13 +73,10 @@ public void testConfigurablePropertyWithSystemProperty() throws IOException, Aut @Test(groups = {"wso2.esb"}, description = "Configurable property", priority = 3) public void testConfigurablePropertyWithEnvVariable() throws IOException, AutomationUtilException { Map commands = new HashMap<>(); - System.out.println("_________________________________"); - System.out.println(FrameworkPathUtil.getSystemResourceLocation() + "test.env"); - System.out.println("_________________________________"); commands.put("--env-file", FrameworkPathUtil.getSystemResourceLocation() + "test.env"); serverConfigurationManager.restartMicroIntegrator(commands); Map headers = new HashMap<>(); - URL endpoint = new URL(getApiInvocationURL("apiConfig/test")); + URL endpoint = new URL(getApiInvocationURL("apiConfig/test_api")); HttpResponse httpResponse = HttpRequestUtil.doGet(endpoint.toString(), headers); Assert.assertEquals(httpResponse.getResponseCode(), 200); Assert.assertEquals(StringUtils.normalizeSpace(httpResponse.getData()), @@ -96,18 +90,9 @@ public void testConfigurableProperty() throws IOException, AutomationUtilExcepti commands.put("-Dname", "sys"); commands.put("-Dmsg", "Hi"); commands.put("--env-file", FrameworkPathUtil.getSystemResourceLocation() + "test.env"); - File env = new File(FrameworkPathUtil.getSystemResourceLocation() + "test.env"); - if (env.exists()) { - System.out.println("________--env-file File Exist_____________"); - } - if (env.canRead()) { - System.out.println("________--env-file readable_____________"); - System.out.println(Files.readString(env.toPath(), StandardCharsets.UTF_8)); - } - serverConfigurationManager.restartMicroIntegrator(commands); Map headers = new HashMap<>(); - URL endpoint = new URL(getApiInvocationURL("apiConfig/test")); + URL endpoint = new URL(getApiInvocationURL("apiConfig/test_api")); HttpResponse httpResponse = HttpRequestUtil.doGet(endpoint.toString(), headers); Assert.assertEquals(httpResponse.getResponseCode(), 200); Assert.assertEquals(StringUtils.normalizeSpace(httpResponse.getData()), diff --git a/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/server/conf/file.properties b/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/server/conf/file.properties index 7237a1d57b..b8bcc0c574 100644 --- a/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/server/conf/file.properties +++ b/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/server/conf/file.properties @@ -16,6 +16,7 @@ # under the License. #/ +stockQuoteEP=http://localhost:9000/services/SimpleStockQuoteService common_url=http://localhost:8480/endpoint/file url=http://localhost:8480/endpoint/file endpoint_url=http://localhost:8290/endpoint/file diff --git a/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/server/repository/deployment/server/carbonapps/testApiWithConfigurationProperty_1.0.0.car b/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/server/repository/deployment/server/carbonapps/testApiWithConfigurationProperty_1.0.0.car index 3d02d1d3454c0de0410dfe320bfe02d87321ac2e..42705d73cffe7b12eed46218a76779c7c6e03c28 100644 GIT binary patch literal 3115 zcmWIWW@Zs#;Nak32-;H-$$$iSf$Ze`ytK^pctbq{Jp+Aah5&DN4v-2asImZ@n&r?n zLrl^uD9SHLEh@=OEk5mi#&@fhp601D-p^0z`n4M}f=pljb$Xf*P_H-;<2GFq-SkAD zk!gv^C3+RPIiY=fxtJ9NT7Fk^-Ly-;v@~G7*MnOVY#L^SirGvJb$a(UxlS>d*ZA|n z6)*R>6gsb)GP&*U4%Wt#PqmjWcvxhY_su{ub?3zG>pD}!uRJLFB=VrYdQz_L{xGp~ ztUK2#XcfiJD|+)((e%lokivI*8**nJx*e})_<^z|sl_Gni3OQtgtRoKcGS=?V$nQ)7x*<=kt_&Sl0ahorQ7TwH5bHsH$u#kl|Y}Vc8e1EfE!W^#5|YrQ3MV_^ZuR2?!G(Q z_b!}gysPoti@zry>m(9k+NKNq0qnYE#yVKl-X=tc9xgFzqi*SC+3-CrF(9W zX3dUo>lzktq)zEN(*FEuP6hMhgabRgJT+R6Ui#$_Ycf^IPgtSp`HN=P{`a>yEjChDXy(vP+xrg{Qn8-^|rNc*y#0{xPSijl?q21xs}w9cm2&-8duM=w_06uP7?F>>*fzM zeu-F=@$T7|v;JMe-D?`B*uO;Gn!5ROWw{`Gmcz;ywa;W?{}jJv(~?vk>TB!*6mCBeN-3}3NeqOrH@u;9~&CHi=n2pNTgEindSSOm>xm5I4Iv1c5)n+zn5ef(|L zS}|YjZkaKskk;axk<<2F^Dgeo9h&i8}BUAejse>9gq;hpEYk@ z3fcZC@QK>PN7m^1VrN=-@AUF~EAoq;wrqZJpuBh7*__DhpTf>&?s(q( z>VxE?3k#jZt)^c0-hbvto~P+z$LHa9()XN5zSN&5GU@YW$IkYaX|8i8h@B7z#Rpr0 z*{j(=Kb{3*-0`7HOei21nyG!exehr9xc;s=YE&!qR>y3%m*UzC*|roRv2RD;C_H-~ z%dGS$MEu>uI~V_6w*IPc&a92E?<}K8tL8bgHL`c|r~hKvd+|h)_#7A3FIO4^rU_1# zwdFjg!C~LE-DO+Ifjz7~GjHin@8quPUAN`A!jaD0Web-~4OD7g8DhCN!u?tP@_TR3 zw%vPK=B{BRd%tk#ExvI?uk2dn z#ziU%d!$cC8H=-a?GH$_d3xU=_2ZOv>i2inegS8@rcZOO9|ZcW1)S{|nM4>+n=G*Q z2*~%S0HpyF;Ek#kxv>Fiupj^^-=Jv4XuhDEg zY8W6u2GH;DoC;}>p=(C2UqQ_R1Xzx#8J{bV3wuR`DL_^Q&~a$4fN>F(GrGHwOHEJ> zfdD2fhyssLaDYlx1h8U7=+sBI5Tpziim2`{M%D&%IeH0;ZX9wc14IVS0 Cy#-wW literal 3852 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 L1bUJt4u1PD?flvX diff --git a/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/serviceCatalog/micro-integrator.sh b/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/serviceCatalog/micro-integrator.sh index 5d6633b92b..2d9b951789 100755 --- a/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/serviceCatalog/micro-integrator.sh +++ b/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/serviceCatalog/micro-integrator.sh @@ -131,14 +131,20 @@ export_env_file() { # Read the .env file and export each variable to the environment while IFS='=' read -r key value; do - # Ignore lines starting with '#' (comments) or empty lines - if [ ! "$key" =~ ^# ] && [ "$key" != "" ]; then - # Trim surrounding whitespace from key and value - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # Export the key-value pair to the environment - export "$key=$value" - fi + # Ignore lines starting with '#' (comments) or empty lines + case "$key" in + \#*|"") + # Skip comments or empty lines + continue + ;; + *) + # Trim surrounding whitespace from key and value + key=$(echo "$key" | xargs) + value=$(echo "$value" | xargs) + # Export the key-value pair to the environment + export "$key=$value" + ;; + esac done < "$file_path" echo "Environment variables loaded from $file_path." @@ -166,11 +172,15 @@ do args="$args $c" fi # Check if the argument starts with --env-file= - if [ "$c" == --env-file=* ]; then - # Extract the file path from the argument + case "$c" in + --env-file=*) file_path="${c#--env-file=}" export_env_file "$file_path" - fi + ;; + *) + continue + ;; + esac done if [ "$CMD" = "--debug" ]; then @@ -224,9 +234,10 @@ fi # ---------- Handle the SSL Issue with proper JDK version -------------------- java_version=$("$JAVACMD" -version 2>&1 | awk -F '"' '/version/ {print $2}') java_version_formatted=$(echo "$java_version" | awk -F. '{printf("%02d%02d",$1,$2);}') -if [ $java_version_formatted -lt 0107 ] || [ $java_version_formatted -gt 1100 ]; then +if [ $java_version_formatted -lt 1100 ] || [ $java_version_formatted -gt 2100 ]; then echo " Starting WSO2 MI (in unsupported JDK)" - echo " [ERROR] MI is supported only on JDK 1.8, 9, 10 and 11" + echo " [ERROR] WSO2 MI is supported only between JDK 11 and JDK 21" + exit 0 fi CARBON_XBOOTCLASSPATH="" diff --git a/integration/mediation-tests/tests-patches-with-smb2/src/test/resources/bin/integrator.sh b/integration/mediation-tests/tests-patches-with-smb2/src/test/resources/bin/integrator.sh index 2feff12c2f..5aeb5c0a4d 100755 --- a/integration/mediation-tests/tests-patches-with-smb2/src/test/resources/bin/integrator.sh +++ b/integration/mediation-tests/tests-patches-with-smb2/src/test/resources/bin/integrator.sh @@ -149,14 +149,20 @@ export_env_file() { # Read the .env file and export each variable to the environment while IFS='=' read -r key value; do - # Ignore lines starting with '#' (comments) or empty lines - if [ ! "$key" =~ ^# ] && [ "$key" != "" ]; then - # Trim surrounding whitespace from key and value - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # Export the key-value pair to the environment - export "$key=$value" - fi + # Ignore lines starting with '#' (comments) or empty lines + case "$key" in + \#*|"") + # Skip comments or empty lines + continue + ;; + *) + # Trim surrounding whitespace from key and value + key=$(echo "$key" | xargs) + value=$(echo "$value" | xargs) + # Export the key-value pair to the environment + export "$key=$value" + ;; + esac done < "$file_path" echo "Environment variables loaded from $file_path." @@ -186,11 +192,15 @@ do args="$args $c" fi # Check if the argument starts with --env-file= - if [ "$c" == --env-file=* ]; then - # Extract the file path from the argument + case "$c" in + --env-file=*) file_path="${c#--env-file=}" export_env_file "$file_path" - fi + ;; + *) + continue + ;; + esac done if [ "$CMD" = "--debug" ]; then diff --git a/integration/mediation-tests/tests-patches/src/test/resources/artifacts/ESB/passthru/transport/enableCorrelation/micro-integrator.sh b/integration/mediation-tests/tests-patches/src/test/resources/artifacts/ESB/passthru/transport/enableCorrelation/micro-integrator.sh index ade15eb339..0ad5ba74ee 100644 --- a/integration/mediation-tests/tests-patches/src/test/resources/artifacts/ESB/passthru/transport/enableCorrelation/micro-integrator.sh +++ b/integration/mediation-tests/tests-patches/src/test/resources/artifacts/ESB/passthru/transport/enableCorrelation/micro-integrator.sh @@ -131,14 +131,20 @@ export_env_file() { # Read the .env file and export each variable to the environment while IFS='=' read -r key value; do - # Ignore lines starting with '#' (comments) or empty lines - if [ ! "$key" =~ ^# ] && [ "$key" != "" ]; then - # Trim surrounding whitespace from key and value - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # Export the key-value pair to the environment - export "$key=$value" - fi + # Ignore lines starting with '#' (comments) or empty lines + case "$key" in + \#*|"") + # Skip comments or empty lines + continue + ;; + *) + # Trim surrounding whitespace from key and value + key=$(echo "$key" | xargs) + value=$(echo "$value" | xargs) + # Export the key-value pair to the environment + export "$key=$value" + ;; + esac done < "$file_path" echo "Environment variables loaded from $file_path." @@ -166,11 +172,15 @@ do args="$args $c" fi # Check if the argument starts with --env-file= - if [ "$c" == --env-file=* ]; then - # Extract the file path from the argument + case "$c" in + --env-file=*) file_path="${c#--env-file=}" export_env_file "$file_path" - fi + ;; + *) + continue + ;; + esac done if [ "$CMD" = "--debug" ]; then diff --git a/integration/mediation-tests/tests-patches/src/test/resources/artifacts/ESB/vfs/micro-integrator.sh b/integration/mediation-tests/tests-patches/src/test/resources/artifacts/ESB/vfs/micro-integrator.sh index 5e5dc6a4a1..bfa2908c4b 100755 --- a/integration/mediation-tests/tests-patches/src/test/resources/artifacts/ESB/vfs/micro-integrator.sh +++ b/integration/mediation-tests/tests-patches/src/test/resources/artifacts/ESB/vfs/micro-integrator.sh @@ -131,14 +131,20 @@ export_env_file() { # Read the .env file and export each variable to the environment while IFS='=' read -r key value; do - # Ignore lines starting with '#' (comments) or empty lines - if [ ! "$key" =~ ^# ] && [ "$key" != "" ]; then - # Trim surrounding whitespace from key and value - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # Export the key-value pair to the environment - export "$key=$value" - fi + # Ignore lines starting with '#' (comments) or empty lines + case "$key" in + \#*|"") + # Skip comments or empty lines + continue + ;; + *) + # Trim surrounding whitespace from key and value + key=$(echo "$key" | xargs) + value=$(echo "$value" | xargs) + # Export the key-value pair to the environment + export "$key=$value" + ;; + esac done < "$file_path" echo "Environment variables loaded from $file_path." @@ -169,11 +175,15 @@ do args="$args $c" fi # Check if the argument starts with --env-file= - if [ "$c" == --env-file=* ]; then - # Extract the file path from the argument + case "$c" in + --env-file=*) file_path="${c#--env-file=}" export_env_file "$file_path" - fi + ;; + *) + continue + ;; + esac done if [ "$ARGUMENT" = "car" ]; then diff --git a/integration/mediation-tests/tests-patches/src/test/resources/bin/integrator.sh b/integration/mediation-tests/tests-patches/src/test/resources/bin/integrator.sh index 12e6ed5c95..a64b37ca1c 100755 --- a/integration/mediation-tests/tests-patches/src/test/resources/bin/integrator.sh +++ b/integration/mediation-tests/tests-patches/src/test/resources/bin/integrator.sh @@ -148,14 +148,20 @@ export_env_file() { # Read the .env file and export each variable to the environment while IFS='=' read -r key value; do - # Ignore lines starting with '#' (comments) or empty lines - if [ ! "$key" =~ ^# ] && [ "$key" != "" ]; then - # Trim surrounding whitespace from key and value - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # Export the key-value pair to the environment - export "$key=$value" - fi + # Ignore lines starting with '#' (comments) or empty lines + case "$key" in + \#*|"") + # Skip comments or empty lines + continue + ;; + *) + # Trim surrounding whitespace from key and value + key=$(echo "$key" | xargs) + value=$(echo "$value" | xargs) + # Export the key-value pair to the environment + export "$key=$value" + ;; + esac done < "$file_path" echo "Environment variables loaded from $file_path." @@ -185,11 +191,15 @@ do args="$args $c" fi # Check if the argument starts with --env-file= - if [ "$c" == --env-file=* ]; then - # Extract the file path from the argument + case "$c" in + --env-file=*) file_path="${c#--env-file=}" export_env_file "$file_path" - fi + ;; + *) + continue + ;; + esac done if [ "$CMD" = "--debug" ]; then diff --git a/integration/mediation-tests/tests-platform/tests-rabbitmq/src/test/resources/bin/integrator.sh b/integration/mediation-tests/tests-platform/tests-rabbitmq/src/test/resources/bin/integrator.sh index 2feff12c2f..5aeb5c0a4d 100755 --- a/integration/mediation-tests/tests-platform/tests-rabbitmq/src/test/resources/bin/integrator.sh +++ b/integration/mediation-tests/tests-platform/tests-rabbitmq/src/test/resources/bin/integrator.sh @@ -149,14 +149,20 @@ export_env_file() { # Read the .env file and export each variable to the environment while IFS='=' read -r key value; do - # Ignore lines starting with '#' (comments) or empty lines - if [ ! "$key" =~ ^# ] && [ "$key" != "" ]; then - # Trim surrounding whitespace from key and value - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # Export the key-value pair to the environment - export "$key=$value" - fi + # Ignore lines starting with '#' (comments) or empty lines + case "$key" in + \#*|"") + # Skip comments or empty lines + continue + ;; + *) + # Trim surrounding whitespace from key and value + key=$(echo "$key" | xargs) + value=$(echo "$value" | xargs) + # Export the key-value pair to the environment + export "$key=$value" + ;; + esac done < "$file_path" echo "Environment variables loaded from $file_path." @@ -186,11 +192,15 @@ do args="$args $c" fi # Check if the argument starts with --env-file= - if [ "$c" == --env-file=* ]; then - # Extract the file path from the argument + case "$c" in + --env-file=*) file_path="${c#--env-file=}" export_env_file "$file_path" - fi + ;; + *) + continue + ;; + esac done if [ "$CMD" = "--debug" ]; then diff --git a/integration/mediation-tests/tests-platform/tests-userstore/src/test/resources/artifacts/ESB/server/bin/micro-integrator.sh b/integration/mediation-tests/tests-platform/tests-userstore/src/test/resources/artifacts/ESB/server/bin/micro-integrator.sh index 225cf1b21e..b8800d84eb 100755 --- a/integration/mediation-tests/tests-platform/tests-userstore/src/test/resources/artifacts/ESB/server/bin/micro-integrator.sh +++ b/integration/mediation-tests/tests-platform/tests-userstore/src/test/resources/artifacts/ESB/server/bin/micro-integrator.sh @@ -130,14 +130,20 @@ export_env_file() { # Read the .env file and export each variable to the environment while IFS='=' read -r key value; do - # Ignore lines starting with '#' (comments) or empty lines - if [ ! "$key" =~ ^# ] && [ "$key" != "" ]; then - # Trim surrounding whitespace from key and value - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # Export the key-value pair to the environment - export "$key=$value" - fi + # Ignore lines starting with '#' (comments) or empty lines + case "$key" in + \#*|"") + # Skip comments or empty lines + continue + ;; + *) + # Trim surrounding whitespace from key and value + key=$(echo "$key" | xargs) + value=$(echo "$value" | xargs) + # Export the key-value pair to the environment + export "$key=$value" + ;; + esac done < "$file_path" echo "Environment variables loaded from $file_path." @@ -165,11 +171,15 @@ do args="$args $c" fi # Check if the argument starts with --env-file= - if [ "$c" == --env-file=* ]; then - # Extract the file path from the argument + case "$c" in + --env-file=*) file_path="${c#--env-file=}" export_env_file "$file_path" - fi + ;; + *) + continue + ;; + esac done if [ "$CMD" = "--debug" ]; then @@ -223,9 +233,10 @@ fi # ---------- Handle the SSL Issue with proper JDK version -------------------- java_version=$("$JAVACMD" -version 2>&1 | awk -F '"' '/version/ {print $2}') java_version_formatted=$(echo "$java_version" | awk -F. '{printf("%02d%02d",$1,$2);}') -if [ $java_version_formatted -lt 0107 ] || [ $java_version_formatted -gt 1100 ]; then +if [ $java_version_formatted -lt 1100 ] || [ $java_version_formatted -gt 2100 ]; then echo " Starting WSO2 MI (in unsupported JDK)" - echo " [ERROR] MI is supported only on JDK 1.8, 9, 10 and 11" + echo " [ERROR] WSO2 MI is supported only between JDK 11 and JDK 21" + exit 0 fi CARBON_XBOOTCLASSPATH="" diff --git a/integration/mediation-tests/tests-platform/tests-wso2mb/src/test/resources/bin/integrator.sh b/integration/mediation-tests/tests-platform/tests-wso2mb/src/test/resources/bin/integrator.sh index 2feff12c2f..5aeb5c0a4d 100755 --- a/integration/mediation-tests/tests-platform/tests-wso2mb/src/test/resources/bin/integrator.sh +++ b/integration/mediation-tests/tests-platform/tests-wso2mb/src/test/resources/bin/integrator.sh @@ -149,14 +149,20 @@ export_env_file() { # Read the .env file and export each variable to the environment while IFS='=' read -r key value; do - # Ignore lines starting with '#' (comments) or empty lines - if [ ! "$key" =~ ^# ] && [ "$key" != "" ]; then - # Trim surrounding whitespace from key and value - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # Export the key-value pair to the environment - export "$key=$value" - fi + # Ignore lines starting with '#' (comments) or empty lines + case "$key" in + \#*|"") + # Skip comments or empty lines + continue + ;; + *) + # Trim surrounding whitespace from key and value + key=$(echo "$key" | xargs) + value=$(echo "$value" | xargs) + # Export the key-value pair to the environment + export "$key=$value" + ;; + esac done < "$file_path" echo "Environment variables loaded from $file_path." @@ -186,11 +192,15 @@ do args="$args $c" fi # Check if the argument starts with --env-file= - if [ "$c" == --env-file=* ]; then - # Extract the file path from the argument + case "$c" in + --env-file=*) file_path="${c#--env-file=}" export_env_file "$file_path" - fi + ;; + *) + continue + ;; + esac done if [ "$CMD" = "--debug" ]; then diff --git a/integration/mediation-tests/tests-sample/src/test/resources/bin/integrator.sh b/integration/mediation-tests/tests-sample/src/test/resources/bin/integrator.sh index 12e6ed5c95..a64b37ca1c 100755 --- a/integration/mediation-tests/tests-sample/src/test/resources/bin/integrator.sh +++ b/integration/mediation-tests/tests-sample/src/test/resources/bin/integrator.sh @@ -148,14 +148,20 @@ export_env_file() { # Read the .env file and export each variable to the environment while IFS='=' read -r key value; do - # Ignore lines starting with '#' (comments) or empty lines - if [ ! "$key" =~ ^# ] && [ "$key" != "" ]; then - # Trim surrounding whitespace from key and value - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # Export the key-value pair to the environment - export "$key=$value" - fi + # Ignore lines starting with '#' (comments) or empty lines + case "$key" in + \#*|"") + # Skip comments or empty lines + continue + ;; + *) + # Trim surrounding whitespace from key and value + key=$(echo "$key" | xargs) + value=$(echo "$value" | xargs) + # Export the key-value pair to the environment + export "$key=$value" + ;; + esac done < "$file_path" echo "Environment variables loaded from $file_path." @@ -185,11 +191,15 @@ do args="$args $c" fi # Check if the argument starts with --env-file= - if [ "$c" == --env-file=* ]; then - # Extract the file path from the argument + case "$c" in + --env-file=*) file_path="${c#--env-file=}" export_env_file "$file_path" - fi + ;; + *) + continue + ;; + esac done if [ "$CMD" = "--debug" ]; then diff --git a/integration/mediation-tests/tests-service/src/test/resources/bin/integrator.sh b/integration/mediation-tests/tests-service/src/test/resources/bin/integrator.sh index 2feff12c2f..5aeb5c0a4d 100755 --- a/integration/mediation-tests/tests-service/src/test/resources/bin/integrator.sh +++ b/integration/mediation-tests/tests-service/src/test/resources/bin/integrator.sh @@ -149,14 +149,20 @@ export_env_file() { # Read the .env file and export each variable to the environment while IFS='=' read -r key value; do - # Ignore lines starting with '#' (comments) or empty lines - if [ ! "$key" =~ ^# ] && [ "$key" != "" ]; then - # Trim surrounding whitespace from key and value - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # Export the key-value pair to the environment - export "$key=$value" - fi + # Ignore lines starting with '#' (comments) or empty lines + case "$key" in + \#*|"") + # Skip comments or empty lines + continue + ;; + *) + # Trim surrounding whitespace from key and value + key=$(echo "$key" | xargs) + value=$(echo "$value" | xargs) + # Export the key-value pair to the environment + export "$key=$value" + ;; + esac done < "$file_path" echo "Environment variables loaded from $file_path." @@ -186,11 +192,15 @@ do args="$args $c" fi # Check if the argument starts with --env-file= - if [ "$c" == --env-file=* ]; then - # Extract the file path from the argument + case "$c" in + --env-file=*) file_path="${c#--env-file=}" export_env_file "$file_path" - fi + ;; + *) + continue + ;; + esac done if [ "$CMD" = "--debug" ]; then diff --git a/integration/mediation-tests/tests-transport/src/test/resources/bin/integrator.sh b/integration/mediation-tests/tests-transport/src/test/resources/bin/integrator.sh index 2feff12c2f..5aeb5c0a4d 100755 --- a/integration/mediation-tests/tests-transport/src/test/resources/bin/integrator.sh +++ b/integration/mediation-tests/tests-transport/src/test/resources/bin/integrator.sh @@ -149,14 +149,20 @@ export_env_file() { # Read the .env file and export each variable to the environment while IFS='=' read -r key value; do - # Ignore lines starting with '#' (comments) or empty lines - if [ ! "$key" =~ ^# ] && [ "$key" != "" ]; then - # Trim surrounding whitespace from key and value - key=$(echo "$key" | xargs) - value=$(echo "$value" | xargs) - # Export the key-value pair to the environment - export "$key=$value" - fi + # Ignore lines starting with '#' (comments) or empty lines + case "$key" in + \#*|"") + # Skip comments or empty lines + continue + ;; + *) + # Trim surrounding whitespace from key and value + key=$(echo "$key" | xargs) + value=$(echo "$value" | xargs) + # Export the key-value pair to the environment + export "$key=$value" + ;; + esac done < "$file_path" echo "Environment variables loaded from $file_path." @@ -186,11 +192,15 @@ do args="$args $c" fi # Check if the argument starts with --env-file= - if [ "$c" == --env-file=* ]; then - # Extract the file path from the argument + case "$c" in + --env-file=*) file_path="${c#--env-file=}" export_env_file "$file_path" - fi + ;; + *) + continue + ;; + esac done if [ "$CMD" = "--debug" ]; then