Merge pull request #2844 from jongwu/unit_test

enable unit test on arm
This commit is contained in:
James O. D. Hunt
2021-10-25 10:58:21 +01:00
committed by GitHub
9 changed files with 54 additions and 14 deletions

View File

@@ -9,6 +9,7 @@ import (
"context"
"fmt"
"os"
"runtime"
"testing"
"time"
@@ -22,7 +23,8 @@ import (
const testDisabledAsNonRoot = "Test disabled as requires root privileges"
func TestTemplateFactory(t *testing.T) {
if os.Geteuid() != 0 {
// template is broken on arm64, so, temporarily disable it on arm64
if runtime.GOARCH == "arm64" || os.Geteuid() != 0 {
t.Skip(testDisabledAsNonRoot)
}

View File

@@ -569,7 +569,7 @@ func (conf *HypervisorConfig) Valid() error {
conf.BlockDeviceDriver = config.VirtioBlockCCW
}
if conf.DefaultMaxVCPUs == 0 {
if conf.DefaultMaxVCPUs == 0 || conf.DefaultMaxVCPUs > defaultMaxQemuVCPUs {
conf.DefaultMaxVCPUs = defaultMaxQemuVCPUs
}