Skip to content

Commit

Permalink
fix(test): Remove unnecessary sudo
Browse files Browse the repository at this point in the history
PR firecracker-microvm#4115 added it to show the microcode version on x86, but it is not
necessary.

Signed-off-by: Takahiro Itazuri <[email protected]>
  • Loading branch information
zulinx86 committed Sep 20, 2023
1 parent a8deede commit d0841c4
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .buildkite/pipeline_cpu_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BkStep(str, Enum):
cpu_template_test = {
"rdmsr": {
BkStep.COMMAND: [
"tools/devtool -y test -- -s -ra -m nonci -n4 --log-cli-level=INFO integration_tests/functional/test_cpu_features.py -k 'test_cpu_rdmsr' "
"sudo tools/devtool -y test -- -s -ra -m nonci -n4 --log-cli-level=INFO integration_tests/functional/test_cpu_features.py -k 'test_cpu_rdmsr' "
],
BkStep.LABEL: "📖 rdmsr",
"instances": ["m5d.metal", "m6a.metal", "m6i.metal"],
Expand All @@ -33,7 +33,7 @@ class BkStep(str, Enum):
"cpuid_wrmsr": {
"snapshot": {
BkStep.COMMAND: [
"tools/devtool -y test -- -s -ra -m nonci -n4 --log-cli-level=INFO integration_tests/functional/test_cpu_features.py -k 'test_cpu_wrmsr_snapshot or test_cpu_cpuid_snapshot'",
"sudo tools/devtool -y test -- -s -ra -m nonci -n4 --log-cli-level=INFO integration_tests/functional/test_cpu_features.py -k 'test_cpu_wrmsr_snapshot or test_cpu_cpuid_snapshot'",
"mkdir -pv tests/snapshot_artifacts_upload/{instance}_{os}_{kv}",
"sudo mv tests/snapshot_artifacts/* tests/snapshot_artifacts_upload/{instance}_{os}_{kv}",
],
Expand All @@ -45,7 +45,7 @@ class BkStep(str, Enum):
BkStep.COMMAND: [
"buildkite-agent artifact download tests/snapshot_artifacts_upload/{instance}_{os}_{kv}/**/* .",
"mv tests/snapshot_artifacts_upload/{instance}_{os}_{kv} tests/snapshot_artifacts",
"tools/devtool -y test -- -s -ra -m nonci -n4 --log-cli-level=INFO integration_tests/functional/test_cpu_features.py -k 'test_cpu_wrmsr_restore or test_cpu_cpuid_restore'",
"sudo tools/devtool -y test -- -s -ra -m nonci -n4 --log-cli-level=INFO integration_tests/functional/test_cpu_features.py -k 'test_cpu_wrmsr_restore or test_cpu_cpuid_restore'",
],
BkStep.LABEL: "📸 load snapshot artifacts created on {instance} {snapshot_os} {snapshot_kv} to {restore_instance} {restore_os} {restore_kv}",
BkStep.TIMEOUT: 30,
Expand All @@ -58,7 +58,7 @@ class BkStep(str, Enum):
},
"aarch64_cpu_templates": {
BkStep.COMMAND: [
"tools/devtool -y test -- -s -ra -m nonci --log-cli-level=INFO integration_tests/functional/test_cpu_features_aarch64.py"
"sudo tools/devtool -y test -- -s -ra -m nonci --log-cli-level=INFO integration_tests/functional/test_cpu_features_aarch64.py"
],
BkStep.LABEL: "📖 cpu templates",
"instances": ["m6g.metal", "c7g.metal"],
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/pipeline_cross.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def restore_step(label, src_instance, src_kv, dst_instance, dst_os, dst_kv):
"command": [
f"buildkite-agent artifact download snapshots/{src_instance}_{src_kv}/* .",
f"mv -v snapshots/{src_instance}_{src_kv} snapshot_artifacts",
f"./tools/devtool -y test -- -m nonci {k_val} integration_tests/functional/test_snapshot_restore_cross_kernel.py",
f"sudo ./tools/devtool -y test -- -m nonci {k_val} integration_tests/functional/test_snapshot_restore_cross_kernel.py",
],
"label": label,
"timeout": 30,
Expand All @@ -39,7 +39,7 @@ def cross_steps():
snap_instances = ["m5d.metal", "m6i.metal", "m6a.metal"]
groups = []
commands = [
"./tools/devtool -y sh ./tools/create_snapshot_artifact/main.py",
"sudo ./tools/devtool -y sh ./tools/create_snapshot_artifact/main.py",
"mkdir -pv snapshots/{instance}_{kv}",
"sudo chown -Rc $USER: snapshot_artifacts",
"mv -v snapshot_artifacts/* snapshots/{instance}_{kv}",
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipeline_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def build_group(test):
retries = test.pop("retries")
return group(
label=test.pop("label"),
command=f"./tools/devtool -y test {devtool_opts} -- -m nonci --reruns {retries} --perf-fail {test_path}",
command=f"sudo ./tools/devtool -y test {devtool_opts} -- -m nonci --reruns {retries} --perf-fail {test_path}",
artifacts=["./test_results/*"],
instances=test.pop("instances"),
platforms=test.pop("platforms"),
Expand Down
14 changes: 7 additions & 7 deletions .buildkite/pipeline_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
args = COMMON_PARSER.parse_args()

step_style = {
"command": "./tools/devtool -y test -- ../tests/integration_tests/style/",
"command": "sudo ./tools/devtool -y test -- ../tests/integration_tests/style/",
"label": "🪶 Style",
"priority": DEFAULT_PRIORITY,
}
Expand All @@ -43,25 +43,25 @@

devctr_grp = group(
"🐋 Dev Container Sanity Build",
"./tools/devtool -y build_devctr",
"sudo ./tools/devtool -y build_devctr",
**defaults_once_per_architecture,
)

release_grp = group(
"📦 Release Sanity Build",
"./tools/devtool -y sh ./tools/release.sh --libc musl --profile release --make-release",
"sudo ./tools/devtool -y sh ./tools/release.sh --libc musl --profile release --make-release",
**defaults_once_per_architecture,
)

build_grp = group(
"📦 Build",
"./tools/devtool -y test -- ../tests/integration_tests/build/",
"sudo ./tools/devtool -y test -- ../tests/integration_tests/build/",
**defaults,
)

functional_grp = group(
"⚙ Functional and security 🔒",
"./tools/devtool -y test -- -n 8 --dist worksteal integration_tests/{{functional,security}}",
"sudo ./tools/devtool -y test -- -n 8 --dist worksteal integration_tests/{{functional,security}}",
**defaults,
)

Expand All @@ -77,7 +77,7 @@

performance_grp = group(
"⏱ Performance",
"./tools/devtool -y test -- ../tests/integration_tests/performance/",
"sudo ./tools/devtool -y test -- ../tests/integration_tests/performance/",
**defaults_for_performance,
)

Expand All @@ -93,7 +93,7 @@

kani_grp = group(
"🔍 Kani",
"./tools/devtool -y test -- ../tests/integration_tests/test_kani.py -n auto",
"sudo ./tools/devtool -y test -- ../tests/integration_tests/test_kani.py -n auto",
**defaults_for_kani,
)
for step in kani_grp["steps"]:
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipeline_pr_no_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

optional_grp = group(
"❓ Optional",
"./tools/devtool -y test -c 1-10 -m 0 -- ../tests/integration_tests/ -m 'no_block_pr and not nonci' --log-cli-level=INFO",
"sudo ./tools/devtool -y test -c 1-10 -m 0 -- ../tests/integration_tests/ -m 'no_block_pr and not nonci' --log-cli-level=INFO",
**defaults,
)

Expand Down
4 changes: 2 additions & 2 deletions .buildkite/pipeline_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

vulnerabilities_grp = group(
"🛡️ Vulnerabilities",
"./tools/devtool -y test -- ../tests/integration_tests/security/test_vulnerabilities.py -m 'no_block_pr and not nonci'",
"sudo ./tools/devtool -y test -- ../tests/integration_tests/security/test_vulnerabilities.py -m 'no_block_pr and not nonci'",
**defaults,
)

fingerprint_grp = group(
"🖐️ Fingerprint",
"./tools/devtool -y test -- ../tests/integration_tests/functional/test_cpu_template_helper.py -m nonci -k test_fingerprint_change",
"sudo ./tools/devtool -y test -- ../tests/integration_tests/functional/test_cpu_template_helper.py -m nonci -k test_fingerprint_change",
**defaults,
)

Expand Down
2 changes: 1 addition & 1 deletion tools/devtool
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ cmd_test() {
# If we got to here, we've got all we need to continue.
say "Kernel version: $(uname -r)"
if [ "$(uname --machine)" = "x86_64" ]; then
say "Microcode version: $(sudo cat /sys/devices/system/cpu/cpu0/microcode/version)"
say "Microcode version: $(cat /sys/devices/system/cpu/cpu0/microcode/version)"
fi
say "$(lscpu)"
say "Starting test run ..."
Expand Down

0 comments on commit d0841c4

Please sign in to comment.