Select a random host when importing a bootstrap, and started adding support for multiple bootstrap types.

This commit is contained in:
CalDescent
2021-10-02 15:03:31 +01:00
parent 47b1b6daba
commit 51bb776e56
3 changed files with 52 additions and 5 deletions

View File

@@ -67,7 +67,7 @@ public class BootstrapTests extends Common {
@Test
public void testCreateAndImportBootstrap() throws DataException, InterruptedException, TransformationException, IOException {
Path bootstrapPath = Paths.get(String.format("%s%s", Settings.getInstance().getBootstrapFilenamePrefix(), "bootstrap.7z"));
Path bootstrapPath = Paths.get(String.format("%s%s", Settings.getInstance().getBootstrapFilenamePrefix(), "bootstrap-archive.7z"));
Path archivePath = Paths.get(Settings.getInstance().getRepositoryPath(), "archive", "2-900.dat");
BlockData block1000;
byte[] originalArchiveContents;
@@ -183,7 +183,23 @@ public class BootstrapTests extends Common {
private void deleteBootstraps() throws IOException {
try {
Path path = Paths.get(String.format("%s%s", Settings.getInstance().getBootstrapFilenamePrefix(), "bootstrap.7z"));
Path path = Paths.get(String.format("%s%s", Settings.getInstance().getBootstrapFilenamePrefix(), "bootstrap-archive.7z"));
Files.delete(path);
} catch (NoSuchFileException e) {
// Nothing to delete
}
try {
Path path = Paths.get(String.format("%s%s", Settings.getInstance().getBootstrapFilenamePrefix(), "bootstrap-toponly.7z"));
Files.delete(path);
} catch (NoSuchFileException e) {
// Nothing to delete
}
try {
Path path = Paths.get(String.format("%s%s", Settings.getInstance().getBootstrapFilenamePrefix(), "bootstrap-full.7z"));
Files.delete(path);
} catch (NoSuchFileException e) {