Add unit test to function GetCPUVariantFromArch
Fix import issue on non-linux platforms
Fix some style issue
Signed-off-by: Tony Fang <nenghui.fang@gmail.com>
When images/containers in ARM arch were built/executed on x86 host,
getCPUVariant will fail as it tries to look for /proc/cpuinfo, whose
content is from the host. Adding a new method as fallback to check uname
machine when it happens.
Signed-off-by: Tony Fang <nenghui.fang@gmail.com>