Skip to content

Commit

Permalink
Added another computer
Browse files Browse the repository at this point in the history
  • Loading branch information
dominusmars committed Feb 28, 2024
1 parent eb4dd4e commit a6caf59
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
21 changes: 21 additions & 0 deletions tests/computers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@ const computers: Server[] = [
},
],
},
{
ipaddress: "192.168.15.12",
Name: "Centos 8",
"OS Type": "linux",
domain: "",
password_changes: 0,
users: [
{
domain: "",
failedPasswords: [],
hostname: "Centos 8",
ipaddress: "192.168.15.12",
password: defaultPassword || "Password123",
password_changes: 0,
ssh_key: false,
user_id: "Centos8",
username: "root",
oldPasswords: [],
},
],
},
];

export { computers };
7 changes: 4 additions & 3 deletions tests/ssh.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ for (let computer of computers) {
});

describe("Password Test", () => {
it("test current password", async () => {
it("Test Current password", async () => {
let ssh = await makeConnection(user, 3000, 3);
if (!ssh) {
throw new Error("Unable to connect to target server");
Expand All @@ -51,7 +51,7 @@ for (let computer of computers) {
assert.ok(password_active, "User Password Check was false");
await ssh.close();
});
it("test incorrect password", async () => {
it("Test Incorrect password", async () => {
let ssh = await makeConnection(user, 3000, 3);
if (!ssh) {
throw new Error("Unable to connect to target server");
Expand All @@ -60,7 +60,7 @@ for (let computer of computers) {
assert.ok(!password_active, "User Password Check was true");
await ssh.close();
});
it("Can Change Password", async () => {
it("Can Change Password (Runs Password Script,)", async () => {
if (!defaultPassword) {
throw new Error("Unable to change password no default password");
}
Expand All @@ -70,6 +70,7 @@ for (let computer of computers) {
if (typeof passwordResult === "string") {
return;
}
console.log("Change Password Back!");

currUser.password = defaultPassword + "123";
let passwordResultBack = await changePasswordOf(computer, currUser, defaultPassword);
Expand Down

0 comments on commit a6caf59

Please sign in to comment.