Simple testing framework for zwe
command
- z/OS 2.5+
- Unix system services
- Existing
zowe.runtimeDirectory
- Convenience build
Clone this repository to uss
.
Run initTemplate.sh
with path to zowe.runtimeDirectory
as a parameter:
$ ./initTemplate.sh /u/charles/zowe/
Run run_test.sh
, there is one predefined test: help for zwe
command.
If you can see the help, it 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
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"
yamlFiles.js
is used for creating YAML files, it is possible to save it as unix file or member. YAML is created from text, it is up to you to follow YAML syntax (no schema validation).
Corresponding definition for previous test example:
export const INSTALL = [
"zowe:",
" setup:",
" dataset:",
" prefix: ZOWE.TEST"
]