diff --git a/Tools/TestDataGenerator/Commands/Create.cs b/Tools/TestDataGenerator/Commands/Create.cs
index 4eed98130..de576d996 100644
--- a/Tools/TestDataGenerator/Commands/Create.cs
+++ b/Tools/TestDataGenerator/Commands/Create.cs
@@ -22,6 +22,7 @@ public static class Create
/// The maximum depth of subfolders to create in the target folder
/// The maximum number of folders to create in the target folder
/// The maximum length of each path segment in the target folder
+ /// The random seed to use for generating the test data
record CommandInput(
DirectoryInfo TargetFolder,
int FileCount,
@@ -32,7 +33,8 @@ public static class Create
int MaxFanOut,
int MaxDepth,
int MaxFolderCount,
- int MaxPathSegmentLength);
+ int MaxPathSegmentLength,
+ string RandomSeed);
///
/// Creates the command
@@ -82,6 +84,10 @@ public static class Create
maxPathSegmentLengthOption.SetDefaultValue(15);
command.AddOption(maxPathSegmentLengthOption);
+ var randomSeedOption = new Option("--random-seed", "The random seed to use for generating the test data");
+ randomSeedOption.SetDefaultValue("Duplicati");
+ command.AddOption(randomSeedOption);
+
command.Handler = CommandHandler.Create(Execute);
return command;
@@ -121,7 +127,7 @@ public static class Create
throw new Exception("The maximum path segment length must be greater than zero");
Console.WriteLine($"Creating test data in {input.TargetFolder.FullName}");
- var rnd = new Random();
+ var rnd = new Random(input.RandomSeed.GetHashCode());
var folders = GeneratePathStructure(rnd, input.TargetFolder.FullName, input.MaxDepth, input.MaxFanOut, input.MaxPathSegmentLength);
while (folders.Count < input.MaxFolderCount)
{