(t *testing.T)
| 179 | } |
| 180 | |
| 181 | func TestDistributionRejectsLocalNodeRemoval(t *testing.T) { |
| 182 | t.Parallel() |
| 183 | h, repoContainer, runDir, privKey, pubKey, nodeId, originalTimestamp := startDistributedSingleNode(t) |
| 184 | ctx := context.Background() |
| 185 | |
| 186 | cfg2 := state.CentralCfg{ |
| 187 | Timestamp: originalTimestamp + 1, |
| 188 | Dist: &state.DistributionCfg{ |
| 189 | Key: pubKey, |
| 190 | Repos: []string{"http://repo:80/bundle"}, |
| 191 | }, |
| 192 | Routers: nil, |
| 193 | } |
| 194 | bundlePath, _ := writeBundle(t, runDir, "bundle-local-node-removed", cfg2, privKey) |
| 195 | if err := repoContainer.CopyFileToContainer(ctx, bundlePath, "/data/bundle", 0644); err != nil { |
| 196 | t.Fatal(err) |
| 197 | } |
| 198 | |
| 199 | h.WaitForLog(string(nodeId), "Found a new config update in repo") |
| 200 | h.WaitForLog(string(nodeId), "failed to apply central config update") |
| 201 | assertCentralTimestampStays(t, h, nodeId, originalTimestamp) |
| 202 | } |
| 203 | |
| 204 | func TestDistributionRejectsInvalidCentralConfig(t *testing.T) { |
| 205 | t.Parallel() |
nothing calls this directly
no test coverage detected