[why] Error: Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory
[how] Run ipmi command only on physical machines
Signed-off-by: Zhang Yu 2134782174@qq.com --- tests/host-info | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/host-info b/tests/host-info index 84f796dcb..7e6e71a13 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}') @@ -102,7 +104,7 @@ get_ipmi_ip() # RMCP+ Cipher Suites : 0,1,2,3,17 # Cipher Suite Priv Max : XuuaXXXXXXXXXXX local ip=$(ipmitool lan print | awk 'NR==3{print $4}') - [ -n "$ip" ] && echo "ipmi_ip:" $ip + [ -n "$ip" ] && echo "ipmi_ip: $ip"
}
@@ -113,7 +115,7 @@ main() get_partitions get_mac get_cpu_info - get_ipmi_ip + is_virt || get_ipmi_ip }
main
On Mon, Dec 14, 2020 at 10:20:09AM +0800, Zhang Yu wrote:
[why] Error: Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory
[how] Run ipmi command only on physical machines
Signed-off-by: Zhang Yu 2134782174@qq.com
tests/host-info | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/host-info b/tests/host-info index 84f796dcb..7e6e71a13 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}') @@ -102,7 +104,7 @@ get_ipmi_ip() # RMCP+ Cipher Suites : 0,1,2,3,17 # Cipher Suite Priv Max : XuuaXXXXXXXXXXX local ip=$(ipmitool lan print | awk 'NR==3{print $4}')
- [ -n "$ip" ] && echo "ipmi_ip:" $ip
- [ -n "$ip" ] && echo "ipmi_ip: $ip"
}
@@ -113,7 +115,7 @@ main() get_partitions get_mac get_cpu_info
- get_ipmi_ip
- is_virt || get_ipmi_ip
need add is_docker ?
Thanks, Shenwei
}
main
2.23.0