diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 079ba78efc..0ebbb9b7a6 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -81,6 +81,26 @@ echo "Registering/testing the configuration workflow ${TEST_HLQ}.WORKFLOW(ZWECON sh scripts/wf_run_test.sh "${TEST_HLQ}.WORKFLOW(ZWECONF)" if [ $? -gt 0 ];then exit -1;fi -echo "Registering/testing the configuration workflow ${TEST_MOUNT}/content/files/workflows/ZWECONF.xml" -sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" +echo "Changing runtime path in ${TEST_MOUNT}/files/workflows/ZWECONF.properties." + +echo ${JOBST1} > JCL +echo ${JOBST2} >> JCL +echo "//COPYWRFS EXEC PGM=BPXBATCH" >> JCL +echo "//STDOUT DD SYSOUT=*" >> JCL +echo "//STDERR DD SYSOUT=*" >> JCL +echo "//STDPARM DD *" >> JCL +echo "SH set -x;set -e;" >> JCL +echo "cd ${WORK_MOUNT};" >> JCL +echo "source=\"${ZOWE_MOUNT}files/workflows/ZWECONF.properties\";" >> JCL +echo "runtime=\"${WORK_MOUNT}\";" >> JCL +echo "sed 's|zowe_runtimeDirectory=|zowe_runtimeDirectory=\$runtime|g' \$source > _ZWECONF;" >> JCL +echo "cp -T _ZWECONF \$source;" >> JCL +echo "cat \$source | grep -o \'\"runtimeDirectory\"\';" +echo "/*" >> JCL + +echo "Testing the configuration workflow ${TEST_MOUNT}/files/workflows/ZWECONF.xml" +sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" "${TEST_MOUNT}/files/workflows/ZWECONF.properties" "run" if [ $? -gt 0 ];then exit -1;fi + +#TODO: download yaml +#TODO: locate local yaml diff --git a/pswi/scripts/wf_run_test.sh b/pswi/scripts/wf_run_test.sh index 5987aeef41..5b72703fb3 100755 --- a/pswi/scripts/wf_run_test.sh +++ b/pswi/scripts/wf_run_test.sh @@ -3,7 +3,8 @@ export BASE_URL="${ZOSMF_URL}:${ZOSMF_PORT}" WF_DEF_FILE=$1 -run=$2 +INPUT_FILE=$2 +run=$3 echo "" echo "" @@ -19,13 +20,21 @@ CREATE_WF_URL="${BASE_URL}/zosmf/workflow/rest/1.0/workflows" WF_LIST_URL="${BASE_URL}/zosmf/workflow/rest/1.0/workflows?owner=${ZOSMF_USER}&workflowName=${WF_NAME}" # JSONs - +if [ -n "$INPUT_FILE" ] +then ADD_WORKFLOW_JSON='{"workflowName":"'$WF_NAME'", "workflowDefinitionFile":"'${WF_DEF_FILE}'", +"variableInputFile":"'${INPUT_FILE}'", "system":"'$ZOSMF_SYSTEM'", "owner":"'$ZOSMF_USER'", "assignToOwner" :true}' - +else +ADD_WORKFLOW_JSON='{"workflowName":"'$WF_NAME'", +"workflowDefinitionFile":"'${WF_DEF_FILE}'", +"system":"'$ZOSMF_SYSTEM'", +"owner":"'$ZOSMF_USER'", +"assignToOwner" :true}' +fi # Get workflowKey for the workflow owned by user echo "Get workflowKey for the workflow if it exists."