Skip to content

Commit

Permalink
review: add system test for connection validation function 😋
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
  • Loading branch information
zFernand0 committed Nov 2, 2024
1 parent c2196a5 commit e95f9fd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/zosuss/__tests__/__system__/Shell.system.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ describe("zowe uss issue ssh api call test", () => {
await TestEnvironment.cleanUp(TEST_ENVIRONMENT);
});

describe("Function isConnectionValid", () => {
it("should verify that the connection is valid", async () => {
const response = await Shell.isConnectionValid(SSH_SESSION);
expect(response).toBe(true);
});
it("should verify that the connection is invalid", async () => {
const fakeSession: SshSession = TestEnvironment.createSshSession(TEST_ENVIRONMENT);
fakeSession.ISshSession.hostname = "fake-host";
const response = await Shell.isConnectionValid(fakeSession);
expect(response).toBe(false);
});
});

it ("should execute uname command on the remote system by ssh and return operating system name", async () => {
const command = "uname";
let stdoutData = "";
Expand Down

0 comments on commit e95f9fd

Please sign in to comment.