Skip to content
Snippets Groups Projects
Commit a8289c9f authored by Thomas Evensen's avatar Thomas Evensen
Browse files

Update

parent ea1992ef
No related branches found
No related tags found
No related merge requests found
......@@ -19,25 +19,13 @@ struct ArgumentsCreatSSHKeys {
let userHomeDirectoryPathdefault = "/Users/thomas"
let sshkeypathandidentityfiledefault = "/Users/thomas/.ssh/id_rsa"
let argumentssshcopyiddefault = "/usr/bin/ssh-copy-id -i /Users/thomas/.ssh/id_rsa thomas@raspberrypi"
let URLfilelocal: URL? = URL(fileURLWithPath: "/Users/thomas/.ssh/")
let sshcreatelocal = ["-t", "rsa", "-N", "", "-f", "/Users/thomas/.ssh/id_rsa"]
let URLfileglobal = URL(fileURLWithPath:"/Users/thomas/.ssh_global")
let sshcreateglobal = ["-t", "rsa", "-N", "", "-f", "/Users/thomas/.ssh_global/global"]
/*
/Users/thomas/.ssh
id_rsa
/Users/thomas
/Users/thomas/.ssh/id_rsa
/usr/bin/ssh-copy-id -i /Users/thomas/.ssh/id_rsa thomas@raspberrypi
*/
/*
let arg3 = await sshcreatekey.keypathonly
print(arg3 ?? "")
let arg4 = await sshcreatekey.identityfile
print(arg4 ?? "")
let arg5 = await sshcreatekey.userHomeDirectoryPath
print(arg5 ?? "")
let arg6 = await sshcreatekey.sshkeypathandidentityfile
print(arg6 ?? "")
let arg7 = await sshcreatekey.argumentssshcopyid(offsiteServer: "raspberrypi", offsiteUsername: "thomas")
pri
*/
}
@testable import SSHCreateKey
import Testing
import Foundation
@Suite final class TestCreateSSHkeys {
var testconfigurations: [TestSynchronizeConfiguration]?
......@@ -28,7 +29,7 @@ import Testing
await loadtestdata.getdata()
testconfigurations = loadtestdata.testconfigurations
// Sett Shareddata to nil oe default values
// Sett Shareddata to nil or default values
let port = -1
let identityfile: String? = nil
let sshcreatekey = await SSHCreateKey(sharedsshport: String(port),
......@@ -53,10 +54,10 @@ import Testing
sharedsshkeypathandidentityfile: TestSharedReference.shared.sshkeypathandidentityfile)
// If new keypath is set create it
let sshrootpath = await sshcreatekey.testcreatesshkeyrootpath()
#expect(ArgumentsCreatSSHKeys().URLfileglobal == sshrootpath)
// Create keys
let arguments = await sshcreatekey.argumentscreatekey()
print(sshrootpath ?? "")
print(arguments ?? "")
#expect(ArgumentsCreatSSHKeys().sshcreateglobal == arguments)
}
@Test func createkeysdefault() async {
......@@ -68,10 +69,8 @@ import Testing
sharedsshkeypathandidentityfile: identityfile)
let sshrootpath = await sshcreatekey.testcreatesshkeyrootpath()
// Create keys
#expect(ArgumentsCreatSSHKeys().URLfilelocal == sshrootpath)
let arguments = await sshcreatekey.argumentscreatekey()
print(sshrootpath ?? "")
print(arguments ?? "")
#expect(ArgumentsCreatSSHKeys().sshcreatelocal == arguments)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment