From 9b27294e06a450f0f8e81d4b87932cfce6eeb2f2 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Thu, 29 Aug 2024 14:12:26 +0200 Subject: [PATCH 01/54] test for workflow now includes parameter that can work with input files doing sed of properties file via JCL Signed-off-by: mm667937 --- pswi/05_test.sh | 24 ++++++++++++++++++++++-- pswi/scripts/wf_run_test.sh | 15 ++++++++++++--- 2 files changed, 34 insertions(+), 5 deletions(-) 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." From d800efcfe3fd0d003cf8d189750cee57d7731861 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Thu, 29 Aug 2024 15:11:56 +0200 Subject: [PATCH 02/54] forgot to submit the JCL so the value for runtime directory was not valid Signed-off-by: mm667937 --- pswi/05_test.sh | 6 +++++- pswi/scripts/wf_run_test.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 0ebbb9b7a6..ae1b2394da 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -95,8 +95,12 @@ 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 "cat \$source | grep -o \'\"runtimeDirectory\"\';" >> JCL echo "/*" >> JCL +# If this does not work, sed locally and upload input file +sh scripts/submit_jcl.sh "`cat JCL`" +if [ $? -gt 0 ];then exit -1;fi +rm 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" diff --git a/pswi/scripts/wf_run_test.sh b/pswi/scripts/wf_run_test.sh index 5b72703fb3..a6e254a9f5 100755 --- a/pswi/scripts/wf_run_test.sh +++ b/pswi/scripts/wf_run_test.sh @@ -8,7 +8,7 @@ run=$3 echo "" echo "" -echo "Script for testing workflow and if specified running with defaults as well..." +echo "Script for testing workflow and if specified running with defaults/variable input file as well..." echo "Host :" $ZOSMF_URL echo "Port :" $ZOSMF_PORT echo "z/OSMF system :" $ZOSMF_SYSTEM From 5eeb78aa4a239362d95ddcbc141068c4969e2d29 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Thu, 29 Aug 2024 16:02:18 +0200 Subject: [PATCH 03/54] line too long in JCL Signed-off-by: mm667937 --- pswi/05_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index ae1b2394da..46ca0ba7ed 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -93,8 +93,8 @@ 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 "sed 's|runtimeDirectory=|runtimeDirectory=\$runtime|g' \$source > _ZWECONF;" >> JCL +echo "mv _ZWECONF \$source;" >> JCL echo "cat \$source | grep -o \'\"runtimeDirectory\"\';" >> JCL echo "/*" >> JCL # If this does not work, sed locally and upload input file From aa0f53a89b4f16aca51679b91502f7909d656a9e Mon Sep 17 00:00:00 2001 From: mm667937 Date: Thu, 29 Aug 2024 16:59:52 +0200 Subject: [PATCH 04/54] wrong path Signed-off-by: mm667937 --- pswi/05_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 46ca0ba7ed..a0861d6912 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -91,7 +91,7 @@ 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 "source=\"${TEST_MOUNT}files/workflows/ZWECONF.properties\";" >> JCL echo "runtime=\"${WORK_MOUNT}\";" >> JCL echo "sed 's|runtimeDirectory=|runtimeDirectory=\$runtime|g' \$source > _ZWECONF;" >> JCL echo "mv _ZWECONF \$source;" >> JCL From e9377c9d5e632aa52e6f5162871fe15f873f214c Mon Sep 17 00:00:00 2001 From: mm667937 Date: Fri, 30 Aug 2024 09:05:22 +0200 Subject: [PATCH 05/54] missing slash Signed-off-by: mm667937 --- pswi/05_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index a0861d6912..b415014416 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -91,7 +91,7 @@ echo "//STDERR DD SYSOUT=*" >> JCL echo "//STDPARM DD *" >> JCL echo "SH set -x;set -e;" >> JCL echo "cd ${WORK_MOUNT};" >> JCL -echo "source=\"${TEST_MOUNT}files/workflows/ZWECONF.properties\";" >> JCL +echo "source=\"${TEST_MOUNT}/files/workflows/ZWECONF.properties\";" >> JCL echo "runtime=\"${WORK_MOUNT}\";" >> JCL echo "sed 's|runtimeDirectory=|runtimeDirectory=\$runtime|g' \$source > _ZWECONF;" >> JCL echo "mv _ZWECONF \$source;" >> JCL From 1f0e976329639814b108b18c0b5792664d6d72b1 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Fri, 30 Aug 2024 10:07:31 +0200 Subject: [PATCH 06/54] using _ZWECONF as variable input file Signed-off-by: mm667937 --- pswi/05_test.sh | 7 +++---- pswi/scripts/wf_run_test.sh | 7 ++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index b415014416..0c06831b0c 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -93,9 +93,8 @@ echo "SH set -x;set -e;" >> JCL echo "cd ${WORK_MOUNT};" >> JCL echo "source=\"${TEST_MOUNT}/files/workflows/ZWECONF.properties\";" >> JCL echo "runtime=\"${WORK_MOUNT}\";" >> JCL -echo "sed 's|runtimeDirectory=|runtimeDirectory=\$runtime|g' \$source > _ZWECONF;" >> JCL -echo "mv _ZWECONF \$source;" >> JCL -echo "cat \$source | grep -o \'\"runtimeDirectory\"\';" >> JCL +echo "sed 's|runtimeDirectory=|runtimeDirectory=\$runtime|g' \$source > _ZWECONF;" >> JCL +echo "cat _ZWECONF | grep -o \'\"runtimeDirectory\"\';" >> JCL echo "/*" >> JCL # If this does not work, sed locally and upload input file sh scripts/submit_jcl.sh "`cat JCL`" @@ -103,7 +102,7 @@ if [ $? -gt 0 ];then exit -1;fi rm 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" +sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" "run" "${WORK_MOUNT}/_ZWECONF" if [ $? -gt 0 ];then exit -1;fi #TODO: download yaml diff --git a/pswi/scripts/wf_run_test.sh b/pswi/scripts/wf_run_test.sh index a6e254a9f5..392598e3a5 100755 --- a/pswi/scripts/wf_run_test.sh +++ b/pswi/scripts/wf_run_test.sh @@ -3,8 +3,8 @@ export BASE_URL="${ZOSMF_URL}:${ZOSMF_PORT}" WF_DEF_FILE=$1 -INPUT_FILE=$2 -run=$3 +run=$2 +INPUT_FILE=$3 echo "" echo "" @@ -13,6 +13,7 @@ echo "Host :" $ZOSMF_URL echo "Port :" $ZOSMF_PORT echo "z/OSMF system :" $ZOSMF_SYSTEM echo "Workflow definition file :" $WF_DEF_FILE +echo "Variable Input file :" $INPUT_FILE WF_NAME="Testing workflows" # URLs @@ -60,7 +61,7 @@ if [ $? -gt 0 ];then exit -1;fi WFKEY=`echo $RESP | grep -o '"workflowKey":".*"' | cut -f4 -d\"` WORKFLOW_URL="${CREATE_WF_URL}/${WFKEY}" -if [ -n "${run}" ] +if [ "$run" = "run" ] then # Run workflow echo "Invoking REST API to start the workflow." From 1999ea25e782fb7d485a7b608c83e4fef3032390 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Fri, 30 Aug 2024 11:08:34 +0200 Subject: [PATCH 07/54] running sed locally and uploading the _ZWECONF input file via sftp Signed-off-by: mm667937 --- pswi/05_test.sh | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 0c06831b0c..771cc43f7a 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -81,25 +81,16 @@ 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 "Changing runtime path in ${TEST_MOUNT}/files/workflows/ZWECONF.properties." +echo "Changing runtime path in 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=\"${TEST_MOUNT}/files/workflows/ZWECONF.properties\";" >> JCL -echo "runtime=\"${WORK_MOUNT}\";" >> JCL -echo "sed 's|runtimeDirectory=|runtimeDirectory=\$runtime|g' \$source > _ZWECONF;" >> JCL -echo "cat _ZWECONF | grep -o \'\"runtimeDirectory\"\';" >> JCL -echo "/*" >> JCL -# If this does not work, sed locally and upload input file -sh scripts/submit_jcl.sh "`cat JCL`" -if [ $? -gt 0 ];then exit -1;fi -rm JCL +cp ../workflows/files/ZWECONF.properties ./ZWECONF.properties +sed "s|runtimeDirectory=|runtimeDirectory=${WORK_MOUNT}|g" ./ZWECONF.properties > _ZWECONF +cat _ZWECONF | grep -o 'runtimeDirectory' + +sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF +cd ${WORK_MOUNT} +put _ZWECONF +EOF echo "Testing the configuration workflow ${TEST_MOUNT}/files/workflows/ZWECONF.xml" sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" "run" "${WORK_MOUNT}/_ZWECONF" From 48d2d9791dd01728c738b46868e78ac5dcc9ef76 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Fri, 30 Aug 2024 13:43:47 +0200 Subject: [PATCH 08/54] workflow had step that wasnt automated Signed-off-by: mm667937 --- pswi/05_test.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 771cc43f7a..39ce8bc666 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -81,19 +81,29 @@ 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}/files/workflows/ZWECONF.xml" +sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" "run" "${WORK_MOUNT}/_ZWECONF" +if [ $? -gt 0 ];then exit -1;fi + echo "Changing runtime path in ZWECONF.properties." cp ../workflows/files/ZWECONF.properties ./ZWECONF.properties sed "s|runtimeDirectory=|runtimeDirectory=${WORK_MOUNT}|g" ./ZWECONF.properties > _ZWECONF cat _ZWECONF | grep -o 'runtimeDirectory' +echo "Changing the configuration workflow to be fully automated." + +cp ../workflows/files/ZWECONF.xml ./ZWECONF.xml +sed "s|false|true|g" ./ZWECONF.xml > ZWECONFX + sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF cd ${WORK_MOUNT} put _ZWECONF +put ZWECONFX EOF -echo "Testing the configuration workflow ${TEST_MOUNT}/files/workflows/ZWECONF.xml" -sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" "run" "${WORK_MOUNT}/_ZWECONF" +echo "Testing the configuration workflow ${WORK_MOUNT}/ZWECONFX" +sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "${WORK_MOUNT}/_ZWECONF" if [ $? -gt 0 ];then exit -1;fi #TODO: download yaml From 9f85111d28283fba6c630535c08cecc387b6cf59 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Fri, 30 Aug 2024 15:20:05 +0200 Subject: [PATCH 09/54] wrong copy paste Signed-off-by: mm667937 --- pswi/05_test.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 39ce8bc666..e3ee565e8c 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -82,14 +82,13 @@ 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}/files/workflows/ZWECONF.xml" -sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" "run" "${WORK_MOUNT}/_ZWECONF" +sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" if [ $? -gt 0 ];then exit -1;fi echo "Changing runtime path in ZWECONF.properties." cp ../workflows/files/ZWECONF.properties ./ZWECONF.properties sed "s|runtimeDirectory=|runtimeDirectory=${WORK_MOUNT}|g" ./ZWECONF.properties > _ZWECONF -cat _ZWECONF | grep -o 'runtimeDirectory' echo "Changing the configuration workflow to be fully automated." From bdf61998a58de1bf03c2232d6a64ade79bde0b9b Mon Sep 17 00:00:00 2001 From: mm667937 Date: Fri, 30 Aug 2024 16:14:15 +0200 Subject: [PATCH 10/54] more requred variables Signed-off-by: mm667937 --- pswi/05_test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index e3ee565e8c..3b091c6a94 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -89,6 +89,9 @@ echo "Changing runtime path in ZWECONF.properties." cp ../workflows/files/ZWECONF.properties ./ZWECONF.properties sed "s|runtimeDirectory=|runtimeDirectory=${WORK_MOUNT}|g" ./ZWECONF.properties > _ZWECONF +sed "s|java_home=|java_home=#delete_me#|g" _ZWECONF > ZWECONF +sed "s|node_home=|node_home=#delete_me#|g" ZWECONF > _ZWECONF +#TODO:delete java home and node home from the yaml because it is not set in the example-zowe.yml echo "Changing the configuration workflow to be fully automated." From bdb3fd15fcff271c06916eed8bddbeae8fc0d224 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Mon, 2 Sep 2024 09:20:32 +0200 Subject: [PATCH 11/54] workflow is not being deleted Signed-off-by: mm667937 --- pswi/scripts/wf_run_test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pswi/scripts/wf_run_test.sh b/pswi/scripts/wf_run_test.sh index 392598e3a5..53dd5baa35 100755 --- a/pswi/scripts/wf_run_test.sh +++ b/pswi/scripts/wf_run_test.sh @@ -36,6 +36,8 @@ ADD_WORKFLOW_JSON='{"workflowName":"'$WF_NAME'", "owner":"'$ZOSMF_USER'", "assignToOwner" :true}' fi + +set -x # Get workflowKey for the workflow owned by user echo "Get workflowKey for the workflow if it exists." @@ -51,7 +53,7 @@ RESP=`curl -s $WORKFLOW_URL -k -X "DELETE" -H "Content-Type: application/json" - sh scripts/check_response.sh "${RESP}" $? fi -set -ex +set -e # Create workflow with REST API echo 'Invoking REST API to create the workflow.' From a661c865bae614ec0a89a41b3480205db3902ed1 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Mon, 2 Sep 2024 10:15:31 +0200 Subject: [PATCH 12/54] workflow had name that was causing problems in the "list workflows" part Signed-off-by: mm667937 --- pswi/scripts/wf_run_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pswi/scripts/wf_run_test.sh b/pswi/scripts/wf_run_test.sh index 53dd5baa35..c70c407d21 100755 --- a/pswi/scripts/wf_run_test.sh +++ b/pswi/scripts/wf_run_test.sh @@ -15,7 +15,7 @@ echo "z/OSMF system :" $ZOSMF_SYSTEM echo "Workflow definition file :" $WF_DEF_FILE echo "Variable Input file :" $INPUT_FILE -WF_NAME="Testing workflows" +WF_NAME="Testing_workflows" # URLs 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}" From 448ef9806254824c5d56cba71eb3d1bb8e440ca6 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Mon, 2 Sep 2024 13:08:53 +0200 Subject: [PATCH 13/54] another variable needed download final zowe.yaml Signed-off-by: mm667937 --- pswi/05_test.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 3b091c6a94..3f5c80f4c9 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -91,6 +91,7 @@ cp ../workflows/files/ZWECONF.properties ./ZWECONF.properties sed "s|runtimeDirectory=|runtimeDirectory=${WORK_MOUNT}|g" ./ZWECONF.properties > _ZWECONF sed "s|java_home=|java_home=#delete_me#|g" _ZWECONF > ZWECONF sed "s|node_home=|node_home=#delete_me#|g" ZWECONF > _ZWECONF +sed "s|storage_vsam_name=|storage_vsam_name=#delete_me#|g" _ZWECONF > ZWECONF #TODO:delete java home and node home from the yaml because it is not set in the example-zowe.yml echo "Changing the configuration workflow to be fully automated." @@ -100,7 +101,7 @@ sed "s|false|true|g" ./ZWECONF.xml > ZWECONFX sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF cd ${WORK_MOUNT} -put _ZWECONF +put ZWECONF put ZWECONFX EOF @@ -108,5 +109,11 @@ echo "Testing the configuration workflow ${WORK_MOUNT}/ZWECONFX" sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "${WORK_MOUNT}/_ZWECONF" if [ $? -gt 0 ];then exit -1;fi +sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF +cd ${WORK_MOUNT} +get zowe.yaml +EOF + +cat zowe.yaml #TODO: download yaml #TODO: locate local yaml From 9b1b94624786e22cd6466284422a8ab9ff380e3c Mon Sep 17 00:00:00 2001 From: mm667937 Date: Mon, 2 Sep 2024 13:59:14 +0200 Subject: [PATCH 14/54] wrong vif name Signed-off-by: mm667937 --- pswi/05_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 3f5c80f4c9..92e88e6c8f 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -106,7 +106,7 @@ put ZWECONFX EOF echo "Testing the configuration workflow ${WORK_MOUNT}/ZWECONFX" -sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "${WORK_MOUNT}/_ZWECONF" +sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "${WORK_MOUNT}/ZWECONF" if [ $? -gt 0 ];then exit -1;fi sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF From 518061bf23477a95f6c15211f51c7104356aeabb Mon Sep 17 00:00:00 2001 From: mm667937 Date: Mon, 2 Sep 2024 15:05:10 +0200 Subject: [PATCH 15/54] workflow ends in init zowe step which is enough for our test(it ends there because of permissions that the end user will have to solve, we don't need to) Signed-off-by: mm667937 --- pswi/05_test.sh | 2 +- pswi/scripts/wf_run_test.sh | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 92e88e6c8f..2b67119ae2 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -106,7 +106,7 @@ put ZWECONFX EOF echo "Testing the configuration workflow ${WORK_MOUNT}/ZWECONFX" -sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "${WORK_MOUNT}/ZWECONF" +sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "ZWECONF" "${WORK_MOUNT}/ZWECONF" if [ $? -gt 0 ];then exit -1;fi sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF diff --git a/pswi/scripts/wf_run_test.sh b/pswi/scripts/wf_run_test.sh index c70c407d21..52a9bd203c 100755 --- a/pswi/scripts/wf_run_test.sh +++ b/pswi/scripts/wf_run_test.sh @@ -4,7 +4,8 @@ export BASE_URL="${ZOSMF_URL}:${ZOSMF_PORT}" WF_DEF_FILE=$1 run=$2 -INPUT_FILE=$3 +ZWECONF=$3 +INPUT_FILE=$4 echo "" echo "" @@ -86,7 +87,22 @@ if [ "$STATUS_NAME" = "in-progress" ] then echo "Workflow ended with an error." echo $RESP - exit -1 + echo "Checking if the workflow is ZWECONF" + if [ "$ZWECONF" = "ZWECONF" ] + then + STEP_NAME=`echo $RESP | grep -o '"currentStepName":".*"' | cut -f4 -d\"` + if [ "$STEPNAME" = "init_zowe" ] + then + echo "The workflow is ZWECONF and should end in step 'init_zowe'" + STATUS="FINISHED" + else + echo "The workflow is ZWECONF but ended in different step: '$STEPNAME'" + exit -1 + fi + else + echo "Workflow ended with an error and it is not ZWECONF." + exit -1 + fi elif [ "$STATUS_NAME" = "complete" ] then echo "Workflow finished successfully." From 1e69c677289bf5a41e5ae06eef34e88b47cea091 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Mon, 2 Sep 2024 15:54:42 +0200 Subject: [PATCH 16/54] wrong variable name Signed-off-by: mm667937 --- pswi/scripts/wf_run_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pswi/scripts/wf_run_test.sh b/pswi/scripts/wf_run_test.sh index 52a9bd203c..488ab4e857 100755 --- a/pswi/scripts/wf_run_test.sh +++ b/pswi/scripts/wf_run_test.sh @@ -91,12 +91,12 @@ then if [ "$ZWECONF" = "ZWECONF" ] then STEP_NAME=`echo $RESP | grep -o '"currentStepName":".*"' | cut -f4 -d\"` - if [ "$STEPNAME" = "init_zowe" ] + if [ "$STEP_NAME" = "init_zowe" ] then echo "The workflow is ZWECONF and should end in step 'init_zowe'" STATUS="FINISHED" else - echo "The workflow is ZWECONF but ended in different step: '$STEPNAME'" + echo "The workflow is ZWECONF but ended in different step: '$STEP_NAME'" exit -1 fi else From a200dbfdcb4fd56a296537c326b17e15d44022bc Mon Sep 17 00:00:00 2001 From: mm667937 Date: Tue, 3 Sep 2024 09:44:42 +0200 Subject: [PATCH 17/54] ascii Signed-off-by: mm667937 --- pswi/05_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 2b67119ae2..a42b57bada 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -111,6 +111,7 @@ if [ $? -gt 0 ];then exit -1;fi sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF cd ${WORK_MOUNT} +ascii get zowe.yaml EOF From 7f900be1b3c576480c4119eb1cde637db4432fd8 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Tue, 3 Sep 2024 11:12:17 +0200 Subject: [PATCH 18/54] iconv Signed-off-by: mm667937 --- pswi/05_test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index a42b57bada..6e08be8b57 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -111,10 +111,11 @@ if [ $? -gt 0 ];then exit -1;fi sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF cd ${WORK_MOUNT} -ascii get zowe.yaml EOF -cat zowe.yaml +iconv -f IBM-1047 -t ISO8859-1 zowe.yaml > zowe_.yaml + +cat zowe_.yaml #TODO: download yaml #TODO: locate local yaml From 8c8afc3bde7fa1e83344c5df766c6edb8ef11103 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Tue, 3 Sep 2024 14:01:03 +0200 Subject: [PATCH 19/54] skip delte of work zfs Signed-off-by: mm667937 --- pswi/06_test_cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pswi/06_test_cleanup.sh b/pswi/06_test_cleanup.sh index f426f11ed5..789b9530f5 100644 --- a/pswi/06_test_cleanup.sh +++ b/pswi/06_test_cleanup.sh @@ -121,7 +121,7 @@ echo "//SYSIN DD *" >> JCL echo " DELETE ${WORK_ZFS}" >> JCL echo "/*" >> JCL -sh scripts/submit_jcl.sh "`cat JCL`" +#sh scripts/submit_jcl.sh "`cat JCL`" # Not checking results so the script doesn't fail rm JCL fi From 3a6444dbe5054aafabeba55a701897ef9b1481cd Mon Sep 17 00:00:00 2001 From: Marketka Date: Tue, 3 Sep 2024 14:29:32 +0200 Subject: [PATCH 20/54] Update build-packaging.yml temporarily save files Signed-off-by: Marketka --- .github/workflows/build-packaging.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index 6e0e3d20c1..18ab49be12 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -366,7 +366,13 @@ jobs: ZOSMF_PASS: ${{ secrets.ZOWE_PSWI_BUILD_PASSWD }} ZZOW_SSH_PORT: ${{ secrets.SSH_MARIST_ALLSYS_PORT }} VERSION: ${{ env.P_VERSION }} - + - name: Store results + uses: actions/upload-artifact@v4 + if: always() + with: + name: pswi-folder + path: | + pswi/** - name: '[K8S] Build Kubernetes' timeout-minutes: 10 if: env.INPUTS_BUILD_KUBERNETES == 'true' From 88bea26d90eb50178274b68ced80bc2ec71bcd36 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Tue, 3 Sep 2024 15:46:02 +0200 Subject: [PATCH 21/54] previous run ended without cleanup Signed-off-by: mm667937 --- pswi/PSWI-marist.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pswi/PSWI-marist.sh b/pswi/PSWI-marist.sh index 80441508af..f2b396e094 100755 --- a/pswi/PSWI-marist.sh +++ b/pswi/PSWI-marist.sh @@ -90,6 +90,17 @@ export WORKFLOW_DSN=${CSIHLQ}.WORKFLOW export ZOWE_ZFS="${CSIHLQ}.ZFS" export VERSION=$(cat ../manifest.json.template | grep -o '"version": ".*"' | head -1 | cut -f4 -d\") +# Initialize variables +presmpe=0 +smpe=0 +ptf=0 +create=0 +test=0 + +# Just for now as I cant get to mainframe with zowead2 and I need clean up +sh 07_smpe_cleanup.sh +sh 08_presmpe_cleanup.sh + # Upload and prepare all files sh 00_presmpe.sh presmpe=$? @@ -141,6 +152,9 @@ if [ $presmpe -eq 0 ]; then # Clean RELFILEs and PTFs sh 08_presmpe_cleanup.sh fi +else + # Clean RELFILEs and PTFs + sh 08_presmpe_cleanup.sh fi echo "" From 3022a41ca4d6583845f379aa7cbf53759f765e62 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Wed, 4 Sep 2024 09:31:40 +0200 Subject: [PATCH 22/54] probably need to convert zowe.yaml on the mainframe so I can download it with newlines Signed-off-by: mm667937 --- pswi/05_test.sh | 19 ++++++++++++++++--- pswi/PSWI-marist.sh | 4 ---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 6e08be8b57..58bab68f5a 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -109,13 +109,26 @@ echo "Testing the configuration workflow ${WORK_MOUNT}/ZWECONFX" sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "ZWECONF" "${WORK_MOUNT}/ZWECONF" if [ $? -gt 0 ];then exit -1;fi +echo "Converting zowe.yaml" + +echo ${JOBST1} > JCL +echo ${JOBST2} >> JCL +echo "//UNPAXDIR 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 "iconv -f IBM-1047 -t ISO8859-1 zowe.yaml > zowe_.yaml;" >> JCL +echo "/*" >> JCL + sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF cd ${WORK_MOUNT} -get zowe.yaml +get zowe_.yaml EOF -iconv -f IBM-1047 -t ISO8859-1 zowe.yaml > zowe_.yaml - cat zowe_.yaml + +pwd #TODO: download yaml #TODO: locate local yaml diff --git a/pswi/PSWI-marist.sh b/pswi/PSWI-marist.sh index f2b396e094..e3ca2efd7f 100755 --- a/pswi/PSWI-marist.sh +++ b/pswi/PSWI-marist.sh @@ -97,10 +97,6 @@ ptf=0 create=0 test=0 -# Just for now as I cant get to mainframe with zowead2 and I need clean up -sh 07_smpe_cleanup.sh -sh 08_presmpe_cleanup.sh - # Upload and prepare all files sh 00_presmpe.sh presmpe=$? From 6272c41caf35ad6ce06eb35e3253699d63871ab7 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Wed, 4 Sep 2024 10:51:52 +0200 Subject: [PATCH 23/54] submit JCL Signed-off-by: mm667937 --- pswi/05_test.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 58bab68f5a..9bb7f78bd6 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -122,6 +122,10 @@ echo "cd ${WORK_MOUNT};" >> JCL echo "iconv -f IBM-1047 -t ISO8859-1 zowe.yaml > zowe_.yaml;" >> JCL echo "/*" >> JCL +sh scripts/submit_jcl.sh "`cat JCL`" +if [ $? -gt 0 ];then exit -1;fi +rm JCL + sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF cd ${WORK_MOUNT} get zowe_.yaml From 24e25d87ca7b8cdc40622ac9e6f47ebaacc7b92d Mon Sep 17 00:00:00 2001 From: mm667937 Date: Mon, 9 Sep 2024 15:10:26 +0200 Subject: [PATCH 24/54] diff Signed-off-by: mm667937 --- pswi/05_test.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 9bb7f78bd6..dca63b94f2 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -91,7 +91,6 @@ cp ../workflows/files/ZWECONF.properties ./ZWECONF.properties sed "s|runtimeDirectory=|runtimeDirectory=${WORK_MOUNT}|g" ./ZWECONF.properties > _ZWECONF sed "s|java_home=|java_home=#delete_me#|g" _ZWECONF > ZWECONF sed "s|node_home=|node_home=#delete_me#|g" ZWECONF > _ZWECONF -sed "s|storage_vsam_name=|storage_vsam_name=#delete_me#|g" _ZWECONF > ZWECONF #TODO:delete java home and node home from the yaml because it is not set in the example-zowe.yml echo "Changing the configuration workflow to be fully automated." @@ -101,12 +100,12 @@ sed "s|false|true|g" ./ZWECONF.xml > ZWECONFX sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF cd ${WORK_MOUNT} -put ZWECONF +put _ZWECONF put ZWECONFX EOF echo "Testing the configuration workflow ${WORK_MOUNT}/ZWECONFX" -sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "ZWECONF" "${WORK_MOUNT}/ZWECONF" +sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "ZWECONF" "${WORK_MOUNT}/_ZWECONF" if [ $? -gt 0 ];then exit -1;fi echo "Converting zowe.yaml" @@ -134,5 +133,7 @@ EOF cat zowe_.yaml pwd -#TODO: download yaml -#TODO: locate local yaml + +cp ../example-zowe.yaml example-zowe.yaml + +diff example-zowe.yaml zowe_.yaml From 02a54ed4e280789a63ca80df68014b26ea58cb58 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Mon, 9 Sep 2024 16:03:04 +0200 Subject: [PATCH 25/54] create output for diff Signed-off-by: mm667937 --- pswi/05_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index dca63b94f2..39a9a68674 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -136,4 +136,4 @@ pwd cp ../example-zowe.yaml example-zowe.yaml -diff example-zowe.yaml zowe_.yaml +diff --ed example-zowe.yaml zowe_.yaml > diff.txt From c5bdd69edb31e19bff2c2134db1c28c1bcfc2fd6 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Mon, 9 Sep 2024 17:13:16 +0200 Subject: [PATCH 26/54] added diff that is acceptable to be between example-zowe.yaml and workflow output and then comparing that diff to diff that is output on "live" example and wf output Signed-off-by: mm667937 --- pswi/05_test.sh | 6 ++--- pswi/scripts/base_diff.txt | 49 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 pswi/scripts/base_diff.txt diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 39a9a68674..dfa9e14a94 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -130,10 +130,10 @@ cd ${WORK_MOUNT} get zowe_.yaml EOF -cat zowe_.yaml - pwd cp ../example-zowe.yaml example-zowe.yaml -diff --ed example-zowe.yaml zowe_.yaml > diff.txt +diff --ed example-zowe.yaml zowe_.yaml > diff.txt || true + +diff --ed diff.txt scripts/base_diff.txt diff --git a/pswi/scripts/base_diff.txt b/pswi/scripts/base_diff.txt new file mode 100644 index 0000000000..be64f63928 --- /dev/null +++ b/pswi/scripts/base_diff.txt @@ -0,0 +1,49 @@ +538c + jwtAutoconfiguration: auto +. +483c + home: "#delete_me#" +. +468c + home: "#delete_me#" +. +281c + runtimeDirectory: "/u/zowead2/work" +. +106c + # directory: +. +100,103c + # certificate: + # Type of certificate storage. Valid values are: PKCS12, JCEKS, JCECCAKS, JCERACFKS, JCECCARACFKS, or JCEHYBRIDRACFKS + # type: + # pkcs12: +. +66,91c + # Security related configurations. This setup is optional. + security: + # security product name. Can be RACF, ACF2 or TSS + product: RACF + # security group name + groups: + # Zowe admin user group + admin: ZWEADMIN + # Zowe STC group + stc: ZWEADMIN + # Zowe SysProg group + sysProg: ZWEADMIN + # security user name + users: + # Zowe runtime user name of main service + zowe: ZWESVUSR + # Zowe runtime user name of ZIS + zis: ZWESIUSR + # STC names + stcs: + # STC name of Zowe main service + zowe: ZWESLSTC + # STC name of Zowe ZIS + zis: ZWESISTC + # STC name of Zowe ZIS Auxiliary Server + aux: ZWESASTC +. From ac7ff6d3104345150648f665e59f76a42e838e7d Mon Sep 17 00:00:00 2001 From: mm667937 Date: Tue, 10 Sep 2024 14:07:52 +0200 Subject: [PATCH 27/54] added conditions to step that stores results, testing failure Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 5 +++-- pswi/05_test.sh | 4 +++- pswi/06_test_cleanup.sh | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index 18ab49be12..4ebe555397 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -355,6 +355,7 @@ jobs: - name: '[SMPE Pax 4] Build PSWI' + id: pswi if: env.INPUTS_BUILD_PSWI == 'true' timeout-minutes: 60 run: | @@ -366,9 +367,9 @@ jobs: ZOSMF_PASS: ${{ secrets.ZOWE_PSWI_BUILD_PASSWD }} ZZOW_SSH_PORT: ${{ secrets.SSH_MARIST_ALLSYS_PORT }} VERSION: ${{ env.P_VERSION }} - - name: Store results + - name: Store PSWI results uses: actions/upload-artifact@v4 - if: always() + if: ${{ steps.pswi.outcome != 'success' }} with: name: pswi-folder path: | diff --git a/pswi/05_test.sh b/pswi/05_test.sh index dfa9e14a94..74f6ea9b10 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -136,4 +136,6 @@ cp ../example-zowe.yaml example-zowe.yaml diff --ed example-zowe.yaml zowe_.yaml > diff.txt || true -diff --ed diff.txt scripts/base_diff.txt +diff --ed diff.txt scripts/base_diff.txt > final_diff.txt + +exit -1 diff --git a/pswi/06_test_cleanup.sh b/pswi/06_test_cleanup.sh index 789b9530f5..f426f11ed5 100644 --- a/pswi/06_test_cleanup.sh +++ b/pswi/06_test_cleanup.sh @@ -121,7 +121,7 @@ echo "//SYSIN DD *" >> JCL echo " DELETE ${WORK_ZFS}" >> JCL echo "/*" >> JCL -#sh scripts/submit_jcl.sh "`cat JCL`" +sh scripts/submit_jcl.sh "`cat JCL`" # Not checking results so the script doesn't fail rm JCL fi From 6f58e0983402332303d7525c219f196495263caa Mon Sep 17 00:00:00 2001 From: mm667937 Date: Tue, 10 Sep 2024 15:15:27 +0200 Subject: [PATCH 28/54] added conditions to step that stores results, testing failure Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index 4ebe555397..e0c1cccfe2 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -369,7 +369,7 @@ jobs: VERSION: ${{ env.P_VERSION }} - name: Store PSWI results uses: actions/upload-artifact@v4 - if: ${{ steps.pswi.outcome != 'success' }} + if: steps.pswi.outputs.result != '' && failure() with: name: pswi-folder path: | From 226d15b5c8eedfd96f329989ffe94f1aced3d501 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Tue, 10 Sep 2024 16:27:46 +0200 Subject: [PATCH 29/54] testing contextual information passed from pswi step Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index e0c1cccfe2..c5959ac6eb 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -367,9 +367,20 @@ jobs: ZOSMF_PASS: ${{ secrets.ZOWE_PSWI_BUILD_PASSWD }} ZZOW_SSH_PORT: ${{ secrets.SSH_MARIST_ALLSYS_PORT }} VERSION: ${{ env.P_VERSION }} + - name: '[SMPE Pax 4] Echo output' + if: always() + shell: bash + run: | + echo "OUTPUT: $OUTPUT" + echo "OUTCOME: $OUTCOME" + echo "CONC: $CONC" + env: + OUTPUT: ${{ steps.pswi.outputs }} + OUTCOME: ${{ steps.pswi.outcome }} + CONC: ${{ steps.pswi.conclusion }} - name: Store PSWI results uses: actions/upload-artifact@v4 - if: steps.pswi.outputs.result != '' && failure() + if: steps.pswi.outputs.result != 'success' with: name: pswi-folder path: | From 8119238b921236ecbddff8297f0594515b0dfc14 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Tue, 10 Sep 2024 17:28:52 +0200 Subject: [PATCH 30/54] testing contextual information passed from pswi step - wrong mapping Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index c5959ac6eb..259097b23e 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -375,7 +375,7 @@ jobs: echo "OUTCOME: $OUTCOME" echo "CONC: $CONC" env: - OUTPUT: ${{ steps.pswi.outputs }} + OUTPUT: ${{ steps.pswi.outputs.result }} OUTCOME: ${{ steps.pswi.outcome }} CONC: ${{ steps.pswi.conclusion }} - name: Store PSWI results From 97cde5196298e297c5e94cd189d4478787c52026 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Wed, 11 Sep 2024 13:37:47 +0200 Subject: [PATCH 31/54] testing contextual information passed from pswi step Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index 259097b23e..cd5e68aefa 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -371,16 +371,17 @@ jobs: if: always() shell: bash run: | - echo "OUTPUT: $OUTPUT" - echo "OUTCOME: $OUTCOME" - echo "CONC: $CONC" + echo "Equal failure: $OUTCOME" + echo "Not equal success: $CONC" + echo "fail: $FAIL" + env env: - OUTPUT: ${{ steps.pswi.outputs.result }} - OUTCOME: ${{ steps.pswi.outcome }} - CONC: ${{ steps.pswi.conclusion }} + OUTCOME: ${{ steps.pswi.outcome == 'failure'}} + CONC: ${{ steps.pswi.outcome != 'success' }} + FAIL: ${{ steps.pswi.outcome != '' && failure() }} - name: Store PSWI results uses: actions/upload-artifact@v4 - if: steps.pswi.outputs.result != 'success' + if: steps.pswi.outcome == 'failure' with: name: pswi-folder path: | From 072f38a0319f260770935f00a94996c8980013c6 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Wed, 11 Sep 2024 13:50:19 +0200 Subject: [PATCH 32/54] testing contextual information passed from pswi step Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index cd5e68aefa..11b62c5052 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -378,7 +378,7 @@ jobs: env: OUTCOME: ${{ steps.pswi.outcome == 'failure'}} CONC: ${{ steps.pswi.outcome != 'success' }} - FAIL: ${{ steps.pswi.outcome != '' && failure() }} + FAIL: steps.pswi.outcome != '' && failure() - name: Store PSWI results uses: actions/upload-artifact@v4 if: steps.pswi.outcome == 'failure' From fa592b15e74645f9f156771763a0c3e4e39dae27 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Wed, 11 Sep 2024 15:13:49 +0200 Subject: [PATCH 33/54] testing contextual information passed from pswi step - more step conditions Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index 11b62c5052..9c0e33086f 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -381,7 +381,7 @@ jobs: FAIL: steps.pswi.outcome != '' && failure() - name: Store PSWI results uses: actions/upload-artifact@v4 - if: steps.pswi.outcome == 'failure' + if: ${{ steps.pswi.outcome != 'success' }} with: name: pswi-folder path: | From fa2129d93edb689b3ea32d249f712a1ead6f9d4a Mon Sep 17 00:00:00 2001 From: mm667937 Date: Wed, 11 Sep 2024 16:22:37 +0200 Subject: [PATCH 34/54] store pswi on everytime on failure - test Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 14 +------------- pswi/05_test.sh | 2 -- pswi/PSWI-marist.sh | 2 +- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index 9c0e33086f..c99d3f8066 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -367,21 +367,9 @@ jobs: ZOSMF_PASS: ${{ secrets.ZOWE_PSWI_BUILD_PASSWD }} ZZOW_SSH_PORT: ${{ secrets.SSH_MARIST_ALLSYS_PORT }} VERSION: ${{ env.P_VERSION }} - - name: '[SMPE Pax 4] Echo output' - if: always() - shell: bash - run: | - echo "Equal failure: $OUTCOME" - echo "Not equal success: $CONC" - echo "fail: $FAIL" - env - env: - OUTCOME: ${{ steps.pswi.outcome == 'failure'}} - CONC: ${{ steps.pswi.outcome != 'success' }} - FAIL: steps.pswi.outcome != '' && failure() - name: Store PSWI results uses: actions/upload-artifact@v4 - if: ${{ steps.pswi.outcome != 'success' }} + if: env.INPUTS_BUILD_PSWI == 'true' && failure() with: name: pswi-folder path: | diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 74f6ea9b10..16fcc513b3 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -137,5 +137,3 @@ cp ../example-zowe.yaml example-zowe.yaml diff --ed example-zowe.yaml zowe_.yaml > diff.txt || true diff --ed diff.txt scripts/base_diff.txt > final_diff.txt - -exit -1 diff --git a/pswi/PSWI-marist.sh b/pswi/PSWI-marist.sh index e3ca2efd7f..2428712f03 100755 --- a/pswi/PSWI-marist.sh +++ b/pswi/PSWI-marist.sh @@ -1,4 +1,4 @@ -export ZOSMF_URL="https://zzow07.zowe.marist.cloud" +exit -1 export ZOSMF_PORT=10443 export ZOSMF_SYSTEM="S0W1" export DIR="/u/zowead2" From 653558e0fcabf2dc1159ca58b97c3197df92391e Mon Sep 17 00:00:00 2001 From: mm667937 Date: Wed, 11 Sep 2024 17:12:22 +0200 Subject: [PATCH 35/54] store pswi on everytime on failure - no test needed anymore I hope Signed-off-by: mm667937 --- pswi/PSWI-marist.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/pswi/PSWI-marist.sh b/pswi/PSWI-marist.sh index 2428712f03..2f07b6da32 100755 --- a/pswi/PSWI-marist.sh +++ b/pswi/PSWI-marist.sh @@ -1,4 +1,3 @@ -exit -1 export ZOSMF_PORT=10443 export ZOSMF_SYSTEM="S0W1" export DIR="/u/zowead2" From 344b4072493b7f55cd8104efdc42110a0b3d73db Mon Sep 17 00:00:00 2001 From: mm667937 Date: Thu, 12 Sep 2024 13:42:39 +0200 Subject: [PATCH 36/54] deleted hostname by mistake Signed-off-by: mm667937 --- pswi/PSWI-marist.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/pswi/PSWI-marist.sh b/pswi/PSWI-marist.sh index 2f07b6da32..e3ca2efd7f 100755 --- a/pswi/PSWI-marist.sh +++ b/pswi/PSWI-marist.sh @@ -1,3 +1,4 @@ +export ZOSMF_URL="https://zzow07.zowe.marist.cloud" export ZOSMF_PORT=10443 export ZOSMF_SYSTEM="S0W1" export DIR="/u/zowead2" From e4db670b8196d4136f8b8246e7f61b9462f2066f Mon Sep 17 00:00:00 2001 From: mm667937 Date: Fri, 13 Sep 2024 13:35:41 +0200 Subject: [PATCH 37/54] New base diff because there was a change in the workflow Signed-off-by: mm667937 --- pswi/scripts/base_diff.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/pswi/scripts/base_diff.txt b/pswi/scripts/base_diff.txt index be64f63928..f0ebb0a0a2 100644 --- a/pswi/scripts/base_diff.txt +++ b/pswi/scripts/base_diff.txt @@ -1,6 +1,3 @@ -538c - jwtAutoconfiguration: auto -. 483c home: "#delete_me#" . From b97f595453fb4e4e7185e149870fd59a1490f432 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Mon, 16 Sep 2024 14:29:59 +0200 Subject: [PATCH 38/54] echo to a specific file to enhance readability. Signed-off-by: mm667937 --- pswi/01_smpe.sh | 4 ++-- pswi/02_ptf.sh | 4 ++-- pswi/03_create.sh | 20 ++++++++++---------- pswi/051_test_workflows.sh | 0 pswi/PSWI-marist.sh | 23 ++++++++++++++--------- pswi/scripts/check_response.sh | 4 ++-- pswi/scripts/submit_jcl.sh | 6 +++--- pswi/scripts/tmp_mounts.sh | 10 +++++----- pswi/scripts/wf_run_test.sh | 11 ++++++----- 9 files changed, 44 insertions(+), 38 deletions(-) create mode 100644 pswi/051_test_workflows.sh diff --git a/pswi/01_smpe.sh b/pswi/01_smpe.sh index 8370b9ef54..42d9f89aff 100644 --- a/pswi/01_smpe.sh +++ b/pswi/01_smpe.sh @@ -91,8 +91,8 @@ STATUS_NAME=`echo $RESP | grep -o '"statusName":".*"' | cut -f4 -d\"` if [ "$STATUS_NAME" = "in-progress" ] then - echo "Workflow ended with an error." - echo $RESP + echo "Workflow with SMP/E ended with an error." >> report.txt + echo $RESP >> report.txt exit -1 elif [ "$STATUS_NAME" = "complete" ] then diff --git a/pswi/02_ptf.sh b/pswi/02_ptf.sh index e2c23e54e3..e5174333d7 100644 --- a/pswi/02_ptf.sh +++ b/pswi/02_ptf.sh @@ -87,8 +87,8 @@ STATUS_NAME=`echo $RESP | grep -o '"statusName":".*"' | cut -f4 -d\"` if [ "$STATUS_NAME" = "in-progress" ] then - echo "Workflow ended with an error." - echo $RESP + echo "Workflow with PTFs ended with an error." >> report.txt + echo $RESP >> report.txt exit -1 elif [ "$STATUS_NAME" = "complete" ] then diff --git a/pswi/03_create.sh b/pswi/03_create.sh index 3f9e30fb84..724ab7ad61 100644 --- a/pswi/03_create.sh +++ b/pswi/03_create.sh @@ -79,8 +79,8 @@ then then echo "${ZOWE_MOUNT} with zFS ${ZOWE_ZFS} mounted will be used." else - echo "The file system ${ZOWE_ZFS} exists but is mounted to different mount point ${MOUNTZ}." - echo "It is required to have the file system ${ZOWE_ZFS} mounted to the exact mount point (${ZOWE_MOUNT}) to successfully export Zowe PSWI." + echo "The file system ${ZOWE_ZFS} exists but is mounted to different mount point ${MOUNTZ}." >> report.txt + echo "It is required to have the file system ${ZOWE_ZFS} mounted to the exact mount point (${ZOWE_MOUNT}) to successfully export Zowe PSWI." >> report.txt exit -1 fi else @@ -90,7 +90,7 @@ else if [ -n "$MOUNTZFS" ] then # If ZFS is not mounted to the mountpoint then this ZOWE mountpoint has different zFS - echo "The mountpoint ${ZOWE_MOUNT} has different zFS ${MOUNTZFS}." + echo "The mountpoint ${ZOWE_MOUNT} has different zFS ${MOUNTZFS}." >> report.txt exit -1 else # Mount zFS to Zowe mountpoint @@ -108,14 +108,14 @@ RESP=`curl -s $CHECK_WORKFLOW_DSN_URL -k -X "GET" -H "Content-Type: application/ DS_COUNT=`echo $RESP | grep -o '"returnedRows":[0-9]*' | cut -f2 -d:` if [ $DS_COUNT -ne 0 ] then - echo "The ${WORKFLOW_DSN} already exist. Because there is a possibility that it contains something unwanted the script does not continue." + echo "The ${WORKFLOW_DSN} already exist. Because there is a possibility that it contains something unwanted the script does not continue." >> report.txt exit -1 else echo "Creating a data set where the post-Deployment workflow will be stored." RESP=`curl -s $WORKFLOW_DSN_URL -k -X "POST" -d "$ADD_WORKFLOW_DSN_JSON" -H "Content-Type: application/json" -H "X-CSRF-ZOSMF-HEADER: A" --user $ZOSMF_USER:$ZOSMF_PASS` if [ -n "$RESP" ] then - echo "The creation of the ${WORKFLOW_DSN} was not successful. Error message: ${RESP}" + echo "The creation of the ${WORKFLOW_DSN} was not successful. Error message: ${RESP}" >> report.txt exit -1 fi fi @@ -173,7 +173,7 @@ RESP=`curl -s $CHECK_EXPORT_DSN_URL -k -X "GET" -H "Content-Type: application/js DSN_COUNT=`echo $RESP | grep -o '"returnedRows":[0-9]*' | cut -f2 -d:` if [ $DSN_COUNT -ne 0 ] then - echo "The ${EXPORT_DSN} already exist. Because there is a possibility that it contains something unwanted the script does not continue." + echo "The ${EXPORT_DSN} already exist. Because there is a possibility that it contains something unwanted the script does not continue." >> report.txt exit -1 else echo "Creating a data set where the export jobs will be stored." @@ -209,7 +209,7 @@ if [ $? -gt 0 ];then exit -1;fi LOAD_STATUS_URL=`echo $RESP | grep -o '"statusurl":".*"' | cut -f4 -d\" | tr -d '\' 2>/dev/null` if [ -z "$LOAD_STATUS_URL" ] then - echo "No response from the REST API call." + echo "No response from the load product REST API call." >> report.txt exit -1 fi @@ -239,7 +239,7 @@ if [ $? -gt 0 ];then exit -1;fi EXPORT_STATUS_URL=`echo $RESP | grep -o '"statusurl":".*"' | cut -f4 -d\" | tr -d '\' 2>/dev/null` if [ -z "$EXPORT_STATUS_URL" ] then - echo "No response from the REST API call." + echo "No response from the export REST API call." >> report.txt exit -1 fi @@ -266,7 +266,7 @@ then # Can be 100% but still running if [ "$STATUS" != "complete" ] && [ "$STATUS" != "running" ] then - echo "Status of generation of Export JCL failed." + echo "Status of generation of Export JCL failed." >> report.txt exit -1 fi fi @@ -275,7 +275,7 @@ done if [ -z "$DSN" ] then - echo "The creation of export JCL failed" + echo "The creation of export JCL failed" >> report.txt exit -1 fi diff --git a/pswi/051_test_workflows.sh b/pswi/051_test_workflows.sh new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pswi/PSWI-marist.sh b/pswi/PSWI-marist.sh index e3ca2efd7f..8d74631316 100755 --- a/pswi/PSWI-marist.sh +++ b/pswi/PSWI-marist.sh @@ -41,7 +41,7 @@ if [ -f ../.pax/zowe-smpe.zip ]; then mkdir -p "unzipped" unzip ../.pax/zowe-smpe.zip -d unzipped else - echo "zowe-smpe file not found" + echo "zowe-smpe file not found" >> report.txt exit -1 fi @@ -73,7 +73,7 @@ else if [ -f ../.pax/${FMID}.zip ]; then unzip ../.pax/${FMID}.zip -d unzipped else - echo "File with FMID not found" + echo "File with FMID not found" >> report.txt exit -1 fi fi @@ -96,6 +96,7 @@ smpe=0 ptf=0 create=0 test=0 +wf_test=0 # Upload and prepare all files sh 00_presmpe.sh @@ -132,7 +133,11 @@ if [ $presmpe -eq 0 ]; then # Test PSWI sh 05_test.sh test=$? - + + #test the workflows + sh 051_test_workflows.sh + wf_test=$? + # Cleanup after the test sh 06_test_cleanup.sh fi @@ -157,17 +162,17 @@ echo "" echo "" if [ $smpe -ne 0 ] || [ $ptf -ne 0 ] || [ $create -ne 0 ] || [ $test -ne 0 ] || [ $presmpe -ne 0 ]; then - echo "Build unsuccessful!" + echo "Build unsuccessful!" >> report.txt if [ $presmpe -ne 0 ]; then - echo "Pre-SMP/E wasn't successful." + echo "Pre-SMP/E wasn't successful." >> report.txt elif [ $smpe -ne 0 ]; then - echo "SMP/E wasn't successful." + echo "SMP/E wasn't successful." >> report.txt elif [ $ptf -ne 0 ]; then - echo "Applying PTFs wasn't successful." + echo "Applying PTFs wasn't successful." >> report.txt elif [ $create -ne 0 ]; then - echo "Creation of PSWI wasn't successful." + echo "Creation of PSWI wasn't successful." >> report.txt elif [ $test -ne 0 ]; then - echo "Testing of PSWI wasn't successful." + echo "Testing of PSWI wasn't successful." >> report.txt fi exit -1 else diff --git a/pswi/scripts/check_response.sh b/pswi/scripts/check_response.sh index b9b280848e..7bb08979ce 100644 --- a/pswi/scripts/check_response.sh +++ b/pswi/scripts/check_response.sh @@ -5,13 +5,13 @@ REASON=`echo $RESP | grep -o '"reason":'` MSG=`echo $RESP | grep -o '"messageText":'` if [ -n "$REASON" ] || [ -n "$MSG" ] then - echo $RESP + echo $RESP >> report.txt exit -1 fi if [ $RESPCODE -ne 0 ] then echo "REST API call failed." - echo $RESP + echo $RESP >> report.txt exit -1 else echo "REST API call was successful." diff --git a/pswi/scripts/submit_jcl.sh b/pswi/scripts/submit_jcl.sh index 58f32f3805..43a5c672ba 100644 --- a/pswi/scripts/submit_jcl.sh +++ b/pswi/scripts/submit_jcl.sh @@ -11,7 +11,7 @@ sh scripts/check_response.sh "${RESP}" $? JOB_STATUS_URL=`echo $RESP | grep -o '"url":".*"' | cut -f4 -d\" | tr -d '\' 2>/dev/null` if [ -z "$JOB_STATUS_URL" ] then - echo "No response from the REST API call." + echo "No response from the REST API call." >> report.txt exit -1 fi JOBID=`echo $RESP | grep -o '"jobid":".*"' | cut -f4 -d\"` @@ -49,7 +49,7 @@ if [ "$RC" = "CC 0000" ] then echo "${JOBNAME} ${JOBID} was completed." else - echo "${JOBNAME} ${JOBID} failed." - cat $JOBNAME/$JOBID + echo "${JOBNAME} ${JOBID} failed." >> report.txt + cat $JOBNAME/$JOBID >> report.txt exit -1 fi diff --git a/pswi/scripts/tmp_mounts.sh b/pswi/scripts/tmp_mounts.sh index 23fa144cdb..eb44340d58 100644 --- a/pswi/scripts/tmp_mounts.sh +++ b/pswi/scripts/tmp_mounts.sh @@ -20,8 +20,8 @@ then echo "${MOUNT} with zFS ${ZFS} mounted will be used as is." MOUNTED=true else - echo "The file system ${ZFS} exists but is mounted to different mount point(${MOUNTP})." - echo "Use different name of zFS or ${MOUNTP} for mount point." + echo "The file system ${ZFS} exists but is mounted to different mount point(${MOUNTP})." >> report.txt + echo "Use different name of zFS or ${MOUNTP} for mount point." >> report.txt exit -1 fi else @@ -33,9 +33,9 @@ else if [ -n "$MOUNTZFS" ] then # If zFS is not mounted to the mount point then this mount point has different zFS - echo "The mount point ${MOUNT} has different zFS (${MOUNTZFS}) mounted." - echo "Use different mount point (not ${MOUNT})." - echo "Or use ${MOUNTZFS} for zFS." + echo "The mount point ${MOUNT} has different zFS (${MOUNTZFS}) mounted." >> report.txt + echo "Use different mount point (not ${MOUNT})." >> report.txt + echo "Or use ${MOUNTZFS} for zFS." >> report.txt exit -1 fi fi diff --git a/pswi/scripts/wf_run_test.sh b/pswi/scripts/wf_run_test.sh index 488ab4e857..97be62af26 100755 --- a/pswi/scripts/wf_run_test.sh +++ b/pswi/scripts/wf_run_test.sh @@ -85,9 +85,9 @@ STATUS_NAME=`echo $RESP | grep -o '"statusName":".*"' | cut -f4 -d\"` if [ "$STATUS_NAME" = "in-progress" ] then - echo "Workflow ended with an error." - echo $RESP - echo "Checking if the workflow is ZWECONF" + echo "Workflow ended with an error." >> report.txt + echo $RESP >> report.txt + echo "Checking if the workflow is ZWECONF" >> report.txt if [ "$ZWECONF" = "ZWECONF" ] then STEP_NAME=`echo $RESP | grep -o '"currentStepName":".*"' | cut -f4 -d\"` @@ -96,11 +96,12 @@ then echo "The workflow is ZWECONF and should end in step 'init_zowe'" STATUS="FINISHED" else - echo "The workflow is ZWECONF but ended in different step: '$STEP_NAME'" + echo "The workflow is ZWECONF but ended in different step: '$STEP_NAME'" >> report.txt exit -1 fi else - echo "Workflow ended with an error and it is not ZWECONF." + echo "Workflow ended with an error and it is not ZWECONF." >> report.txt + echo $RESP >> report.txt exit -1 fi elif [ "$STATUS_NAME" = "complete" ] From d22d25bba6e906593f75e404ef6e979a3e848637 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Mon, 16 Sep 2024 15:18:53 +0200 Subject: [PATCH 39/54] separated pswi test and workflow test Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 9 ++- pswi/051_test_workflows.sh | 80 +++++++++++++++++++++++++++ pswi/PSWI-marist.sh | 14 +++-- pswi/scripts/check_response.sh | 2 +- 4 files changed, 99 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index c99d3f8066..9452d9ca01 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -367,13 +367,20 @@ jobs: ZOSMF_PASS: ${{ secrets.ZOWE_PSWI_BUILD_PASSWD }} ZZOW_SSH_PORT: ${{ secrets.SSH_MARIST_ALLSYS_PORT }} VERSION: ${{ env.P_VERSION }} - - name: Store PSWI results + - name: Store PSWI folder uses: actions/upload-artifact@v4 if: env.INPUTS_BUILD_PSWI == 'true' && failure() with: name: pswi-folder path: | pswi/** + - name: Store PSWI-log results + uses: actions/upload-artifact@v4 + if: env.INPUTS_BUILD_PSWI == 'true' && failure() + with: + name: pswi-folder + path: pswi/report.txt + compression-level: 0 - name: '[K8S] Build Kubernetes' timeout-minutes: 10 if: env.INPUTS_BUILD_KUBERNETES == 'true' diff --git a/pswi/051_test_workflows.sh b/pswi/051_test_workflows.sh index e69de29bb2..e27bdf11b1 100644 --- a/pswi/051_test_workflows.sh +++ b/pswi/051_test_workflows.sh @@ -0,0 +1,80 @@ +#!/bin/sh +#version=1.0 + +export BASE_URL="${ZOSMF_URL}:${ZOSMF_PORT}" + +echo "" +echo "" +echo "Script for testing workflows..." +echo "Host :" $ZOSMF_URL +echo "Port :" $ZOSMF_PORT +echo "SSH Port :" $ZZOW_SSH_PORT +echo "z/OSMF system :" $ZOSMF_SYSTEM +echo "Test HLQ :" $TEST_HLQ +echo "Test mount point :" $TEST_MOUNT +echo "Work zFS :" $WORK_ZFS # For z/OSMF v2.3 +echo "Work mount point :" $WORK_MOUNT # For z/OSMF v2.3 + +echo "Mounting ${TEST_HLQ}.ZFS" +sh scripts/tmp_mounts.sh "${TEST_HLQ}.ZFS" "${TEST_MOUNT}" +if [ $? -gt 0 ]; then exit -1; fi + +echo "Registering/testing the configuration workflow ${TEST_HLQ}.WORKFLOW(ZWECONF)" +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}/files/workflows/ZWECONF.xml" +sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" +if [ $? -gt 0 ];then exit -1;fi + +echo "Changing runtime path in ZWECONF.properties." + +cp ../workflows/files/ZWECONF.properties ./ZWECONF.properties +sed "s|runtimeDirectory=|runtimeDirectory=${WORK_MOUNT}|g" ./ZWECONF.properties > _ZWECONF +sed "s|java_home=|java_home=#delete_me#|g" _ZWECONF > ZWECONF +sed "s|node_home=|node_home=#delete_me#|g" ZWECONF > _ZWECONF + +echo "Changing the configuration workflow to be fully automated." + +cp ../workflows/files/ZWECONF.xml ./ZWECONF.xml +sed "s|false|true|g" ./ZWECONF.xml > ZWECONFX + +sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF +cd ${WORK_MOUNT} +put _ZWECONF +put ZWECONFX +EOF + +echo "Testing the configuration workflow ${WORK_MOUNT}/ZWECONFX" +sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "ZWECONF" "${WORK_MOUNT}/_ZWECONF" +if [ $? -gt 0 ];then exit -1;fi + +echo "Converting zowe.yaml" + +echo ${JOBST1} > JCL +echo ${JOBST2} >> JCL +echo "//UNPAXDIR 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 "iconv -f IBM-1047 -t ISO8859-1 zowe.yaml > zowe_.yaml;" >> JCL +echo "/*" >> JCL + +sh scripts/submit_jcl.sh "`cat JCL`" +if [ $? -gt 0 ];then exit -1;fi +rm JCL + +sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF +cd ${WORK_MOUNT} +get zowe_.yaml +EOF + +pwd + +cp ../example-zowe.yaml example-zowe.yaml + +diff --ed example-zowe.yaml zowe_.yaml > diff.txt || true + +diff --ed diff.txt scripts/base_diff.txt > final_diff.txt diff --git a/pswi/PSWI-marist.sh b/pswi/PSWI-marist.sh index 8d74631316..feb0167258 100755 --- a/pswi/PSWI-marist.sh +++ b/pswi/PSWI-marist.sh @@ -134,9 +134,11 @@ if [ $presmpe -eq 0 ]; then sh 05_test.sh test=$? - #test the workflows - sh 051_test_workflows.sh - wf_test=$? + if [ $test -eq 0 ]; then + #test the workflows + sh 051_test_workflows.sh + wf_test=$? + fi # Cleanup after the test sh 06_test_cleanup.sh @@ -161,7 +163,7 @@ fi echo "" echo "" -if [ $smpe -ne 0 ] || [ $ptf -ne 0 ] || [ $create -ne 0 ] || [ $test -ne 0 ] || [ $presmpe -ne 0 ]; then +if [ $smpe -ne 0 ] || [ $ptf -ne 0 ] || [ $create -ne 0 ] || [ $test -ne 0 ] || [ $presmpe -ne 0 ] || [ $wf_test -ne 0 ]; then echo "Build unsuccessful!" >> report.txt if [ $presmpe -ne 0 ]; then echo "Pre-SMP/E wasn't successful." >> report.txt @@ -173,9 +175,13 @@ if [ $smpe -ne 0 ] || [ $ptf -ne 0 ] || [ $create -ne 0 ] || [ $test -ne 0 ] || echo "Creation of PSWI wasn't successful." >> report.txt elif [ $test -ne 0 ]; then echo "Testing of PSWI wasn't successful." >> report.txt + elif [ $wf_test -ne 0 ]; then + echo "Workflow testing wasn't successful." >> report.txt fi exit -1 else echo "Build successful!" exit 0 fi + +echo "Testing pipeline fail" >> report.txt diff --git a/pswi/scripts/check_response.sh b/pswi/scripts/check_response.sh index 7bb08979ce..b589cf88d2 100644 --- a/pswi/scripts/check_response.sh +++ b/pswi/scripts/check_response.sh @@ -10,7 +10,7 @@ then fi if [ $RESPCODE -ne 0 ] then - echo "REST API call failed." + echo "REST API call failed." >> report.txt echo $RESP >> report.txt exit -1 else From 45b6de3f73cbab6547e4fd05a5e2655250f7d377 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Mon, 16 Sep 2024 16:28:17 +0200 Subject: [PATCH 40/54] forgot to exit -1 for the test Signed-off-by: mm667937 --- pswi/PSWI-marist.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/pswi/PSWI-marist.sh b/pswi/PSWI-marist.sh index feb0167258..343e072f68 100755 --- a/pswi/PSWI-marist.sh +++ b/pswi/PSWI-marist.sh @@ -185,3 +185,4 @@ else fi echo "Testing pipeline fail" >> report.txt +exit -1 From d7eb39f60fa920283cbf44872e97f1e9e899f9b3 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Tue, 17 Sep 2024 11:07:11 +0200 Subject: [PATCH 41/54] still wrong exit for test Signed-off-by: mm667937 --- pswi/PSWI-marist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pswi/PSWI-marist.sh b/pswi/PSWI-marist.sh index 343e072f68..c3fc513bd2 100755 --- a/pswi/PSWI-marist.sh +++ b/pswi/PSWI-marist.sh @@ -181,7 +181,7 @@ if [ $smpe -ne 0 ] || [ $ptf -ne 0 ] || [ $create -ne 0 ] || [ $test -ne 0 ] || exit -1 else echo "Build successful!" - exit 0 + #exit 0 fi echo "Testing pipeline fail" >> report.txt From f333bd6cb8917695d302080cd54deea3d8c0c2eb Mon Sep 17 00:00:00 2001 From: mm667937 Date: Wed, 18 Sep 2024 09:39:38 +0200 Subject: [PATCH 42/54] wrong name for log file Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index 9452d9ca01..f2de09b5e1 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -378,7 +378,7 @@ jobs: uses: actions/upload-artifact@v4 if: env.INPUTS_BUILD_PSWI == 'true' && failure() with: - name: pswi-folder + name: report.txt path: pswi/report.txt compression-level: 0 - name: '[K8S] Build Kubernetes' From 95058e88c1e6c6e4dbd08f00e3153cedadf57273 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Wed, 18 Sep 2024 11:10:48 +0200 Subject: [PATCH 43/54] no need for log file as it is stored as zip anyway got back to trying to actually pass the build Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 7 ------- pswi/PSWI-marist.sh | 6 ++---- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index f2de09b5e1..e34a4592a9 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -374,13 +374,6 @@ jobs: name: pswi-folder path: | pswi/** - - name: Store PSWI-log results - uses: actions/upload-artifact@v4 - if: env.INPUTS_BUILD_PSWI == 'true' && failure() - with: - name: report.txt - path: pswi/report.txt - compression-level: 0 - name: '[K8S] Build Kubernetes' timeout-minutes: 10 if: env.INPUTS_BUILD_KUBERNETES == 'true' diff --git a/pswi/PSWI-marist.sh b/pswi/PSWI-marist.sh index c3fc513bd2..5a9e03bfa7 100755 --- a/pswi/PSWI-marist.sh +++ b/pswi/PSWI-marist.sh @@ -1,3 +1,4 @@ +set -x export ZOSMF_URL="https://zzow07.zowe.marist.cloud" export ZOSMF_PORT=10443 export ZOSMF_SYSTEM="S0W1" @@ -181,8 +182,5 @@ if [ $smpe -ne 0 ] || [ $ptf -ne 0 ] || [ $create -ne 0 ] || [ $test -ne 0 ] || exit -1 else echo "Build successful!" - #exit 0 + exit 0 fi - -echo "Testing pipeline fail" >> report.txt -exit -1 From bf3990eb1416aab59d86f9cb94c1308b9f702a15 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Wed, 18 Sep 2024 16:34:44 +0200 Subject: [PATCH 44/54] workflow tests on 2 places Signed-off-by: mm667937 --- pswi/05_test.sh | 65 ------------------------------------------------- 1 file changed, 65 deletions(-) diff --git a/pswi/05_test.sh b/pswi/05_test.sh index ebed06bd05..94afd818a2 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -72,68 +72,3 @@ echo " Running the deployment test for z/OSMF version 2.3" pip install requests python scripts/deploy_test_2_3.py - -echo "Mounting ${TEST_HLQ}.ZFS" -sh scripts/tmp_mounts.sh "${TEST_HLQ}.ZFS" "${TEST_MOUNT}" -if [ $? -gt 0 ]; then exit -1; fi - -echo "Registering/testing the configuration workflow ${TEST_HLQ}.WORKFLOW(ZWECONF)" -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}/files/workflows/ZWECONF.xml" -sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" -if [ $? -gt 0 ];then exit -1;fi - -echo "Changing runtime path in ZWECONF.properties." - -cp ../workflows/files/ZWECONF.properties ./ZWECONF.properties -sed "s|runtimeDirectory=|runtimeDirectory=${WORK_MOUNT}|g" ./ZWECONF.properties > _ZWECONF -sed "s|java_home=|java_home=#delete_me#|g" _ZWECONF > ZWECONF -sed "s|node_home=|node_home=#delete_me#|g" ZWECONF > _ZWECONF -#TODO:delete java home and node home from the yaml because it is not set in the example-zowe.yml - -echo "Changing the configuration workflow to be fully automated." - -cp ../workflows/files/ZWECONF.xml ./ZWECONF.xml -sed "s|false|true|g" ./ZWECONF.xml > ZWECONFX - -sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF -cd ${WORK_MOUNT} -put _ZWECONF -put ZWECONFX -EOF - -echo "Testing the configuration workflow ${WORK_MOUNT}/ZWECONFX" -sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "ZWECONF" "${WORK_MOUNT}/_ZWECONF" -if [ $? -gt 0 ];then exit -1;fi - -echo "Converting zowe.yaml" - -echo ${JOBST1} > JCL -echo ${JOBST2} >> JCL -echo "//UNPAXDIR 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 "iconv -f IBM-1047 -t ISO8859-1 zowe.yaml > zowe_.yaml;" >> JCL -echo "/*" >> JCL - -sh scripts/submit_jcl.sh "`cat JCL`" -if [ $? -gt 0 ];then exit -1;fi -rm JCL - -sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF -cd ${WORK_MOUNT} -get zowe_.yaml -EOF - -pwd - -cp ../example-zowe.yaml example-zowe.yaml - -diff --ed example-zowe.yaml zowe_.yaml > diff.txt || true - -diff --ed diff.txt scripts/base_diff.txt > final_diff.txt From 73372aafef1196aec19ae8d3487a1cfe7402157d Mon Sep 17 00:00:00 2001 From: mm667937 Date: Thu, 19 Sep 2024 14:01:26 +0200 Subject: [PATCH 45/54] switched from zaas variables to gateway variables Signed-off-by: mm667937 --- workflows/files/ZWECONF.xml | 104 ++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/workflows/files/ZWECONF.xml b/workflows/files/ZWECONF.xml index f995c29822..b9a54cde87 100644 --- a/workflows/files/ZWECONF.xml +++ b/workflows/files/ZWECONF.xml @@ -567,10 +567,10 @@ How we want to verify SSL certificates of services. Valid values are: false - - - Authorization provider for the ZAAS - Authorization provider for the ZAAS + + + Authorization provider for the gateway + Authorization provider for the gateway components @@ -578,8 +578,8 @@ How we want to verify SSL certificates of services. Valid values are: zosmf - - + + JWT auto configuration for gateway security auth JWT auto configuration for gateway security auth components @@ -591,10 +591,10 @@ How we want to verify SSL certificates of services. Valid values are: jwt - - - Service ID for ZAAS security auth - Service ID for ZAAS security auth + + + Service ID for gateway security auth + Service ID for gateway security auth components @@ -602,8 +602,8 @@ How we want to verify SSL certificates of services. Valid values are: ibmzosmf - - + + Use this to enable the security authorization endpoint Use this to enable the security authorization endpoint components @@ -613,10 +613,10 @@ How we want to verify SSL certificates of services. Valid values are: false - - - Security authorization provider for the ZAAS - Security authorization provider for the ZAAS + + + Security authorization provider for the gateway + Security authorization provider for the gateway components @@ -624,10 +624,10 @@ How we want to verify SSL certificates of services. Valid values are: native - - - Check to enable the ZAAS security x509 - Check to enable the ZAAS security x509 + + + Check to enable the gateway security x509 + Check to enable the gateway security x509 components @@ -1201,6 +1201,12 @@ How we want to verify SSL certificates of services. Valid values are: + + + + + + Run this step to specify the cloud gateway variables 1 z/OS System Programmer @@ -1225,12 +1231,6 @@ How we want to verify SSL certificates of services. Valid values are: - - - - - - Run this step to fill gateway component variables. 1 z/OS System Programmer @@ -1985,12 +1985,38 @@ echo ' gateway:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' enabled: ${instance-components_gateway_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' port: ${instance-components_gateway_port}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' debug: ${instance-components_gateway_debug}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' apiml:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' security:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' auth:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' provider: $!{instance-components_gateway_apiml_security_auth_provider}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' zosmf:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' jwtAutoconfiguration: $!{instance-components_gateway_apiml_security_auth_zosmf_jwtAutoconfiguration}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' serviceId: $!{instance-components_gateway_apiml_security_auth_zosmf_serviceId}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' authorization:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' endpoint:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' enabled: ${instance-components_gateway_apiml_security_authorization_endpoint_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' provider: "$!{instance-components_gateway_apiml_security_authorization_provider}"' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' x509:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' enabled: ${instance-components_gateway_apiml_security_x509_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" #end #if (${instance-components_gateway_enabled} == "false" ) echo ' gateway:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' enabled: ${instance-components_gateway_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' port: 7554' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' debug: false' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' apiml:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' security:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' auth:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' provider: zosmf' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' zosmf:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' jwtAutoconfiguration: auto' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' serviceId: ibmzosmf' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' authorization:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' endpoint:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' enabled: false' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' provider: "native"' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' x509:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' enabled: false' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" #end echo '' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' # If we customize this to use different external certificate, than should also' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" @@ -2005,38 +2031,12 @@ echo ' zaas:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' enabled: ${instance-components_zaas_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' port: ${instance-components_zaas_port}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' debug: ${instance-components_zaas_debug}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' apiml:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' security:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' auth:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' provider: $!{instance-components_zaas_apiml_security_auth_provider}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' zosmf:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' jwtAutoconfiguration: $!{instance-components_zaas_apiml_security_auth_zosmf_jwtAutoconfiguration}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' serviceId: $!{instance-components_zaas_apiml_security_auth_zosmf_serviceId}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' authorization:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' endpoint:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' enabled: ${instance-components_zaas_apiml_security_authorization_endpoint_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' provider: "$!{instance-components_zaas_apiml_security_authorization_provider}"' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' x509:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' enabled: ${instance-components_zaas_apiml_security_x509_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" #end #if (${instance-components_zaas_enabled} == "false" ) echo ' zaas:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' enabled: ${instance-components_zaas_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' port: 7558' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' debug: false' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' apiml:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' security:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' auth:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' provider: zosmf' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' zosmf:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' jwtAutoconfiguration: auto' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' serviceId: ibmzosmf' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' authorization:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' endpoint:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' enabled: false' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' provider: "native"' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' x509:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' enabled: false' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" #end echo ' # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" #if (${instance-components_api_catalog_enabled} == "true" ) From 40227d890d3010618dcf0aec1b2ee9d100ead1e4 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Thu, 19 Sep 2024 16:53:58 +0200 Subject: [PATCH 46/54] moved zweconf yaml test into a separate script that runs everytime I hope Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 18 ++++++++ pswi/051_test_workflows.sh | 52 ---------------------- pswi/ZWECONF_test.sh | 63 +++++++++++++++++++++++++++ pswi/scripts/base_diff.txt | 3 -- workflows/files/ZWECONF.properties | 57 ++++++++++++------------ 5 files changed, 110 insertions(+), 83 deletions(-) create mode 100755 pswi/ZWECONF_test.sh diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index e34a4592a9..aab812231a 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -374,6 +374,24 @@ jobs: name: pswi-folder path: | pswi/** + - name: 'Test ZWECONF workflow' + id: zweconf + timeout-minutes: 30 + run: | + cd pswi + ./ZWECONF_test.sh + env: + ZOSMF_USER: ${{ secrets.ZOWE_PSWI_BUILD_USR }} + ZOSMF_PASS: ${{ secrets.ZOWE_PSWI_BUILD_PASSWD }} + ZZOW_SSH_PORT: ${{ secrets.SSH_MARIST_ALLSYS_PORT }} + - name: Store test output + uses: actions/upload-artifact@v4 + if: steps.zweconf.outcome != '' && failure() + with: + name: zweconf_test + path: | + pswi/**.txt + pswi/zowe.yaml - name: '[K8S] Build Kubernetes' timeout-minutes: 10 if: env.INPUTS_BUILD_KUBERNETES == 'true' diff --git a/pswi/051_test_workflows.sh b/pswi/051_test_workflows.sh index e27bdf11b1..fed47c1345 100644 --- a/pswi/051_test_workflows.sh +++ b/pswi/051_test_workflows.sh @@ -26,55 +26,3 @@ if [ $? -gt 0 ];then exit -1;fi echo "Registering/testing the configuration workflow ${TEST_MOUNT}/files/workflows/ZWECONF.xml" sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" if [ $? -gt 0 ];then exit -1;fi - -echo "Changing runtime path in ZWECONF.properties." - -cp ../workflows/files/ZWECONF.properties ./ZWECONF.properties -sed "s|runtimeDirectory=|runtimeDirectory=${WORK_MOUNT}|g" ./ZWECONF.properties > _ZWECONF -sed "s|java_home=|java_home=#delete_me#|g" _ZWECONF > ZWECONF -sed "s|node_home=|node_home=#delete_me#|g" ZWECONF > _ZWECONF - -echo "Changing the configuration workflow to be fully automated." - -cp ../workflows/files/ZWECONF.xml ./ZWECONF.xml -sed "s|false|true|g" ./ZWECONF.xml > ZWECONFX - -sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF -cd ${WORK_MOUNT} -put _ZWECONF -put ZWECONFX -EOF - -echo "Testing the configuration workflow ${WORK_MOUNT}/ZWECONFX" -sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "ZWECONF" "${WORK_MOUNT}/_ZWECONF" -if [ $? -gt 0 ];then exit -1;fi - -echo "Converting zowe.yaml" - -echo ${JOBST1} > JCL -echo ${JOBST2} >> JCL -echo "//UNPAXDIR 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 "iconv -f IBM-1047 -t ISO8859-1 zowe.yaml > zowe_.yaml;" >> JCL -echo "/*" >> JCL - -sh scripts/submit_jcl.sh "`cat JCL`" -if [ $? -gt 0 ];then exit -1;fi -rm JCL - -sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF -cd ${WORK_MOUNT} -get zowe_.yaml -EOF - -pwd - -cp ../example-zowe.yaml example-zowe.yaml - -diff --ed example-zowe.yaml zowe_.yaml > diff.txt || true - -diff --ed diff.txt scripts/base_diff.txt > final_diff.txt diff --git a/pswi/ZWECONF_test.sh b/pswi/ZWECONF_test.sh new file mode 100755 index 0000000000..bf22106ca8 --- /dev/null +++ b/pswi/ZWECONF_test.sh @@ -0,0 +1,63 @@ +ZOSMF_URL="https://zzow07.zowe.marist.cloud" +ZOSMF_PORT=10443 +JOBST1="//ZWECONF1 JOB (1),'PSWI',MSGCLASS=A,REGION=0M" +JOBST2="/*JOBPARM SYSAFF=(SOW1)" +export HOST=${ZOSMF_URL#https:\/\/} +export BASE_URL="${ZOSMF_URL}:${ZOSMF_PORT}" +WORK_MOUNT="/u/${ZOSMF_USER}" + +echo "Changing runtime path in ZWECONF.properties." + +cp ../workflows/files/ZWECONF.properties ./ZWECONF.properties +sed "s|runtimeDirectory=|runtimeDirectory=${WORK_MOUNT}|g" ./ZWECONF.properties > _ZWECONF +sed "s|java_home=|java_home=#delete_me#|g" _ZWECONF > ZWECONF +sed "s|node_home=|node_home=#delete_me#|g" ZWECONF > _ZWECONF + +echo "Changing the configuration workflow to be fully automated." + +cp ../workflows/files/ZWECONF.xml ./ZWECONF.xml +sed "s|false|true|g" ./ZWECONF.xml > ZWECONFX + +sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF +cd ${WORK_MOUNT} +put _ZWECONF +put ZWECONFX +EOF + +echo "Testing the configuration workflow ${WORK_MOUNT}/ZWECONFX" +sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "ZWECONF" "${WORK_MOUNT}/_ZWECONF" +if [ $? -gt 0 ];then exit -1;fi + +echo "Converting zowe.yaml" + +echo ${JOBST1} > JCL +echo ${JOBST2} >> JCL +echo "//UNPAXDIR 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 "iconv -f IBM-1047 -t ISO8859-1 zowe.yaml > zowe_.yaml;" >> JCL +echo "/*" >> JCL + +sh scripts/submit_jcl.sh "`cat JCL`" +if [ $? -gt 0 ];then exit -1;fi +rm JCL + +sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF +cd ${WORK_MOUNT} +get zowe_.yaml +rm zowe_.yaml +EOF + +pwd + +cp ../example-zowe.yaml example-zowe.yaml + +#delete runtimeDirectory= +sed -i "/runtimeDirectory=/d" zowe_.yaml > zowe.yaml + +diff --ed example-zowe.yaml zowe.yaml > diff.txt || true + +diff --ed diff.txt scripts/base_diff.txt > final_diff.txt diff --git a/pswi/scripts/base_diff.txt b/pswi/scripts/base_diff.txt index f0ebb0a0a2..1299bbdcdf 100644 --- a/pswi/scripts/base_diff.txt +++ b/pswi/scripts/base_diff.txt @@ -4,9 +4,6 @@ 468c home: "#delete_me#" . -281c - runtimeDirectory: "/u/zowead2/work" -. 106c # directory: . diff --git a/workflows/files/ZWECONF.properties b/workflows/files/ZWECONF.properties index 19b10127fc..ccf3efc3a8 100644 --- a/workflows/files/ZWECONF.properties +++ b/workflows/files/ZWECONF.properties @@ -393,53 +393,54 @@ components_zaas_port=7558 # Switch on the debug mode for the ZAAS components_zaas_debug=false -# components_zaas_apiml_security_auth_provider -# Label: ZAAS APIML security auth provider -# Abstract: Authorization provider for the ZAAS +# components_gateway_apiml_security_auth_provider +# Label: APIML security auth provider +# Abstract: Authorization provider for the gateway # Category: components # Description: -# Authorization provider for the ZAAS -components_zaas_apiml_security_auth_provider=zosmf +# Authorization provider for the gateway +components_gateway_apiml_security_auth_provider=zosmf -# components_zaas_apiml_security_auth_zosmf_jwtAutoconfiguration -# Label: ZAAS APIML security auth z/OSMF jwtAutoconfiguration +# components_gateway_apiml_security_auth_zosmf_jwtAutoconfiguration +# Label: APIML security auth z/OSMF jwtAutoconfiguration # Abstract: JWT auto configuration for gateway security auth # Category: components # Description: -# JWT auto configuration for ZAAS (Authentication) -components_zaas_apiml_security_auth_zosmf_jwtAutoconfiguration=jwt +# JWT auto configuration for gateway security auth +# Choices: jwt,ltpa +components_gateway_apiml_security_auth_zosmf_jwtAutoconfiguration=jwt -# components_zaas_apiml_security_auth_zosmf_serviceId -# Label: ZAAS APIML security auth z/OSMF serviceId -# Abstract: Service ID for ZAAS security auth +# components_gateway_apiml_security_auth_zosmf_serviceId +# Label: APIML security auth z/OSMF serviceId +# Abstract: Service ID for gateway security auth # Category: components # Description: -# Service ID for ZAAS security auth -components_zaas_apiml_security_auth_zosmf_serviceId=ibmzosmf +# Service ID for gateway security auth +components_gateway_apiml_security_auth_zosmf_serviceId=ibmzosmf -# components_zaas_apiml_security_authorization_endpoint_enabled -# Label: Enable ZAAS APIML security authorization endpoint +# components_gateway_apiml_security_authorization_endpoint_enabled +# Label: Enable APIML security authorization endpoint # Abstract: Use this to enable the security authorization endpoint # Category: components # Description: # Use this to enable the security authorization endpoint -components_zaas_apiml_security_authorization_endpoint_enabled=false +components_gateway_apiml_security_authorization_endpoint_enabled=false -# components_zaas_apiml_security_authorization_provider -# Label: ZAAS APIML security authorization provider -# Abstract: Security authorization provider for the ZAAS +# components_gateway_apiml_security_authorization_provider +# Label: APIML security authorization provider +# Abstract: Security authorization provider for the gateway # Category: components # Description: -# Security authorization provider for the ZAAS -components_zaas_apiml_security_authorization_provider=native +# Security authorization provider for the gateway +components_gateway_apiml_security_authorization_provider=native -# components_zaas_apiml_security_x509_enabled -# Label: Enable ZAAS APIML security x509 -# Abstract: Check to enable the ZAAS security x509 +# components_gateway_apiml_security_x509_enabled +# Label: Enable APIML security x509 +# Abstract: Check to enable the gateway security x509 # Category: components # Description: -# Check to enable the ZAAS security x509 -components_zaas_apiml_security_x509_enabled=false +# Check to enable the gateway security x509 +components_gateway_apiml_security_x509_enabled=false # components_api_catalog_enabled # Label: Enable API Catalog @@ -773,4 +774,4 @@ zowe_setup_security_stcs_aux=ZWESASTC # Check this option to enable the optional workflow step with zwe install command. After Zowe convenience build is extracted, # you can enable this flag to run the zwe install command to install MVS data sets within this workflow run. # This option is for convenience build only. SMP/E installs the MVS data sets during installation. -zowe_setup_installStep_enabled=false +zowe_setup_installStep_enabled=false \ No newline at end of file From 1ed3d5ca50b6f262f4b26065bc2269e4e380ba91 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Thu, 19 Sep 2024 17:09:56 +0200 Subject: [PATCH 47/54] export zosmf url and port Signed-off-by: mm667937 --- pswi/ZWECONF_test.sh | 5 +++-- pswi/scripts/wf_run_test.sh | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pswi/ZWECONF_test.sh b/pswi/ZWECONF_test.sh index bf22106ca8..f79f7eea98 100755 --- a/pswi/ZWECONF_test.sh +++ b/pswi/ZWECONF_test.sh @@ -1,5 +1,6 @@ -ZOSMF_URL="https://zzow07.zowe.marist.cloud" -ZOSMF_PORT=10443 +export ZOSMF_URL="https://zzow07.zowe.marist.cloud" +export ZOSMF_PORT=10443 +export ZOSMF_SYSTEM="S0W1" JOBST1="//ZWECONF1 JOB (1),'PSWI',MSGCLASS=A,REGION=0M" JOBST2="/*JOBPARM SYSAFF=(SOW1)" export HOST=${ZOSMF_URL#https:\/\/} diff --git a/pswi/scripts/wf_run_test.sh b/pswi/scripts/wf_run_test.sh index 97be62af26..e31a8e3c19 100755 --- a/pswi/scripts/wf_run_test.sh +++ b/pswi/scripts/wf_run_test.sh @@ -54,7 +54,6 @@ RESP=`curl -s $WORKFLOW_URL -k -X "DELETE" -H "Content-Type: application/json" - sh scripts/check_response.sh "${RESP}" $? fi -set -e # Create workflow with REST API echo 'Invoking REST API to create the workflow.' From bd1678cdaf8b8d46fb175304333b9a507a9cfc53 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Thu, 19 Sep 2024 17:22:14 +0200 Subject: [PATCH 48/54] store spool files as well Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index aab812231a..8ff2984030 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -392,6 +392,7 @@ jobs: path: | pswi/**.txt pswi/zowe.yaml + pswi/ZWECONF1/** - name: '[K8S] Build Kubernetes' timeout-minutes: 10 if: env.INPUTS_BUILD_KUBERNETES == 'true' From 7c736c32455d2840e0c70ffb645ca8aebdbad2e6 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Thu, 19 Sep 2024 17:26:43 +0200 Subject: [PATCH 49/54] parameters Signed-off-by: mm667937 --- pswi/ZWECONF_test.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pswi/ZWECONF_test.sh b/pswi/ZWECONF_test.sh index f79f7eea98..b5371432dd 100755 --- a/pswi/ZWECONF_test.sh +++ b/pswi/ZWECONF_test.sh @@ -1,8 +1,7 @@ export ZOSMF_URL="https://zzow07.zowe.marist.cloud" export ZOSMF_PORT=10443 export ZOSMF_SYSTEM="S0W1" -JOBST1="//ZWECONF1 JOB (1),'PSWI',MSGCLASS=A,REGION=0M" -JOBST2="/*JOBPARM SYSAFF=(SOW1)" +export JOBNAME="ZWECONF1" export HOST=${ZOSMF_URL#https:\/\/} export BASE_URL="${ZOSMF_URL}:${ZOSMF_PORT}" WORK_MOUNT="/u/${ZOSMF_USER}" @@ -31,8 +30,8 @@ if [ $? -gt 0 ];then exit -1;fi echo "Converting zowe.yaml" -echo ${JOBST1} > JCL -echo ${JOBST2} >> JCL +echo "//${ZOSMF_SYSTEM} JOB (1),'PSWI',MSGCLASS=A,REGION=0M" > JCL +echo "/*JOBPARM SYSAFF=(${ZOSMF_SYSTEM})" >> JCL echo "//UNPAXDIR EXEC PGM=BPXBATCH" >> JCL echo "//STDOUT DD SYSOUT=*" >> JCL echo "//STDERR DD SYSOUT=*" >> JCL From e64d167991b59e6e65ac094e0262c79f73764209 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Fri, 20 Sep 2024 10:43:39 +0200 Subject: [PATCH 50/54] saving zowe_.yaml for debugging Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index 8ff2984030..b660a462b4 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -392,6 +392,7 @@ jobs: path: | pswi/**.txt pswi/zowe.yaml + pswi/zowe_.yaml pswi/ZWECONF1/** - name: '[K8S] Build Kubernetes' timeout-minutes: 10 From 9299d211b5b7d9680ed2f5422a9bd1256378e2fa Mon Sep 17 00:00:00 2001 From: mm667937 Date: Fri, 20 Sep 2024 11:00:47 +0200 Subject: [PATCH 51/54] changed work mount to '/tmp' so now we don't have to delete the line with runtimeDirectory Signed-off-by: mm667937 --- pswi/ZWECONF_test.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pswi/ZWECONF_test.sh b/pswi/ZWECONF_test.sh index b5371432dd..346c997e45 100755 --- a/pswi/ZWECONF_test.sh +++ b/pswi/ZWECONF_test.sh @@ -4,7 +4,7 @@ export ZOSMF_SYSTEM="S0W1" export JOBNAME="ZWECONF1" export HOST=${ZOSMF_URL#https:\/\/} export BASE_URL="${ZOSMF_URL}:${ZOSMF_PORT}" -WORK_MOUNT="/u/${ZOSMF_USER}" +WORK_MOUNT="/tmp" echo "Changing runtime path in ZWECONF.properties." @@ -55,9 +55,6 @@ pwd cp ../example-zowe.yaml example-zowe.yaml -#delete runtimeDirectory= -sed -i "/runtimeDirectory=/d" zowe_.yaml > zowe.yaml - -diff --ed example-zowe.yaml zowe.yaml > diff.txt || true +diff --ed example-zowe.yaml zowe_.yaml > diff.txt || true diff --ed diff.txt scripts/base_diff.txt > final_diff.txt From 451d16c7bc302d8f473443b4df58d909a2f9e999 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Fri, 20 Sep 2024 11:20:25 +0200 Subject: [PATCH 52/54] runtime directory back Signed-off-by: mm667937 --- pswi/scripts/base_diff.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pswi/scripts/base_diff.txt b/pswi/scripts/base_diff.txt index 1299bbdcdf..d23d5ebdc1 100644 --- a/pswi/scripts/base_diff.txt +++ b/pswi/scripts/base_diff.txt @@ -4,6 +4,9 @@ 468c home: "#delete_me#" . +281c + runtimeDirectory: "/tmp" +. 106c # directory: . From 3b930d97dd8575f72cc531d5f9086d174cf831b8 Mon Sep 17 00:00:00 2001 From: mm667937 Date: Fri, 20 Sep 2024 14:15:42 +0200 Subject: [PATCH 53/54] at least try to anonymize something Signed-off-by: mm667937 --- .github/workflows/build-packaging.yml | 1 - pswi/PSWI-marist.sh | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index b660a462b4..7edb5a01d7 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -391,7 +391,6 @@ jobs: name: zweconf_test path: | pswi/**.txt - pswi/zowe.yaml pswi/zowe_.yaml pswi/ZWECONF1/** - name: '[K8S] Build Kubernetes' diff --git a/pswi/PSWI-marist.sh b/pswi/PSWI-marist.sh index 5a9e03bfa7..67fcedf490 100755 --- a/pswi/PSWI-marist.sh +++ b/pswi/PSWI-marist.sh @@ -2,12 +2,12 @@ set -x export ZOSMF_URL="https://zzow07.zowe.marist.cloud" export ZOSMF_PORT=10443 export ZOSMF_SYSTEM="S0W1" -export DIR="/u/zowead2" -export SMPEHLQ="ZOWEAD2" -export TMP_ZFS="ZOWEAD2.TMP.ZFS" +export DIR="/u/${ZOSMF_USER,,}" +export SMPEHLQ="${ZOSMF_USER}" +export TMP_ZFS="${ZOSMF_USER}.TMP.ZFS" export ZOWE_MOUNT="/u/zwe/zowe-smpe/" export VOLUME="ZOS003" -export TEST_HLQ="ZOWEAD2.PSWIT" +export TEST_HLQ="${ZOSMF_USER}.PSWIT" export SYSAFF="(S0W1)" export ACCOUNT=1 @@ -30,7 +30,7 @@ export TMP_MOUNT="${DIR}/zowe-tmp" export TEST_MOUNT="${DIR}/test_mount" export EXPORT="${TMP_MOUNT}/export/" export WORK_MOUNT="${DIR}/work" -export WORK_ZFS="ZOWEAD2.WORK.ZFS" +export WORK_ZFS="${ZOSMF_USER}.WORK.ZFS" export ZOSMF_V="2.3" export SMPE_WF_NAME="ZOWE_SMPE_WF" export PTF_WF_NAME="ZOWE_PTF_WF" From 3f3eafb39cfcf4a8d59738ad6aaa33cae3b66503 Mon Sep 17 00:00:00 2001 From: MarkAckert Date: Fri, 20 Sep 2024 11:40:51 -0400 Subject: [PATCH 54/54] make zowe config check a separate workflow Signed-off-by: MarkAckert --- .github/workflows/build-packaging.yml | 22 +-------- .github/workflows/pswi-zowe-config-test.yml | 52 +++++++++++++++++++++ 2 files changed, 54 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/pswi-zowe-config-test.yml diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index 7edb5a01d7..267ac7ea05 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -353,7 +353,6 @@ jobs: jfrog rt dl ${{github.event.inputs.PSWI_SMPE_AZWE_ARTIFACTORY_PATH}}/AZWE002*.zip --flat=true .pax/AZWE002.zip jfrog rt dl ${{github.event.inputs.PSWI_SMPE_ARTIFACTORY_PATH}}/zowe-smpe-*.zip --flat=true .pax/zowe-smpe.zip - - name: '[SMPE Pax 4] Build PSWI' id: pswi if: env.INPUTS_BUILD_PSWI == 'true' @@ -367,6 +366,7 @@ jobs: ZOSMF_PASS: ${{ secrets.ZOWE_PSWI_BUILD_PASSWD }} ZZOW_SSH_PORT: ${{ secrets.SSH_MARIST_ALLSYS_PORT }} VERSION: ${{ env.P_VERSION }} + - name: Store PSWI folder uses: actions/upload-artifact@v4 if: env.INPUTS_BUILD_PSWI == 'true' && failure() @@ -374,25 +374,7 @@ jobs: name: pswi-folder path: | pswi/** - - name: 'Test ZWECONF workflow' - id: zweconf - timeout-minutes: 30 - run: | - cd pswi - ./ZWECONF_test.sh - env: - ZOSMF_USER: ${{ secrets.ZOWE_PSWI_BUILD_USR }} - ZOSMF_PASS: ${{ secrets.ZOWE_PSWI_BUILD_PASSWD }} - ZZOW_SSH_PORT: ${{ secrets.SSH_MARIST_ALLSYS_PORT }} - - name: Store test output - uses: actions/upload-artifact@v4 - if: steps.zweconf.outcome != '' && failure() - with: - name: zweconf_test - path: | - pswi/**.txt - pswi/zowe_.yaml - pswi/ZWECONF1/** + - name: '[K8S] Build Kubernetes' timeout-minutes: 10 if: env.INPUTS_BUILD_KUBERNETES == 'true' diff --git a/.github/workflows/pswi-zowe-config-test.yml b/.github/workflows/pswi-zowe-config-test.yml new file mode 100644 index 0000000000..96d666ba34 --- /dev/null +++ b/.github/workflows/pswi-zowe-config-test.yml @@ -0,0 +1,52 @@ +name: PSWI zowe.yaml sync check + +permissions: + id-token: write + issues: write + pull-requests: write + contents: write + +on: + push: + branches: + - v3.x/staging + pull_request: + types: [opened, synchronize] + workflow_dispatch: + +jobs: + test-pswi-zowe-yaml: + runs-on: ubuntu-latest + steps: + + - name: '[Prep 1] Checkout' + uses: actions/checkout@v4 + + - name: '[PSI-LOCK] Lock marist servers to build PSWI' + uses: zowe-actions/shared-actions/lock-resource@main + with: + lock-repository: ${{ github.repository }} + github-token: ${{ secrets.GITHUB_TOKEN }} + lock-resource-name: zowe-psi-build-zzow07-lock + lock-avg-retry-interval: 30 + + - name: 'Test ZWECONF workflow' + id: zweconf + timeout-minutes: 30 + run: | + cd pswi + ./ZWECONF_test.sh + env: + ZOSMF_USER: ${{ secrets.ZOWE_PSWI_BUILD_USR }} + ZOSMF_PASS: ${{ secrets.ZOWE_PSWI_BUILD_PASSWD }} + ZZOW_SSH_PORT: ${{ secrets.SSH_MARIST_ALLSYS_PORT }} + + - name: Store test output + uses: actions/upload-artifact@v4 + if: steps.zweconf.outcome != '' && failure() + with: + name: zweconf_test + path: | + pswi/**.txt + pswi/zowe_.yaml + pswi/ZWECONF1/**