-
Notifications
You must be signed in to change notification settings - Fork 70
cc-check: Always run all tests #639
cc-check: Always run all tests #639
Conversation
cc-check.go
Outdated
} | ||
|
||
ccLog.Error(msg) | ||
count += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should replace count += 1 with count++
cc-check.go
Outdated
} | ||
|
||
for module, details := range modules { | ||
if !haveKernelModule(module) { | ||
return fmt.Errorf("kernel module %q (%s) not found", module, details.desc) | ||
ccLog.Errorf("kernel module %q (%s) not found", module, details.desc) | ||
count += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should replace count += 1 with count++
cc-check.go
Outdated
// checkKernelModules checks all required kernel modules and returns an error | ||
// for fatal issues along with a count of the number of module errors seen | ||
// (all such errors are logged by this function). | ||
func checkKernelModules(modules map[string]kernelModule) (err error, count uint32) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error should be the last type when returning multiple items
cc-check.go
Outdated
return checkCPU("flag", cpuflags, required) | ||
} | ||
|
||
func checkCPUAttribs(cpuinfo string, attribs map[string]string) error { | ||
func checkCPUAttribs(cpuinfo string, attribs map[string]string) (error, uint32) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error should be the last type when returning multiple items
cc-check.go
Outdated
} | ||
func checkCPUFlags(cpuflags string, required map[string]string) error { | ||
func checkCPUFlags(cpuflags string, required map[string]string) (error, uint32) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error should be the last type when returning multiple items
cc-check.go
Outdated
} | ||
|
||
for attrib, desc := range attribs { | ||
found := findAnchoredString(cpuinfo, attrib) | ||
if !found { | ||
return fmt.Errorf("CPU does not have required %v: %q (%s)", tag, desc, attrib) | ||
ccLog.Errorf("CPU does not have required %v: %q (%s)", tag, desc, attrib) | ||
count += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should replace count += 1 with count++
cc-check.go
Outdated
// checkCPU checks all required CPU attributes modules and returns an error | ||
// for fatal issues along with a count of the number of CPU attribute errors | ||
// seen (all such errors are logged by this function). | ||
func checkCPU(tag, cpuinfo string, attribs map[string]string) (err error, count uint32) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error should be the last type when returning multiple items
a3b844b
to
8025fa7
Compare
Change "cc-check" so that it always runs all commands before erroring. Previously, it would fail on first error, but this could mask the real reason for failure. For example, on a system with nesting and vhost disabled, "cc-check" would fail with a nesting error. But the nesting check is not strictly required (clearcontainers#281) whereas vhost definitely is which lead to confusing results for users. "cc-check" will now run all tests and display an error message at the end if any errors were found in the set of tests run. Fixes clearcontainers#638. Signed-off-by: James O. D. Hunt <[email protected]>
KVM nesting support is not strictly necessary, so warn rather than erroring if not available. Fixes clearcontainers#281. Signed-off-by: James O. D. Hunt <[email protected]>
8025fa7
to
413e2ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice cleanup.
lgtm
Again, coverall is stuck - the report is here: https://coveralls.io/jobs/29737580 (successful). |
kubernetes qa-passed 👍 |
…aller-than-image config: Detect if VM memory smaller than image
Change "cc-check" so that it always runs all commands before erroring.
Previously, it would fail on first error, but this could mask the real
reason for failure. For example, on a system with nesting and vhost
disabled, "cc-check" would fail with a nesting error. But the nesting
check is not strictly required (#281) whereas vhost definitely is which
lead to confusing results for users.
"cc-check" will now run all tests and display an error message at the end
if any errors were found in the set of tests run.
Fixes #638.
Signed-off-by: James O. D. Hunt [email protected]