(t *testing.T)
| 1110 | } |
| 1111 | |
| 1112 | func TestConfigMaps_updatePeers_nonexist(t *testing.T) { |
| 1113 | t.Parallel() |
| 1114 | |
| 1115 | for _, k := range []proto.CoordinateResponse_PeerUpdate_Kind{ |
| 1116 | proto.CoordinateResponse_PeerUpdate_DISCONNECTED, |
| 1117 | proto.CoordinateResponse_PeerUpdate_LOST, |
| 1118 | } { |
| 1119 | t.Run(k.String(), func(t *testing.T) { |
| 1120 | t.Parallel() |
| 1121 | ctx := testutil.Context(t, testutil.WaitShort) |
| 1122 | logger := testutil.Logger(t) |
| 1123 | fEng := newFakeEngineConfigurable() |
| 1124 | nodePrivateKey := key.NewNode() |
| 1125 | nodeID := tailcfg.NodeID(5) |
| 1126 | discoKey := key.NewDisco() |
| 1127 | uut := newConfigMaps(logger, fEng, nodeID, nodePrivateKey, discoKey.Public(), CoderDNSSuffixFQDN) |
| 1128 | defer uut.close() |
| 1129 | |
| 1130 | // Then: we don't configure |
| 1131 | requireNeverConfigures(ctx, t, &uut.phased) |
| 1132 | |
| 1133 | // Given: no known peers |
| 1134 | go func() { |
| 1135 | <-fEng.status |
| 1136 | fEng.statusDone <- struct{}{} |
| 1137 | }() |
| 1138 | |
| 1139 | // When: update with LOST/DISCONNECTED |
| 1140 | p1ID := uuid.UUID{1} |
| 1141 | updates := []*proto.CoordinateResponse_PeerUpdate{ |
| 1142 | { |
| 1143 | Id: p1ID[:], |
| 1144 | Kind: k, |
| 1145 | }, |
| 1146 | } |
| 1147 | uut.updatePeers(updates) |
| 1148 | |
| 1149 | done := make(chan struct{}) |
| 1150 | go func() { |
| 1151 | defer close(done) |
| 1152 | uut.close() |
| 1153 | }() |
| 1154 | _ = testutil.TryReceive(ctx, t, done) |
| 1155 | }) |
| 1156 | } |
| 1157 | } |
| 1158 | |
| 1159 | func TestConfigMaps_addRemoveHosts(t *testing.T) { |
| 1160 | t.Parallel() |
nothing calls this directly
no test coverage detected