[why] The ipmi command just run in physical machine, the vm not support use ipmi command
[how] Add a judgment only physical machine run ipmi operation
Signed-off-by: Zhang Yu 2134782174@qq.com --- tests/host-info | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/tests/host-info b/tests/host-info index 84f796dcb..f222a7287 100755 --- a/tests/host-info +++ b/tests/host-info @@ -1,5 +1,7 @@ #!/bin/bash
+. $LKP_SRC/lib/env.sh + get_memory() { memory_total=$(cat /proc/meminfo |grep MemTotal | awk '{print $2}') @@ -101,6 +103,7 @@ get_ipmi_ip() # 802.1q VLAN ID : Disabled # RMCP+ Cipher Suites : 0,1,2,3,17 # Cipher Suite Priv Max : XuuaXXXXXXXXXXX + [ is_virt || is_docker ] && return local ip=$(ipmitool lan print | awk 'NR==3{print $4}') [ -n "$ip" ] && echo "ipmi_ip:" $ip