(t *testing.T)
| 586 | } |
| 587 | |
| 588 | func TestRestoreFailsWithFailedPostRestoreHook(t *testing.T) { |
| 589 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) |
| 590 | defer cancel() |
| 591 | |
| 592 | registryURL := startLocalRegistry(t, ctx) |
| 593 | hookImage := buildHookImage(t, ctx, registryURL, "restore-hook-fail", "#!/bin/sh\nexit 1") |
| 594 | |
| 595 | backup := buildTestBackup(t, hookImage) |
| 596 | |
| 597 | ns, err := docker.NewNamespace("once-restore-hook-fail-test") |
| 598 | require.NoError(t, err) |
| 599 | defer ns.Teardown(ctx, true) |
| 600 | |
| 601 | require.NoError(t, ns.EnsureNetwork(ctx)) |
| 602 | require.NoError(t, ns.Proxy().Boot(ctx, getProxyPorts(t))) |
| 603 | |
| 604 | _, err = ns.Restore(ctx, bytes.NewReader(backup)) |
| 605 | require.Error(t, err) |
| 606 | assert.Contains(t, err.Error(), "post-restore") |
| 607 | } |
| 608 | |
| 609 | func TestRemoveApplication(t *testing.T) { |
| 610 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) |
nothing calls this directly
no test coverage detected
searching dependent graphs…