feat: release OpsXShell 2.1.0 native Tauri edition
This commit is contained in:
1 parent
e9a0d21758
commit
a3dba0c6ed
311 files changed
+31748
-14897
No files matched your search
@@ -0,0 +1,55 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { parseSshConfig } from '../../src/utils/sshConfig'
|
||||
|
||||
describe('parseSshConfig', () => {
|
||||
it('imports concrete hosts and common connection fields', () => {
|
||||
const sessions = parseSshConfig(`
|
||||
Host bastion
|
||||
HostName gateway.example.com
|
||||
User ops
|
||||
IdentityFile ~/.ssh/ops_ed25519
|
||||
|
||||
Host production prod-short
|
||||
HostName 10.10.0.8
|
||||
Port 2222
|
||||
User root
|
||||
ProxyJump bastion
|
||||
`)
|
||||
|
||||
expect(sessions).toEqual([
|
||||
{
|
||||
name: 'bastion',
|
||||
host: 'gateway.example.com',
|
||||
port: 22,
|
||||
username: 'ops',
|
||||
authType: 'key',
|
||||
privateKey: '~/.ssh/ops_ed25519',
|
||||
proxyJumpAlias: undefined,
|
||||
group: 'SSH Config',
|
||||
},
|
||||
expect.objectContaining({
|
||||
name: 'production',
|
||||
host: '10.10.0.8',
|
||||
port: 2222,
|
||||
username: 'root',
|
||||
authType: 'agent',
|
||||
proxyJumpAlias: 'bastion',
|
||||
}),
|
||||
expect.objectContaining({ name: 'prod-short', proxyJumpAlias: 'bastion' }),
|
||||
])
|
||||
})
|
||||
|
||||
it('skips wildcard and negated host patterns', () => {
|
||||
const sessions = parseSshConfig(`
|
||||
Host *
|
||||
ServerAliveInterval 30
|
||||
Host !blocked *.internal
|
||||
User deploy
|
||||
Host usable
|
||||
HostName usable.example.com
|
||||
`)
|
||||
|
||||
expect(sessions).toHaveLength(1)
|
||||
expect(sessions[0].name).toBe('usable')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user