2013-12-18 04:31:26 +00:00
|
|
|
package fips
|
|
|
|
|
2014-10-03 03:13:51 +00:00
|
|
|
import "testing"
|
2013-12-18 04:31:26 +00:00
|
|
|
|
|
|
|
func TestTest(t *testing.T) {
|
2014-10-03 03:13:51 +00:00
|
|
|
expected := ON
|
|
|
|
o, err := ModeSet(expected)
|
|
|
|
if err != nil {
|
|
|
|
if err == ErrFipsDisabled {
|
|
|
|
// ModeSet will not turn it on if fips is not linked in
|
|
|
|
expected = OFF
|
|
|
|
} else {
|
|
|
|
// the error is something else
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o != expected {
|
|
|
|
t.Errorf("expected %q, got %q", expected, o)
|
|
|
|
}
|
2013-12-18 04:31:26 +00:00
|
|
|
}
|