Skip to content

Commit

Permalink
Merge pull request #2339 from zowe/fix-system-tests-for-mac
Browse files Browse the repository at this point in the history
Fix system tests for mac
  • Loading branch information
awharn authored Nov 1, 2024
2 parents 97402aa + dbe3e4a commit 952c1ac
Show file tree
Hide file tree
Showing 54 changed files with 477 additions and 257 deletions.
2 changes: 2 additions & 0 deletions __tests__/__resources__/properties/default_properties.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ zosjobs:
modifiedJobclass: B
# System affinity
sysaff: zosjobs-sysaff
# CIM Support
skipCIM: false
#-----------------------------------------------------------------------------#
# Set of properties for testing provisioning #
#-----------------------------------------------------------------------------#
Expand Down
1 change: 1 addition & 0 deletions __tests__/__src__/properties/ITestZosJobsSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export interface ITestZosJobsSchema {
jobclass: string;
modifiedJobclass: string;
sysaff: string;
skipCIM?: boolean;
}
4 changes: 4 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the Zowe CLI package will be documented in this file.

## Recent Changes

- BugFix: Fixed an issue where the `zowe zos-logs list logs` command could fail or not return all logs if a start time was not supplied. [#2336](https://github.com/zowe/zowe-cli/pull/2336)

## `8.6.0`

- Enhancement: Added support for running applications on TSO/E address spaces. Start applications and receive/transmit messages using the new `tso start`, `tso receive` and `tso send` commands. [#2280](https://github.com/zowe/zowe-cli/pull/2280)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
set -e

HOST=$1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
set -e

HOST=$1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
set -e

zowe config auto-init
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ describe("config auto-init without profile", () => {
base.rejectUnauthorized
]
);
expect(response.status).toEqual(0);

const config = fs.readFileSync(path.join(TEST_ENVIRONMENT.workingDir, "zowe.config.json")).toString();
// Typecasting because of this issue: https://github.com/kaelzhang/node-comment-json/issues/42
Expand Down Expand Up @@ -107,6 +108,7 @@ describe("config auto-init without profile", () => {
base.rejectUnauthorized
]
);
expect(response.status).toEqual(0);

config = fs.readFileSync(path.join(TEST_ENVIRONMENT.workingDir, "zowe.config.json")).toString();
// Typecasting because of this issue: https://github.com/kaelzhang/node-comment-json/issues/42
Expand Down Expand Up @@ -186,6 +188,7 @@ describe("config auto-init without profile and with certificates", () => {
base.rejectUnauthorized
]
);
expect(response.status).toEqual(0);

const config = fs.readFileSync(path.join(TEST_ENVIRONMENT.workingDir, "zowe.config.json")).toString();
// Typecasting because of this issue: https://github.com/kaelzhang/node-comment-json/issues/42
Expand Down Expand Up @@ -254,6 +257,7 @@ describe("config auto-init without profile and with certificates", () => {
base.rejectUnauthorized
]
);
expect(response.status).toEqual(0);

config = fs.readFileSync(path.join(TEST_ENVIRONMENT.workingDir, "zowe.config.json")).toString();
// Typecasting because of this issue: https://github.com/kaelzhang/node-comment-json/issues/42
Expand Down Expand Up @@ -319,6 +323,7 @@ describe("config auto-init with profile", () => {

it("should successfully issue the auto-init command", () => {
const response = runCliScript(__dirname + "/__scripts__/config_auto_init_profile.sh", TEST_ENVIRONMENT);
expect(response.status).toEqual(0);

const config = fs.readFileSync(path.join(TEST_ENVIRONMENT.workingDir, "zowe.config.json")).toString();
// Typecasting because of this issue: https://github.com/kaelzhang/node-comment-json/issues/42
Expand Down Expand Up @@ -379,6 +384,7 @@ describe("config auto-init with profile and certificates", () => {

it("should successfully issue the auto-init command", () => {
const response = runCliScript(__dirname + "/__scripts__/config_auto_init_profile.sh", TEST_ENVIRONMENT);
expect(response.status).toEqual(0);

const config = fs.readFileSync(path.join(TEST_ENVIRONMENT.workingDir, "zowe.config.json")).toString();
// Typecasting because of this issue: https://github.com/kaelzhang/node-comment-json/issues/42
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ then
exit $RC
fi

sleep 1

# Cancel the job
zowe jobs cancel job $JOBID
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ then
exit $RC
fi

sleep 1

# Cancel the job
zowe jobs cancel job $JOBID --host $HOST --port $PORT --user $USER --password $PASS --ru=false
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ then
exit $RC
fi

sleep 1

# Cancel the job 1
zowe jobs cancel job $JOBID --modify-version 1.0
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ then
exit $RC
fi

sleep 1

# Cancel the job
zowe jobs cancel job $JOBID --host $HOST --port $PORT --user $USER --password $PASS --ru=false --modify-version 1.0
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ then
exit $RC
fi

sleep 1

# Cancel the job 1
zowe jobs cancel job $JOBID --modify-version 2.0
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ then
exit $RC
fi

sleep 1

# Cancel the job 1
zowe jobs cancel job $JOBID --modify-version 2.0
RC=$?
Expand All @@ -26,6 +28,8 @@ then
exit $RC
fi

sleep 1

# Cancel the job 2
zowe jobs cancel job $JOBID --modify-version 2.0
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ then
exit $RC
fi

sleep 1

# Cancel the job
zowe jobs cancel job $JOBID --host $HOST --port $PORT --user $USER --password $PASS --ru=false --modify-version 2.0
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ let TEST_ENVIRONMENT: ITestEnvironment<ITestPropertiesSchema>;
const LOCAL_JCL_FILE: string = __dirname + "/" + "testFileOfLocalJCL.txt";
const jobDataRegexV1 = /Successfully submitted request to cancel job (\w+) \((JOB\d+)\)/;
const jobDataRegex = /Successfully canceled job (\w+) \((JOB\d+)\)/;
const modifyVersionDefaultUsesCIM = false;

describe("zos-jobs cancel job command", () => {
// Create the unique test environment
Expand Down Expand Up @@ -73,13 +74,17 @@ describe("zos-jobs cancel job command", () => {

describe("successful scenario", () => {
it("should cancel a job v1", () => {
const response = runCliScript(__dirname + "/__scripts__/job/cancel_job_v1.sh", TEST_ENVIRONMENT, [LOCAL_JCL_FILE]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toContain("Successfully submitted request to cancel job");
if (TEST_ENVIRONMENT.systemTestProperties.zosjobs.skipCIM) {
process.stdout.write("Skipping test because skipCIM is set.");
} else {
const response = runCliScript(__dirname + "/__scripts__/job/cancel_job_v1.sh", TEST_ENVIRONMENT, [LOCAL_JCL_FILE]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toContain("Successfully submitted request to cancel job");

const jobid = response.stdout.toString().match(jobDataRegexV1).pop();
TEST_ENVIRONMENT.resources.jobs.push(jobid);
const jobid = response.stdout.toString().match(jobDataRegexV1).pop();
TEST_ENVIRONMENT.resources.jobs.push(jobid);
}
});

it("should cancel a job v2", () => {
Expand All @@ -94,15 +99,19 @@ describe("zos-jobs cancel job command", () => {
});

it("should cancel a job default", () => {
const response = runCliScript(__dirname + "/__scripts__/job/cancel_job.sh", TEST_ENVIRONMENT, [LOCAL_JCL_FILE]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toContain("Successfully canceled job");
expect(response.stdout.toString()).not.toContain("Failed to cancel job");
expect(response.stdout.toString()).not.toContain("Failed to cancel job");
if (TEST_ENVIRONMENT.systemTestProperties.zosjobs.skipCIM && modifyVersionDefaultUsesCIM) {
process.stdout.write("Skipping test because skipCIM is set.");
} else {
const response = runCliScript(__dirname + "/__scripts__/job/cancel_job.sh", TEST_ENVIRONMENT, [LOCAL_JCL_FILE]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toContain("Successfully canceled job");
expect(response.stdout.toString()).not.toContain("Failed to cancel job");
expect(response.stdout.toString()).not.toContain("Failed to cancel job");

const jobid = response.stdout.toString().match(jobDataRegex).pop();
TEST_ENVIRONMENT.resources.jobs.push(jobid);
const jobid = response.stdout.toString().match(jobDataRegex).pop();
TEST_ENVIRONMENT.resources.jobs.push(jobid);
}
});

describe("without profiles", () => {
Expand All @@ -124,21 +133,25 @@ describe("zos-jobs cancel job command", () => {
});

it("cancel a job without a profile 1.0", async () => {
const response = runCliScript(__dirname + "/__scripts__/job/cancel_job_v1_fully_qualified.sh",
TEST_ENVIRONMENT_NO_PROF,
[
LOCAL_JCL_FILE,
DEFAULT_SYSTEM_PROPS.zosmf.host,
DEFAULT_SYSTEM_PROPS.zosmf.port,
DEFAULT_SYSTEM_PROPS.zosmf.user,
DEFAULT_SYSTEM_PROPS.zosmf.password,
]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toContain("Successfully submitted request to cancel job");

const jobid = response.stdout.toString().match(jobDataRegexV1).pop();
TEST_ENVIRONMENT_NO_PROF.resources.jobs.push(jobid);
if (TEST_ENVIRONMENT.systemTestProperties.zosjobs.skipCIM) {
process.stdout.write("Skipping test because skipCIM is set.");
} else {
const response = runCliScript(__dirname + "/__scripts__/job/cancel_job_v1_fully_qualified.sh",
TEST_ENVIRONMENT_NO_PROF,
[
LOCAL_JCL_FILE,
DEFAULT_SYSTEM_PROPS.zosmf.host,
DEFAULT_SYSTEM_PROPS.zosmf.port,
DEFAULT_SYSTEM_PROPS.zosmf.user,
DEFAULT_SYSTEM_PROPS.zosmf.password,
]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toContain("Successfully submitted request to cancel job");

const jobid = response.stdout.toString().match(jobDataRegexV1).pop();
TEST_ENVIRONMENT_NO_PROF.resources.jobs.push(jobid);
}
});

it("cancel a job without a profile 2.0", async () => {
Expand All @@ -160,21 +173,25 @@ describe("zos-jobs cancel job command", () => {
});

it("cancel a job without a profile default", async () => {
const response = runCliScript(__dirname + "/__scripts__/job/cancel_job_fully_qualified.sh",
TEST_ENVIRONMENT_NO_PROF,
[
LOCAL_JCL_FILE,
DEFAULT_SYSTEM_PROPS.zosmf.host,
DEFAULT_SYSTEM_PROPS.zosmf.port,
DEFAULT_SYSTEM_PROPS.zosmf.user,
DEFAULT_SYSTEM_PROPS.zosmf.password,
]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toContain("Successfully canceled job");

const jobid = response.stdout.toString().match(jobDataRegex).pop();
TEST_ENVIRONMENT_NO_PROF.resources.jobs.push(jobid);
if (TEST_ENVIRONMENT.systemTestProperties.zosjobs.skipCIM && modifyVersionDefaultUsesCIM) {
process.stdout.write("Skipping test because skipCIM is set.");
} else {
const response = runCliScript(__dirname + "/__scripts__/job/cancel_job_fully_qualified.sh",
TEST_ENVIRONMENT_NO_PROF,
[
LOCAL_JCL_FILE,
DEFAULT_SYSTEM_PROPS.zosmf.host,
DEFAULT_SYSTEM_PROPS.zosmf.port,
DEFAULT_SYSTEM_PROPS.zosmf.user,
DEFAULT_SYSTEM_PROPS.zosmf.password,
]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toContain("Successfully canceled job");

const jobid = response.stdout.toString().match(jobDataRegex).pop();
TEST_ENVIRONMENT_NO_PROF.resources.jobs.push(jobid);
}
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ then
fi

# Loop until the job goes to the output queue
until [ $ATTEMPTS -gt 0 ]
until [ $ATTEMPTS -lt 1 ]
do
STATUS=`zowe jobs view job-status-by-jobid $JOBID --rff status --rft string`
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ then
fi

# Loop until the job goes to the output queue
until [ $ATTEMPTS -gt 0 ]
until [ $ATTEMPTS -lt 1 ]
do
STATUS=`zowe jobs view job-status-by-jobid $JOBID --host $HOST --port $PORT --user $USER --password $PASS --ru=false --rff status --rft string`
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ then
fi

# Loop until the job goes to the output queue
until [ $ATTEMPTS -gt 0 ]
until [ $ATTEMPTS -lt 1 ]
do
STATUS=`zowe jobs view job-status-by-jobid $JOBID --rff status --rft string`
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ then
fi

# Loop until the job goes to the output queue
until [ $ATTEMPTS -gt 0 ]
until [ $ATTEMPTS -lt 1 ]
do
STATUS=`zowe jobs view job-status-by-jobid $JOBID --host $HOST --port $PORT --user $USER --password $PASS --ru=false --rff status --rft string`
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ then
fi

# Loop until the job goes to the output queue
until [ $ATTEMPTS -gt 0 ]
until [ $ATTEMPTS -lt 1 ]
do
STATUS=`zowe jobs view job-status-by-jobid $JOBID --rff status --rft string`
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ then
fi

# Loop until the job goes to the output queue
until [ $ATTEMPTS -gt 0 ]
until [ $ATTEMPTS -lt 1 ]
do
STATUS=`zowe jobs view job-status-by-jobid $JOBID --host $HOST --port $PORT --user $USER --password $PASS --ru=false --rff status --rft string`
RC=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ then
fi

# Loop until the job goes to the output queue
until [ $ATTEMPTS -gt 0 ]
until [ $ATTEMPTS -lt 1 ]
do
STATUS=`zowe jobs view job-status-by-jobid $JOBID --rff status --rft string`
RC=$?
Expand Down
Loading

0 comments on commit 952c1ac

Please sign in to comment.