-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tests and command line tool #143
Conversation
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.
Some things are questionable.
func systemRunsCoreboot() (bool, error) { | ||
firmware, err := tools.SMBIOSGetVendor() | ||
if err != nil { | ||
return false, err | ||
} | ||
if strings.Contains(*firmware, string(test.FWCoreboot)) { | ||
return true, nil | ||
} | ||
return false, nil | ||
} | ||
|
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.
This does not belong here.
Maybe a new test set for precondition tests, or move this to ACPI tests, because it's only relevant for this tests so far.
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.
Also a separate commit - "Implementing test to validate if system runs coreboot" or similar
testnosiniterrors = Test{ | ||
Name: "SINIT ACM startup successful", | ||
Required: false, | ||
NonCritical: true, | ||
function: NoSINITErrors, | ||
Status: Implemented, | ||
} |
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.
Why was this removed?
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.
Also seperate commit
func (t Result) String() string { | ||
return [...]string{"TESTNOTRUN", "DEPENDENCY_FAILED", "INTERNAL_ERROR", "FAIL", "WARN", "PASS"}[t] |
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.
Why remove the concept of warn?
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.
Also separate commit.
// AutoPromotionModeIsActive checks if TXT is in auto-promotion mode | ||
func AutoPromotionModeIsActive(txtAPI hwapi.APIInterfaces) (bool, error, error) { | ||
// TXTModeIsSet checks if a TXT mode is set | ||
func TXTModeIsSet(txtAPI hwapi.APIInterfaces) (bool, error, error) { | ||
pol1, pol2, err := readPSLCPPolicy(txtAPI) | ||
if err != nil { | ||
return false, nil, err | ||
} | ||
if pol1 != nil { | ||
if pol1.PolicyType != tools.LCPPolicyTypeAny { | ||
return false, fmt.Errorf("Signed Policy mode active"), nil | ||
return true, fmt.Errorf("Signed Policy mode active"), nil | ||
} | ||
} | ||
if pol2 != nil { | ||
if pol2.PolicyType != tools.LCPPolicyTypeAny { | ||
return false, fmt.Errorf("Signed Policy mode active"), nil | ||
} | ||
} | ||
return true, nil, nil | ||
} | ||
|
||
// SignedPolicyModeIsActive checks if TXT is in signed policy mode | ||
func SignedPolicyModeIsActive(txtAPI hwapi.APIInterfaces) (bool, error, error) { | ||
pol1, pol2, err := readPSLCPPolicy(txtAPI) | ||
if err != nil { | ||
return false, nil, err | ||
} | ||
if pol1 != nil { | ||
if pol1.PolicyType != tools.LCPPolicyTypeList { | ||
return false, fmt.Errorf("Auto-promotion mode active"), nil | ||
return true, fmt.Errorf("Auto-promotion mode active"), nil | ||
} | ||
} | ||
if pol2 != nil { | ||
if pol2.PolicyType != tools.LCPPolicyTypeAny { | ||
return true, fmt.Errorf("Signed Policy mode active"), nil | ||
} | ||
if pol2.PolicyType != tools.LCPPolicyTypeList { | ||
return false, fmt.Errorf("Auto-promotion mode active"), nil | ||
return true, fmt.Errorf("Auto-promotion mode active"), nil |
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.
Why we dont keep the granularity?
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.
Maybe you guessed it ;) Separate commit
@@ -287,7 +286,7 @@ func IBBIsTrusted(txtAPI hwapi.APIInterfaces) (bool, error, error) { | |||
if regs.BootStatus&(1<<59) != 0 && regs.BootStatus&(1<<63) != 0 { | |||
return true, nil, nil | |||
} | |||
return false, fmt.Errorf("IBB not trusted"), err | |||
return true, fmt.Errorf("IBB not trusted, MLE not running"), err |
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.
That's impossible. If something returns true all error must be nil.
@@ -19,6 +19,7 @@ var ( | |||
Required: true, | |||
function: CheckRSDPValid, | |||
Status: Implemented, | |||
Firmware: FWNoCoreboot, |
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.
The new Field Firmware is just wrong, whatever it does. That's not clear from the commit message.
) | ||
|
||
// SMBIOSGetVendor gets the vendor name from table 0 | ||
func SMBIOSGetVendor() (*string, error) { |
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.
that must be astracted over the hwapi.
See #142