Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -474,13 +474,13 @@ private IEnumerable<string> GetProfileExpectedCommands(bool singleVM, string dat
"apt install python3 --yes --quiet",

$"python3 {this.mySQLPackagePath}/install.py --distro Ubuntu",
$"python3 {this.mySQLPackagePath}/configure.py --serverIp 127.0.0.1 --innoDbDirs \"{currentDirectory}/mnt_vc_0;{currentDirectory}/mnt_vc_1;{currentDirectory}/mnt_vc_2;\"",
$"python3 {this.mySQLPackagePath}/configure.py --serverIp 127.0.0.1 --innoDbDirs \"/mnt_vc_0;/mnt_vc_1;/mnt_vc_2;\"",
$"python3 {this.mySQLPackagePath}/setup-database.py --dbName sbtest",

$"python3 {this.sysbenchPackagePath}/configure-workload-generator.py --distro Ubuntu --databaseSystem MySQL --packagePath {this.sysbenchPackagePath}",

$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --tableCount 10 --recordCount 1 --threadCount 8 --password [A-Za-z0-9+/=]+",
$"python3 {this.mySQLPackagePath}/distribute-database.py --dbName sbtest --directories \"{currentDirectory}/mnt_vc_0;{currentDirectory}/mnt_vc_1;{currentDirectory}/mnt_vc_2;\"",
$"python3 {this.mySQLPackagePath}/distribute-database.py --dbName sbtest --directories \"/mnt_vc_0;/mnt_vc_1;/mnt_vc_2;\"",
$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --tableCount 10 --recordCount 1000 --threadCount 8",

$"python3 {this.sysbenchPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --workload oltp_read_write --threadCount 8 --tableCount 10 --recordCount 1000 --hostIpAddress 127.0.0.1 --durationSecs 300 --password [A-Za-z0-9+/=]+",
Expand All @@ -500,13 +500,13 @@ private IEnumerable<string> GetProfileExpectedCommands(bool singleVM, string dat
"apt install python3 --yes --quiet",

$"python3 {this.mySQLPackagePath}/install.py --distro Ubuntu",
$"python3 {this.mySQLPackagePath}/configure.py --serverIp 127.0.0.1 --innoDbDirs \"{currentDirectory}/mnt_vc_0;{currentDirectory}/mnt_vc_1;{currentDirectory}/mnt_vc_2;\"",
$"python3 {this.mySQLPackagePath}/configure.py --serverIp 127.0.0.1 --innoDbDirs \"/mnt_vc_0;/mnt_vc_1;/mnt_vc_2;\"",
$"python3 {this.mySQLPackagePath}/setup-database.py --dbName sbtest",

$"python3 {this.sysbenchPackagePath}/configure-workload-generator.py --distro Ubuntu --databaseSystem MySQL --packagePath {this.sysbenchPackagePath}",

$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --tableCount 10 --warehouses 1 --threadCount 8 --password [A-Za-z0-9+/=]+",
$"python3 {this.mySQLPackagePath}/distribute-database.py --dbName sbtest --directories \"{currentDirectory}/mnt_vc_0;{currentDirectory}/mnt_vc_1;{currentDirectory}/mnt_vc_2;\"",
$"python3 {this.mySQLPackagePath}/distribute-database.py --dbName sbtest --directories \"/mnt_vc_0;/mnt_vc_1;/mnt_vc_2;\"",
$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --tableCount 10 --warehouses 100 --threadCount 8 --password [A-Za-z0-9+/=]+",

$"python3 {this.sysbenchPackagePath}/run-workload.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --workload tpcc --threadCount 8 --tableCount 10 --warehouses 100 --hostIpAddress 127.0.0.1 --durationSecs 1800 --password [A-Za-z0-9+/=]+",
Expand Down Expand Up @@ -563,7 +563,7 @@ private IEnumerable<string> GetProfileExpectedCommands(bool singleVM, string dat
$"python3 {this.sysbenchPackagePath}/configure-workload-generator.py --distro Ubuntu --databaseSystem PostgreSQL --packagePath {this.sysbenchPackagePath}",

$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark OLTP --tableCount 10 --recordCount 1 --threadCount 8 --password [A-Za-z0-9+/=]+",
$"python3 {this.postgreSQLPackagePath}/distribute-database.py --dbName sbtest --directories \"{currentDirectory}/mnt_vc_0;{currentDirectory}/mnt_vc_1;{currentDirectory}/mnt_vc_2;\" --password [A-Za-z0-9+/=]+",
$"python3 {this.postgreSQLPackagePath}/distribute-database.py --dbName sbtest --directories \"/mnt_vc_0;/mnt_vc_1;/mnt_vc_2;\" --password [A-Za-z0-9+/=]+",
$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark OLTP --tableCount 10 --recordCount 1000 --threadCount 8 --password [A-Za-z0-9+/=]+",

$"python3 {this.sysbenchPackagePath}/run-workload.py --dbName sbtest --databaseSystem PostgreSQL --benchmark OLTP --workload oltp_read_write --threadCount 8 --tableCount 10 --recordCount 1000 --hostIpAddress 127.0.0.1 --durationSecs 300 --password [A-Za-z0-9+/=]+",
Expand All @@ -589,7 +589,7 @@ private IEnumerable<string> GetProfileExpectedCommands(bool singleVM, string dat
$"python3 {this.sysbenchPackagePath}/configure-workload-generator.py --distro Ubuntu --databaseSystem PostgreSQL --packagePath {this.sysbenchPackagePath}",

$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --tableCount 10 --warehouses 1 --threadCount 8 --password [A-Za-z0-9+/=]+",
$"python3 {this.postgreSQLPackagePath}/distribute-database.py --dbName sbtest --directories \"{currentDirectory}/mnt_vc_0;{currentDirectory}/mnt_vc_1;{currentDirectory}/mnt_vc_2;\" --password [A-Za-z0-9+/=]+",
$"python3 {this.postgreSQLPackagePath}/distribute-database.py --dbName sbtest --directories \"/mnt_vc_0;/mnt_vc_1;/mnt_vc_2;\" --password [A-Za-z0-9+/=]+",
$"python3 {this.sysbenchPackagePath}/populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --tableCount 10 --warehouses 100 --threadCount 8 --password [A-Za-z0-9+/=]+",

$"python3 {this.sysbenchPackagePath}/run-workload.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --workload tpcc --threadCount 8 --tableCount 10 --warehouses 100 --hostIpAddress 127.0.0.1 --durationSecs 1800 --password [A-Za-z0-9+/=]+",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ private void SetupDefaultMockBehaviors(PlatformID platformID)

this.mockFixture.DiskManager.Setup(mgr => mgr.GetDisksAsync(It.IsAny<CancellationToken>()))
.ReturnsAsync(this.disks);


this.mockFixture.File.Setup(f => f.Exists(It.IsAny<string>())).Returns(true);
this.mockFixture.Directory.Setup(d => d.Exists(It.IsAny<string>())).Returns(true);

this.mockFixture.Parameters = new Dictionary<string, IConvertible>()
{
{ nameof(MountDisks.MountPointPrefix), "/mockmountpath" }
Expand Down
24 changes: 23 additions & 1 deletion src/VirtualClient/VirtualClient.Dependencies/MountDisks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace VirtualClient.Dependencies
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -56,6 +57,18 @@ public string MountPointPrefix
}
}

/// <summary>
/// Optional Parameter to make Mount Location at the Root
/// </summary>
public string? MountLocation
{
get
{
this.Parameters.TryGetValue(nameof(MountDisks.MountLocation), out IConvertible mountLocation);
return mountLocation?.ToString();
}
}

/// <summary>
/// Provides components and services for managing the system.
/// </summary>
Expand Down Expand Up @@ -135,7 +148,14 @@ private async Task<bool> GenerateMountPointsAsync(IEnumerable<Disk> disks, ISyst
// mount every volume that doesn't have an accessPath.
foreach (DiskVolume volume in disk.Volumes.Where(v => v.AccessPaths?.Any() != true))
{
string newMountPoint = this.PlatformSpecifics.Combine(this.PlatformSpecifics.CurrentDirectory, $"{this.MountPointPrefix}_{counter++}");
string newMountPoint = this.PlatformSpecifics.Combine(this.PlatformSpecifics.CurrentDirectory, $"{this.MountPointPrefix}_{counter}");

if (this.MountLocation == "Root" && this.Platform == PlatformID.Unix)
{
newMountPoint = $"/{this.MountPointPrefix}_{counter}";
}

counter++;

if (!systemManager.FileSystem.Directory.Exists(newMountPoint))
{
Expand All @@ -144,6 +164,8 @@ private async Task<bool> GenerateMountPointsAsync(IEnumerable<Disk> disks, ISyst

await this.diskManager.CreateMountPointAsync(volume, newMountPoint, cancellationToken);

await this.systemManager.MakeFilesExecutableAsync(newMountPoint, this.Platform, cancellationToken);

mountPointsCreated = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
"Type": "MountDisks",
"Parameters": {
"Scenario": "CreateMountPoints",
"MountLocation": "Root",
"Role": "Server"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"Type": "MountDisks",
"Parameters": {
"Scenario": "CreateMountPoints",
"MountLocation": "Root",
"Role": "Server"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
"Type": "MountDisks",
"Parameters": {
"Scenario": "CreateMountPoints",
"MountLocation": "Root",
"Role": "Server"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"Type": "MountDisks",
"Parameters": {
"Scenario": "CreateMountPoints",
"MountLocation": "Root",
"Role": "Server"
}
},
Expand Down