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
6 changes: 3 additions & 3 deletions src/VirtualClient/VirtualClient.Main/BootstrapCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ protected void Validate()
//
// e.g.
// --key-vault="https://any.vault.azure.net?cid=8cdebecc...&tid=42005d4d...&crti=ANY&crts=any.corp.azure.com"
if (string.IsNullOrWhiteSpace(this.AccessToken)
if (string.IsNullOrWhiteSpace(this.AccessToken)
&& string.IsNullOrWhiteSpace(this.TokenFilePath)
&& string.IsNullOrWhiteSpace(this.TenantId)
&& string.IsNullOrWhiteSpace(this.TenantId)
&& (this.KeyVaultStore as DependencyKeyVaultStore)?.Credentials == null)
{
throw new ArgumentException(
Expand All @@ -153,4 +153,4 @@ protected void Validate()
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/VirtualClient/VirtualClient.Main/CommandLineParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -642,4 +642,4 @@ private static string[] PreprocessArguments(params string[] args)
return preprocessedArgs;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ protected void SetHostMetadataTelemetryProperties(IEnumerable<string> profiles,
new Dictionary<string, object>
{
{ "exitWait", this.ExitWait },
{ "layout", this.Layout.ToString() },
{ "layout", this.Layout?.ToString() },
{ "logToFile", this.LogToFile },
{ "iterations", this.Iterations?.ProfileIterations },
{ "profiles", string.Join(",", profiles.Select(p => Path.GetFileName(p))) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,5 +538,18 @@ private static Tuple<string, string> GetAccessTokenPair()

return new Tuple<string, string>(decodedOriginalBytes, decodedObscuredBytes);
}

[Test]
public void SetHostMetadataTelemetryPropertiesDoesNotThrowWhenLayoutIsNull()
{
// Layout is not mandatory for setting host metadata properties.
this.command.Layout = null;

string profile = "TEST-WORKLOAD-PROFILE.json";
List<string> profiles = new List<string> { this.mockFixture.GetProfilesPath(profile) };

// Act & Assert - Should not throw expection
Assert.DoesNotThrow(() => this.command.SetHostMetadataTelemetryProperties(profiles, this.mockFixture.Dependencies));
}
}
}
Loading