GoogleCloudPlatform / GoogleCloudPlatform/PerfKitBenchmarker
run bonnie++ reports "You must use the "-u" switch when running as root."
- Dominant language
- Python
- Stars
- 2k
- Forks
- 562
- Avg merge
- 4h 55m
- Merged PRs (30d)
- 69
Description
Maybe we can add "-u" to avoid this issue in case of running as root:
```
diff --git a/perfkitbenchmarker/linux_benchmarks/bonnie_benchmark.py b/perfkitbenchmarker/linux_benchmarks/bonnie_benchmark.py
index e3ae784..a0e1e0f 100644
--- a/perfkitbenchmarker/linux_benchmarks/bonnie_benchmark.py
+++ b/perfkitbenchmarker/linux_benchmarks/bonnie_benchmark.py
@@ -263,9 +263,10 @@ def Run(benchmark_spec):
vms = benchmark_spec.vms
vm = vms[0]
logging.info('Bonnie++ running on %s', vm)
- bonnie_command = ('/usr/sbin/bonnie++ -q -d %s -s %d -n 100 -f' %
+ bonnie_command = ('/usr/sbin/bonnie++ -q -d %s -s %d -n 100 -f -u %s' %
(vm.GetScratchDir(),
- 2 * vm.total_memory_kb / 1024))
+ 2 * vm.total_memory_kb / 1024,
+ vm.user_name))
logging.info('Bonnie++ Results:')
out, _ = vm.RemoteCommand(bonnie_command, should_log=True)
return ParseCSVResults(out.strip())
```
Contributor guide
Assessment
This issue has not been assessed yet.