Simple testing framework for zwe
command
- z/OS 2.5+
- Unix system services
- Existing
zowe.runtimeDirectory
- Convenience build
Clone this repository to uss
.
You need to set environment variable ZWET_ZOWE_RUNTIME_DIRECTORY=/path/to/zowe/runtime
, there are several options:
- Update
zwe-test.conf
file - Add this variable to your shell profile
- Start the script with export, for example
export ZWET_ZOWE_RUNTIME_DIRECTORY=/path/to/zowe/runtime && ./run_test.sh
Run run_test.sh
, there are 2 tests: help for zwe
command and helloWorld.js
script.
If you can see the help and Hello, world!
, everything was set correctly.
testCases.js
is used for defining the tests.
export const ALL = {
// This is the default test
zweHelp: {
expected: 100,
parms: '--help'
},
zweInstallExample: {
desc: 'zwe install',
environment: [
[ 'NODE_HOME', '' , env.KEEP ]
],
expected: {
rc: 0,
substr: [
'Install Zowe MVS data sets',
'Zowe MVS data sets are installed successfully.'
]
},
parms: `install -c ${misc.makeYaml('install', yaml.INSTALL)}`,
after: {
listDS: 'ZOWE.TEST.*'
}
}
};
desc
- description of a testbefore
andafter
actionslistDS
,listMB
,deleteDS
,allocJCL
,allocLoad
andshellCmd
- Note:
deleteDS
supportsMASK
- Note:
environment
variables, keep, restore or unset at the end of the current testexpected
- if omitted, it is expectedrc=0
rc
- return codesubstr
- substring to be foundsubstrx
- substring NOT to be foundout
- entire output to match
parms
of thezwe
command,parms: "install --ds-prefix ZOWE --trace"
script
- path to the script, which will be executed byconfigmgr