Skip to content

Commit 344a2fb

Browse files
author
Erica Vellanoweth
committed
Fix SPECjvm result file permissions
Run SPECjvm under the Virtual Client user so its result files remain readable and removable by the executor. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fc00a9e-16be-4b9f-8110-7bed5845d9e1
1 parent cccd40c commit 344a2fb

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/VirtualClient/VirtualClient.Actions.FunctionalTests/SpecJvmProfileTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private IEnumerable<string> GetProfileExpectedCommands(PlatformID platform)
188188
case PlatformID.Unix:
189189
commands = new List<string>
190190
{
191-
@"sudo java -XX:ParallelGCThreads=[0-9]+ -XX:\+UseParallelGC -XX:\+UseAES -XX:\+UseSHA -Xms[0-9]+m -Xmx[0-9]+m -jar SPECjvm2008.jar -ikv -ict compress crypto derby mpegaudio scimark serial sunflow"
191+
@"^java -XX:ParallelGCThreads=[0-9]+ -XX:\+UseParallelGC -XX:\+UseAES -XX:\+UseSHA -Xms[0-9]+m -Xmx[0-9]+m -jar SPECjvm2008.jar -ikv -ict compress crypto derby mpegaudio scimark serial sunflow$"
192192
};
193193
break;
194194
}

src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecJvmExecutorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public async Task SpecJvmExecutorRunsTheExpectedWorkloadCommandInLinux()
9595
{
9696
this.SetupDefaultBehaviors(PlatformID.Unix);
9797

98-
string expectedCommand = $@"sudo java -XX:ParallelGCThreads=[0-9]+ -XX:\+UseParallelGC -XX:\+UseAES -XX:\+UseSHA -Xms[0-9]+m -Xmx[0-9]+m -jar SPECjvm2008.jar -ikv -ict test1 test2";
98+
string expectedCommand = $@"^java -XX:ParallelGCThreads=[0-9]+ -XX:\+UseParallelGC -XX:\+UseAES -XX:\+UseSHA -Xms[0-9]+m -Xmx[0-9]+m -jar SPECjvm2008.jar -ikv -ict test1 test2$";
9999

100100
bool commandExecuted = false;
101101
this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDir) =>

src/VirtualClient/VirtualClient.Actions/SPECjvm/SpecJvmExecutor.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ await this.Logger.LogMessageAsync($"{nameof(SpecJvmExecutor)}.ExecuteProcess", t
129129
{
130130
using (BackgroundOperations profiling = BackgroundOperations.BeginProfiling(this, cancellationToken))
131131
{
132-
using (IProcessProxy process = this.systemManagement.ProcessManager.CreateElevatedProcess(this.Platform, pathToExe, commandLineArguments, workingDirectory))
132+
// SPECjvm writes result files into the package directory. Run as the Virtual Client user
133+
// so the executor can read and delete those files after the process completes.
134+
using (IProcessProxy process = this.systemManagement.ProcessManager.CreateProcess(pathToExe, commandLineArguments, workingDirectory))
133135
{
134136
this.CleanupTasks.Add(() => process.SafeKill(this.Logger));
135137
this.LogProcessTrace(process);

0 commit comments

Comments
 (0)