Simplify with gofmt -s -w .
This commit is contained in:
parent
32d11421d3
commit
d2e37f8c7d
@ -25,27 +25,27 @@ func TestStart(t *testing.T) {
|
||||
DeleteInterval: duration.Duration{Duration: time.Millisecond},
|
||||
Connection: map[string]interface{}{
|
||||
"a": []map[string]interface{}{
|
||||
map[string]interface{}{
|
||||
{
|
||||
"enable": false,
|
||||
"path": "a1",
|
||||
},
|
||||
map[string]interface{}{
|
||||
{
|
||||
"path": "a2",
|
||||
},
|
||||
map[string]interface{}{
|
||||
{
|
||||
"enable": true,
|
||||
"path": "a3",
|
||||
},
|
||||
},
|
||||
"b": nil,
|
||||
"c": []map[string]interface{}{
|
||||
map[string]interface{}{
|
||||
{
|
||||
"path": "c1",
|
||||
},
|
||||
},
|
||||
// fetch continue command in Connect
|
||||
"d": []map[string]interface{}{
|
||||
map[string]interface{}{
|
||||
{
|
||||
"path": "d0",
|
||||
},
|
||||
},
|
||||
@ -57,7 +57,7 @@ func TestStart(t *testing.T) {
|
||||
// connection type not found
|
||||
_, err = Connect(map[string]interface{}{
|
||||
"e": []map[string]interface{}{
|
||||
map[string]interface{}{},
|
||||
{},
|
||||
},
|
||||
})
|
||||
assert.Error(err)
|
||||
|
@ -35,12 +35,12 @@ func TestToInflux(t *testing.T) {
|
||||
},
|
||||
MeshVPN: &data.MeshVPN{
|
||||
Groups: map[string]*data.MeshVPNPeerGroup{
|
||||
"ffhb": &data.MeshVPNPeerGroup{
|
||||
"ffhb": {
|
||||
Peers: map[string]*data.MeshVPNPeerLink{
|
||||
"vpn01": &data.MeshVPNPeerLink{Established: 3},
|
||||
"vpn02": &data.MeshVPNPeerLink{},
|
||||
"vpn01": {Established: 3},
|
||||
"vpn02": {},
|
||||
"trash": nil,
|
||||
"vpn03": &data.MeshVPNPeerLink{Established: 0},
|
||||
"vpn03": {Established: 0},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -74,16 +74,16 @@ func TestToInflux(t *testing.T) {
|
||||
Neighbours: &data.Neighbours{
|
||||
NodeID: "deadbeef",
|
||||
Batadv: map[string]data.BatadvNeighbours{
|
||||
"a-interface": data.BatadvNeighbours{
|
||||
"a-interface": {
|
||||
Neighbours: map[string]data.BatmanLink{
|
||||
"BAFF1E5": data.BatmanLink{
|
||||
"BAFF1E5": {
|
||||
Tq: 204,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
LLDP: map[string]data.LLDPNeighbours{
|
||||
"b-interface": data.LLDPNeighbours{},
|
||||
"b-interface": {},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ func TestFilter(t *testing.T) {
|
||||
// filtered - do not run all
|
||||
nodes := &runtime.Nodes{
|
||||
List: map[string]*runtime.Node{
|
||||
"a": &runtime.Node{
|
||||
"a": {
|
||||
Nodeinfo: &data.NodeInfo{NodeID: "a"},
|
||||
},
|
||||
},
|
||||
@ -28,7 +28,7 @@ func TestFilter(t *testing.T) {
|
||||
// run to end
|
||||
nodes = &runtime.Nodes{
|
||||
List: map[string]*runtime.Node{
|
||||
"a": &runtime.Node{
|
||||
"a": {
|
||||
Nodeinfo: &data.NodeInfo{NodeID: "a"},
|
||||
},
|
||||
},
|
||||
|
@ -50,28 +50,28 @@ func TestStart(t *testing.T) {
|
||||
})
|
||||
allOutput, err := Register(map[string]interface{}{
|
||||
"a": []map[string]interface{}{
|
||||
map[string]interface{}{
|
||||
{
|
||||
"enable": false,
|
||||
"path": "a1",
|
||||
},
|
||||
map[string]interface{}{
|
||||
{
|
||||
"path": "a2",
|
||||
},
|
||||
map[string]interface{}{
|
||||
{
|
||||
"enable": true,
|
||||
"path": "a3",
|
||||
},
|
||||
},
|
||||
"b": nil,
|
||||
"c": []map[string]interface{}{
|
||||
map[string]interface{}{
|
||||
{
|
||||
"path": "c1",
|
||||
"filter": map[string]interface{}{},
|
||||
},
|
||||
},
|
||||
// fetch continue command in Connect
|
||||
"d": []map[string]interface{}{
|
||||
map[string]interface{}{
|
||||
{
|
||||
"path": "d0",
|
||||
},
|
||||
},
|
||||
@ -84,7 +84,7 @@ func TestStart(t *testing.T) {
|
||||
|
||||
_, err = Register(map[string]interface{}{
|
||||
"e": []map[string]interface{}{
|
||||
map[string]interface{}{},
|
||||
{},
|
||||
},
|
||||
})
|
||||
assert.Error(err)
|
||||
|
@ -19,7 +19,7 @@ func TestTransform(t *testing.T) {
|
||||
Network: data.Network{
|
||||
Mac: "node:a:mac",
|
||||
Mesh: map[string]*data.BatInterface{
|
||||
"bat0": &data.BatInterface{
|
||||
"bat0": {
|
||||
Interfaces: struct {
|
||||
Wireless []string `json:"wireless,omitempty"`
|
||||
Other []string `json:"other,omitempty"`
|
||||
@ -36,14 +36,14 @@ func TestTransform(t *testing.T) {
|
||||
Neighbours: &data.Neighbours{
|
||||
NodeID: "node_a",
|
||||
Batadv: map[string]data.BatadvNeighbours{
|
||||
"node:a:mac:wifi": data.BatadvNeighbours{
|
||||
"node:a:mac:wifi": {
|
||||
Neighbours: map[string]data.BatmanLink{
|
||||
"node:b:mac:wifi": data.BatmanLink{Tq: 153},
|
||||
"node:b:mac:wifi": {Tq: 153},
|
||||
},
|
||||
},
|
||||
"node:a:mac:lan": data.BatadvNeighbours{
|
||||
"node:a:mac:lan": {
|
||||
Neighbours: map[string]data.BatmanLink{
|
||||
"node:b:mac:lan": data.BatmanLink{Tq: 51},
|
||||
"node:b:mac:lan": {Tq: 51},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -56,7 +56,7 @@ func TestTransform(t *testing.T) {
|
||||
Network: data.Network{
|
||||
Mac: "node:c:mac",
|
||||
Mesh: map[string]*data.BatInterface{
|
||||
"bat0": &data.BatInterface{
|
||||
"bat0": {
|
||||
Interfaces: struct {
|
||||
Wireless []string `json:"wireless,omitempty"`
|
||||
Other []string `json:"other,omitempty"`
|
||||
@ -71,9 +71,9 @@ func TestTransform(t *testing.T) {
|
||||
Neighbours: &data.Neighbours{
|
||||
NodeID: "node_b",
|
||||
Batadv: map[string]data.BatadvNeighbours{
|
||||
"node:c:mac:lan": data.BatadvNeighbours{
|
||||
"node:c:mac:lan": {
|
||||
Neighbours: map[string]data.BatmanLink{
|
||||
"node:b:mac:lan": data.BatmanLink{Tq: 102},
|
||||
"node:b:mac:lan": {Tq: 102},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -86,7 +86,7 @@ func TestTransform(t *testing.T) {
|
||||
Network: data.Network{
|
||||
Mac: "node:b:mac",
|
||||
Mesh: map[string]*data.BatInterface{
|
||||
"bat0": &data.BatInterface{
|
||||
"bat0": {
|
||||
Interfaces: struct {
|
||||
Wireless []string `json:"wireless,omitempty"`
|
||||
Other []string `json:"other,omitempty"`
|
||||
@ -102,14 +102,14 @@ func TestTransform(t *testing.T) {
|
||||
Neighbours: &data.Neighbours{
|
||||
NodeID: "node_b",
|
||||
Batadv: map[string]data.BatadvNeighbours{
|
||||
"node:b:mac:lan": data.BatadvNeighbours{
|
||||
"node:b:mac:lan": {
|
||||
Neighbours: map[string]data.BatmanLink{
|
||||
"node:c:mac:lan": data.BatmanLink{Tq: 204},
|
||||
"node:c:mac:lan": {Tq: 204},
|
||||
},
|
||||
},
|
||||
"node:b:mac:wifi": data.BatadvNeighbours{
|
||||
"node:b:mac:wifi": {
|
||||
Neighbours: map[string]data.BatmanLink{
|
||||
"node:a:mac:wifi": data.BatmanLink{Tq: 204},
|
||||
"node:a:mac:wifi": {Tq: 204},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -122,7 +122,7 @@ func TestTransform(t *testing.T) {
|
||||
Network: data.Network{
|
||||
Mac: "node:d:mac",
|
||||
Mesh: map[string]*data.BatInterface{
|
||||
"bat0": &data.BatInterface{
|
||||
"bat0": {
|
||||
Interfaces: struct {
|
||||
Wireless []string `json:"wireless,omitempty"`
|
||||
Other []string `json:"other,omitempty"`
|
||||
@ -138,14 +138,14 @@ func TestTransform(t *testing.T) {
|
||||
Neighbours: &data.Neighbours{
|
||||
NodeID: "node_d",
|
||||
Batadv: map[string]data.BatadvNeighbours{
|
||||
"node:d:mac:lan": data.BatadvNeighbours{
|
||||
"node:d:mac:lan": {
|
||||
Neighbours: map[string]data.BatmanLink{
|
||||
"node:c:mac:lan": data.BatmanLink{Tq: 204},
|
||||
"node:c:mac:lan": {Tq: 204},
|
||||
},
|
||||
},
|
||||
"node:d:mac:wifi": data.BatadvNeighbours{
|
||||
"node:d:mac:wifi": {
|
||||
Neighbours: map[string]data.BatmanLink{
|
||||
"node:a:mac:wifi": data.BatmanLink{Tq: 204},
|
||||
"node:a:mac:wifi": {Tq: 204},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -30,15 +30,15 @@ func TestRegister(t *testing.T) {
|
||||
Total: 50,
|
||||
},
|
||||
Wireless: []*data.WirelessAirtime{
|
||||
&data.WirelessAirtime{
|
||||
{
|
||||
ChanUtil: 0.3,
|
||||
Frequency: 2512,
|
||||
},
|
||||
&data.WirelessAirtime{
|
||||
{
|
||||
ChanUtil: 0.4,
|
||||
Frequency: 2612,
|
||||
},
|
||||
&data.WirelessAirtime{
|
||||
{
|
||||
ChanUtil: 0.5,
|
||||
Frequency: 5200,
|
||||
},
|
||||
|
@ -176,9 +176,9 @@ func TestLinksNodes(t *testing.T) {
|
||||
Neighbours: &data.Neighbours{
|
||||
NodeID: "f4f26dd7a30b",
|
||||
Batadv: map[string]data.BatadvNeighbours{
|
||||
"f4:f2:6d:d7:a3:0b": data.BatadvNeighbours{
|
||||
"f4:f2:6d:d7:a3:0b": {
|
||||
Neighbours: map[string]data.BatmanLink{
|
||||
"f4:f2:6d:d7:a3:0a": data.BatmanLink{
|
||||
"f4:f2:6d:d7:a3:0a": {
|
||||
Tq: 200, Lastseen: 0.42,
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user