Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #635 in Latest / V1-LTS #648

Merged
merged 22 commits into from
Jan 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions __tests__/__src__/TestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,8 @@ export async function getTag(session: AbstractSession, ussPath: string) {
return response.stdout[0];
}

export function delay(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms) );
}

export const delTime = 500;
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
hlq1=$1
set -e

echo "================Z/OS FILES CREATE DATA-SET-BINARY==============="
zowe zos-files create data-set-binary "$1.test.data.set.binary.primary" --ps 20 --pa
if [ $? -gt 0 ]
then
exit $?
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
hlq1=$1
set -e

echo "================Z/OS FILES CREATE DATA-SET-BINARY==============="
zowe zos-files create data-set-binary "$1.test.data.set.binary.second" --ps 20 --ss 5 --pa
if [ $? -gt 0 ]
then
exit $?
fi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ hlq1=$1
set -e

echo "================Z/OS FILES CREATE DATA-SET-BINARY==============="
zowe zos-files create data-set-partitioned "$1.test.data.set.binary.size" --size 2CYL
zowe zos-files create data-set-partitioned "$1.test.data.set.binary.size" --size 2CYL --pa
if [ $? -gt 0 ]
then
exit $?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,47 @@ exports[`Create Binary Data Set Success scenarios should create a binary partiti
}"
`;

exports[`Create Binary Data Set Success scenarios should create a binary partitioned data set with specified primary allocation 1`] = `
"================Z/OS FILES CREATE DATA-SET-BINARY===============
dsorg: PO
alcunit: CYL
primary: 20
recfm: U
blksize: 27998
lrecl: 27998
dirblk: 25
secondary: 10

Data set created successfully.
"
`;

exports[`Create Binary Data Set Success scenarios should create a binary partitioned data set with specified primary and secondary allocation 1`] = `
"================Z/OS FILES CREATE DATA-SET-BINARY===============
dsorg: PO
alcunit: CYL
primary: 20
recfm: U
blksize: 27998
lrecl: 27998
dirblk: 25
secondary: 5

Data set created successfully.
"
`;

exports[`Create Binary Data Set Success scenarios should create a binary partitioned data set with specified size 1`] = `
"================Z/OS FILES CREATE DATA-SET-BINARY===============
alcunit: CYL
dsorg: PO
primary: 2
dirblk: 5
recfm: FB
blksize: 6160
lrecl: 80
secondary: 0

Data set created successfully.
"
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

import { Session } from "@zowe/imperative";
import { runCliScript } from "../../../../../../../__tests__/__src__/TestUtils";
import { runCliScript, delay, delTime } from "../../../../../../../__tests__/__src__/TestUtils";
import { TestEnvironment } from "../../../../../../../__tests__/__src__/environment/TestEnvironment";
import { ITestEnvironment } from "../../../../../../../__tests__/__src__/environment/doc/response/ITestEnvironment";
import { ITestPropertiesSchema } from "../../../../../../../__tests__/__src__/properties/ITestPropertiesSchema";
Expand Down Expand Up @@ -67,6 +67,7 @@ describe("Create Binary Data Set", () => {
afterEach(async () => {
// use DELETE APIs
if (dsnameSuffix !== "") {
await delay(delTime);
const response = await Delete.dataSet(REAL_SESSION, dsname + "." + dsnameSuffix);
}
});
Expand Down Expand Up @@ -101,6 +102,7 @@ describe("Create Binary Data Set", () => {
afterEach(async () => {
// use DELETE APIs
if (dsnameSuffix !== "") {
await delay(delTime);
const response = await Delete.dataSet(REAL_SESSION, dsname + "." + dsnameSuffix);
}
});
Expand Down Expand Up @@ -131,6 +133,24 @@ describe("Create Binary Data Set", () => {
expect(response.status).toBe(0);
expect(response.stdout.toString()).toMatchSnapshot();
});

it("should create a binary partitioned data set with specified primary allocation", () => {
dsnameSuffix = "binary.primary";
const response = runCliScript(__dirname + "/__scripts__/command/command_create_binary_pds_with_primary.sh",
TEST_ENVIRONMENT, [user]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toMatchSnapshot();
});

it("should create a binary partitioned data set with specified primary and secondary allocation", () => {
dsnameSuffix = "binary.second";
const response = runCliScript(__dirname + "/__scripts__/command/command_create_binary_pds_with_primary_secondary.sh",
TEST_ENVIRONMENT, [user]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toMatchSnapshot();
});
});

describe("Expected failures", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
hlq1=$1
set -e

echo "================Z/OS FILES CREATE DATA-SET-C==============="
zowe zos-files create data-set-c "$1.test.data.set.c.primary" --ps 20 --pa
if [ $? -gt 0 ]
then
exit $?
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
hlq1=$1
set -e

echo "================Z/OS FILES CREATE DATA-SET-C==============="
zowe zos-files create data-set-c "$1.test.data.set.c.second" --ps 20 --ss 5 --pa
if [ $? -gt 0 ]
then
exit $?
fi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ hlq=$1
set -e

echo "================Z/OS FILES CREATE DATA-SET-C==============="
zowe zos-files create data-set-c "$1.test.data.set.c.size" --size 2CYL
zowe zos-files create data-set-c "$1.test.data.set.c.size" --size 2CYL --pa
if [ $? -gt 0 ]
then
exit $?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,47 @@ exports[`Create C Data Set Success scenarios should create a c partitioned data
}"
`;

exports[`Create C Data Set Success scenarios should create a c partitioned data set with specified primary allocation 1`] = `
"================Z/OS FILES CREATE DATA-SET-C===============
dsorg: PO
alcunit: CYL
primary: 20
recfm: VB
blksize: 32760
lrecl: 260
dirblk: 25
secondary: 1

Data set created successfully.
"
`;

exports[`Create C Data Set Success scenarios should create a c partitioned data set with specified primary and secondary allocation 1`] = `
"================Z/OS FILES CREATE DATA-SET-C===============
dsorg: PO
alcunit: CYL
primary: 20
recfm: VB
blksize: 32760
lrecl: 260
dirblk: 25
secondary: 5

Data set created successfully.
"
`;

exports[`Create C Data Set Success scenarios should create a c partitioned data set with specified size 1`] = `
"================Z/OS FILES CREATE DATA-SET-C===============
dsorg: PO
alcunit: CYL
primary: 2
recfm: VB
blksize: 32760
lrecl: 260
dirblk: 25
secondary: 0

Data set created successfully.
"
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

import { Session } from "@zowe/imperative";
import { runCliScript } from "../../../../../../../__tests__/__src__/TestUtils";
import { runCliScript, delay, delTime } from "../../../../../../../__tests__/__src__/TestUtils";
import { TestEnvironment } from "../../../../../../../__tests__/__src__/environment/TestEnvironment";
import { ITestEnvironment } from "../../../../../../../__tests__/__src__/environment/doc/response/ITestEnvironment";
import { ITestPropertiesSchema } from "../../../../../../../__tests__/__src__/properties/ITestPropertiesSchema";
Expand Down Expand Up @@ -67,6 +67,7 @@ describe("Create C Data Set", () => {
afterEach(async () => {
// use DELETE APIs
if (dsnameSuffix !== "") {
await delay(delTime);
const response = await Delete.dataSet(REAL_SESSION, dsname + "." + dsnameSuffix);
}
});
Expand Down Expand Up @@ -102,6 +103,7 @@ describe("Create C Data Set", () => {
afterEach(async () => {
// use DELETE APIs
if (dsnameSuffix !== "") {
await delay(delTime);
const response = await Delete.dataSet(REAL_SESSION, dsname + "." + dsnameSuffix);
}
});
Expand Down Expand Up @@ -132,6 +134,24 @@ describe("Create C Data Set", () => {
expect(response.status).toBe(0);
expect(response.stdout.toString()).toMatchSnapshot();
});

it("should create a c partitioned data set with specified primary allocation", () => {
dsnameSuffix = "c.primary";
const response = runCliScript(__dirname + "/__scripts__/command/command_create_c_pds_with_primary.sh",
TEST_ENVIRONMENT, [user]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toMatchSnapshot();
});

it("should create a c partitioned data set with specified primary and secondary allocation", () => {
dsnameSuffix = "c.second";
const response = runCliScript(__dirname + "/__scripts__/command/command_create_c_pds_with_primary_secondary.sh",
TEST_ENVIRONMENT, [user]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toMatchSnapshot();
});
});

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
hlq1=$1
set -e

echo "================Z/OS FILES CREATE DATA-SET-CLASSIC==============="
zowe zos-files create data-set-classic "$1.test.data.set.classic.primary" --ps 20 --pa
if [ $? -gt 0 ]
then
exit $?
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
hlq1=$1
set -e

echo "================Z/OS FILES CREATE DATA-SET-CLASSIC==============="
zowe zos-files create data-set-classic "$1.test.data.set.classic.second" --ps 20 --ss 5 --pa
if [ $? -gt 0 ]
then
exit $?
fi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ hlq=$1
set -e

echo "================Z/OS FILES CREATE DATA-SET-CLASSIC==============="
zowe zos-files create data-set-classic "$1.test.data.set.classic.size" --size 2CYL
zowe zos-files create data-set-classic "$1.test.data.set.classic.size" --size 2CYL --pa
if [ $? -gt 0 ]
then
exit $?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,47 @@ exports[`Create Classic Data Set Success scenarios should create a classic parti
}"
`;

exports[`Create Classic Data Set Success scenarios should create a classic partitioned data set with specified primary allocation 1`] = `
"================Z/OS FILES CREATE DATA-SET-CLASSIC===============
alcunit: CYL
dsorg: PO
primary: 20
recfm: FB
blksize: 6160
lrecl: 80
dirblk: 25
secondary: 1

Data set created successfully.
"
`;

exports[`Create Classic Data Set Success scenarios should create a classic partitioned data set with specified primary and secondary allocation 1`] = `
"================Z/OS FILES CREATE DATA-SET-CLASSIC===============
alcunit: CYL
dsorg: PO
primary: 20
recfm: FB
blksize: 6160
lrecl: 80
dirblk: 25
secondary: 5

Data set created successfully.
"
`;

exports[`Create Classic Data Set Success scenarios should create a classic partitioned data set with specified size 1`] = `
"================Z/OS FILES CREATE DATA-SET-CLASSIC===============
alcunit: CYL
dsorg: PO
primary: 2
recfm: FB
blksize: 6160
lrecl: 80
dirblk: 25
secondary: 0

Data set created successfully.
"
`;
Expand Down
Loading