mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-20 09:47:49 +02:00
fix indention in test for yaml output
This commit is contained in:
parent
f36869e97d
commit
014f1b841f
@ -193,41 +193,7 @@ func TestParsingToJson(t *testing.T) {
|
|||||||
func TestParsingToYaml(t *testing.T) {
|
func TestParsingToYaml(t *testing.T) {
|
||||||
yaml, _ := parseToYaml(overview)
|
yaml, _ := parseToYaml(overview)
|
||||||
|
|
||||||
expectedYaml := "peers:\n" +
|
expectedYaml := "peers:\n total: 2\n connected: 2\n details:\n - ip: 192.168.178.101\n publicKey: Pubkey1\n fqdn: peer-1.awesome-domain.com\n connectionStatus: Connected\n connectionStatusUpdate: 2001-01-01T01:01:01Z\n connectionType: P2P\n direct: true\n localIceCandidateType: '-'\n remoteIceCandidateType: '-'\n - ip: 192.168.178.102\n publicKey: Pubkey2\n fqdn: peer-2.awesome-domain.com\n connectionStatus: Connected\n connectionStatusUpdate: 2002-02-02T02:02:02Z\n connectionType: Relayed\n direct: false\n localIceCandidateType: '-'\n remoteIceCandidateType: '-'\ncliVersion: development\ndaemonVersion: 0.14.1\ndaemonStatus: Connected\nmanagement:\n url: my-awesome-management.com:443\n connected: true\nsignal:\n url: my-awesome-signal.com:443\n connected: true\nip: 192.168.178.100/16\npublicKey: Some-Pub-Key\ninterfaceType: Kernel\ndomain: some-localhost.awesome-domain.com\n"
|
||||||
" total: 2\n" +
|
|
||||||
" connected: 2\n" +
|
|
||||||
" details:\n" +
|
|
||||||
" - ip: 192.168.178.101\n" +
|
|
||||||
" publicKey: Pubkey1\n" +
|
|
||||||
" fqdn: peer-1.awesome-domain.com\n" +
|
|
||||||
" connectionStatus: Connected\n" +
|
|
||||||
" connectionStatusUpdate: 2001-01-01T01:01:01Z\n" +
|
|
||||||
" connectionType: P2P\n" +
|
|
||||||
" direct: true\n" +
|
|
||||||
" localIceCandidateType: '-'\n" +
|
|
||||||
" remoteIceCandidateType: '-'\n" +
|
|
||||||
" - ip: 192.168.178.102\n" +
|
|
||||||
" publicKey: Pubkey2\n" +
|
|
||||||
" fqdn: peer-2.awesome-domain.com\n" +
|
|
||||||
" connectionStatus: Connected\n" +
|
|
||||||
" connectionStatusUpdate: 2002-02-02T02:02:02Z\n" +
|
|
||||||
" connectionType: Relayed\n" +
|
|
||||||
" direct: false\n" +
|
|
||||||
" localIceCandidateType: '-'\n" +
|
|
||||||
" remoteIceCandidateType: '-'\n" +
|
|
||||||
"cliVersion: development\n" +
|
|
||||||
"daemonVersion: 0.14.1\n" +
|
|
||||||
"daemonStatus: Connected\n" +
|
|
||||||
"management:\n" +
|
|
||||||
" url: my-awesome-management.com:443\n" +
|
|
||||||
" connected: true\n" +
|
|
||||||
"signal:\n" +
|
|
||||||
" url: my-awesome-signal.com:443\n" +
|
|
||||||
" connected: true\n" +
|
|
||||||
"ip: 192.168.178.100/16\n" +
|
|
||||||
"publicKey: Some-Pub-Key\n" +
|
|
||||||
"interfaceType: Kernel\n" +
|
|
||||||
"domain: some-localhost.awesome-domain.com\n"
|
|
||||||
|
|
||||||
assert.Equal(t, expectedYaml, yaml)
|
assert.Equal(t, expectedYaml, yaml)
|
||||||
}
|
}
|
||||||
@ -235,35 +201,41 @@ func TestParsingToYaml(t *testing.T) {
|
|||||||
func TestParsingToDetail(t *testing.T) {
|
func TestParsingToDetail(t *testing.T) {
|
||||||
detail := parseToFullDetailSummary(overview)
|
detail := parseToFullDetailSummary(overview)
|
||||||
|
|
||||||
expectedDetail := "Peers detail:\n" +
|
expectedDetail := "peers:\n" +
|
||||||
" peer-1.awesome-domain.com:\n" +
|
" total: 2\n" +
|
||||||
" NetBird IP: 192.168.178.101\n" +
|
" connected: 2\n" +
|
||||||
" Public key: Pubkey1\n" +
|
" details:\n" +
|
||||||
" Status: Connected\n" +
|
" - ip: 192.168.178.101\n" +
|
||||||
" -- detail --\n" +
|
" publicKey: Pubkey1\n" +
|
||||||
" Connection type: P2P\n" +
|
" fqdn: peer-1.awesome-domain.com\n" +
|
||||||
" Direct: true\n" +
|
" connectionStatus: Connected\n" +
|
||||||
" ICE candidate (Local/Remote): -/-\n" +
|
" connectionStatusUpdate: 2001-01-01T01:01:01Z\n" +
|
||||||
" Last connection update: 2001-01-01 01:01:01\n" +
|
" connectionType: P2P\n" +
|
||||||
"\n" +
|
" direct: true\n" +
|
||||||
" peer-2.awesome-domain.com:\n" +
|
" localIceCandidateType: '-'\n" +
|
||||||
" NetBird IP: 192.168.178.102\n" +
|
" remoteIceCandidateType: '-'\n" +
|
||||||
" Public key: Pubkey2\n" +
|
" - ip: 192.168.178.102\n" +
|
||||||
" Status: Connected\n" +
|
" publicKey: Pubkey2\n" +
|
||||||
" -- detail --\n" +
|
" fqdn: peer-2.awesome-domain.com\n" +
|
||||||
" Connection type: Relayed\n" +
|
" connectionStatus: Connected\n" +
|
||||||
" Direct: false\n" +
|
" connectionStatusUpdate: 2002-02-02T02:02:02Z\n" +
|
||||||
" ICE candidate (Local/Remote): -/-\n" +
|
" connectionType: Relayed\n" +
|
||||||
" Last connection update: 2002-02-02 02:02:02\n" +
|
" direct: false\n" +
|
||||||
"\n" +
|
" localIceCandidateType: '-'\n" +
|
||||||
"Daemon version: 0.14.1\n" +
|
" remoteIceCandidateType: '-'\n" +
|
||||||
"CLI version: development\n" +
|
"cliVersion: development\n" +
|
||||||
"ConnectedManagement: Connected to my-awesome-management.com:443\n" +
|
"daemonVersion: 0.14.1\n" +
|
||||||
"Signal: Connected to my-awesome-signal.com:443\n" +
|
"daemonStatus: Connected\n" +
|
||||||
"Domain: some-localhost.awesome-domain.com\n" +
|
"management:\n" +
|
||||||
"NetBird IP: 192.168.178.100/16\n" +
|
" url: my-awesome-management.com:443\n" +
|
||||||
"Interface type: Kernel\n" +
|
" connected: true\n" +
|
||||||
"Peers count: 2/2 Connected\n"
|
"signal:\n" +
|
||||||
|
" url: my-awesome-signal.com:443\n" +
|
||||||
|
" connected: true\n" +
|
||||||
|
"ip: 192.168.178.100/16\n" +
|
||||||
|
"publicKey: Some-Pub-Key\n" +
|
||||||
|
"interfaceType: Kernel\n" +
|
||||||
|
"domain: some-localhost.awesome-domain.com\n"
|
||||||
|
|
||||||
assert.Equal(t, expectedDetail, detail)
|
assert.Equal(t, expectedDetail, detail)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user