Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SSHCreateKey
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
AppleApps
rsyncOSX
SSHCreateKey
Commits
a8289c9f
Commit
a8289c9f
authored
8 months ago
by
Thomas Evensen
Browse files
Options
Downloads
Patches
Plain Diff
Update
parent
ea1992ef
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tests/SSHCreateKeyTests/ArgumentsCreatSSHKeys.swift
+8
-20
8 additions, 20 deletions
Tests/SSHCreateKeyTests/ArgumentsCreatSSHKeys.swift
Tests/SSHCreateKeyTests/SSHCreateKeyTests.swift
+6
-7
6 additions, 7 deletions
Tests/SSHCreateKeyTests/SSHCreateKeyTests.swift
with
14 additions
and
27 deletions
Tests/SSHCreateKeyTests/ArgumentsCreatSSHKeys.swift
+
8
−
20
View file @
a8289c9f
...
...
@@ -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
*/
}
This diff is collapsed.
Click to expand it.
Tests/SSHCreateKeyTests/SSHCreateKeyTests.swift
+
6
−
7
View file @
a8289c9f
@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 o
e
default values
// Sett Shareddata to nil o
r
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)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment