Skip to contentSkip to conversation

runtime: SKIP if required sysfs file is missing

PATCH In review Paolo Bonzini 2 participants 2 messages Sep 29, 2020 KVM

lore
Share & tools
lore

Paolo Bonzini

author maintainer
#0 lore raw

PATCH 1/1 runtime: SKIP if required sysfs file is missing

This fixes the test once more, so that we correctly skip for example access-reduced-maxphyaddr on AMD processors.

---
 scripts/runtime.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/runtime.bash +1 -1
index 3121c1f..f070e14 100644
@@ -118,7 +118,7 @@ function run()
     for check_param in "${check[@]}"; do
         path=${check_param%%=*}
         value=${check_param#*=}
-        if [ -f "$path" ] && [ "$(cat $path)" != "$value" ]; then
+        if ! [ -f "$path" ] || [ "$(cat $path)" != "$value" ]; then
             print_result "SKIP" $testname "" "$path not equal to $value"
             return 2
         fi
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Paolo Bonzini

This fixes the test once more, so that we correctly skip for example access-reduced-maxphyaddr on AMD processors.

---
 scripts/runtime.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/runtime.bash +1 -1
index 3121c1f..f070e14 100644
@@ -118,7 +118,7 @@ function run()
     for check_param in "${check[@]}"; do
         path=${check_param%%=*}
         value=${check_param#*=}
-        if [ -f "$path" ] && [ "$(cat $path)" != "$value" ]; then
+        if ! [ -f "$path" ] || [ "$(cat $path)" != "$value" ]; then
             print_result "SKIP" $testname "" "$path not equal to $value"
             return 2
         fi
Signature · 1 line
2.26.2