Skip to content

Commit

Permalink
test for workflow now includes parameter that can work with input files
Browse files Browse the repository at this point in the history
doing sed of properties file via JCL

Signed-off-by: mm667937 <[email protected]>
  • Loading branch information
muzikovam committed Aug 29, 2024
1 parent 75c0629 commit 9b27294
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
24 changes: 22 additions & 2 deletions pswi/05_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 12 additions & 3 deletions pswi/scripts/wf_run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

export BASE_URL="${ZOSMF_URL}:${ZOSMF_PORT}"
WF_DEF_FILE=$1
run=$2
INPUT_FILE=$2
run=$3

echo ""
echo ""
Expand All @@ -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."

Expand Down

0 comments on commit 9b27294

Please sign in to comment.