aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/seccomp/libseccomp_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'container/seccomp/libseccomp_test.go')
-rw-r--r--container/seccomp/libseccomp_test.go21
1 files changed, 16 insertions, 5 deletions
diff --git a/container/seccomp/libseccomp_test.go b/container/seccomp/libseccomp_test.go
index f46c36db..3e7de27c 100644
--- a/container/seccomp/libseccomp_test.go
+++ b/container/seccomp/libseccomp_test.go
@@ -2,6 +2,7 @@ package seccomp_test
import (
"crypto/sha512"
+ "encoding/base64"
"errors"
"syscall"
"testing"
@@ -98,11 +99,21 @@ func TestExport(t *testing.T) {
t.Parallel()
want := bpfExpected[bpfPreset{tc.flags, tc.presets}]
- if data, err := Export(Preset(tc.presets, tc.flags), tc.flags); (err != nil) != tc.wantErr {
- t.Errorf("Export: error = %v, wantErr %v", err, tc.wantErr)
+ if data, err := Export(
+ Preset(tc.presets, tc.flags),
+ tc.flags,
+ ); (err != nil) != tc.wantErr {
+ t.Errorf(
+ "Export: error = %v, wantErr %v",
+ err, tc.wantErr,
+ )
return
- } else if got := sha512.Sum512(data); got != want {
- t.Fatalf("Export: hash = %x, want %x", got, want)
+ } else if got := sha512.Sum384(data); got != want {
+ t.Fatalf(
+ "Export: hash = %s, want %s",
+ base64.StdEncoding.EncodeToString(got[:]),
+ base64.StdEncoding.EncodeToString(want[:]),
+ )
return
}
})
@@ -121,7 +132,7 @@ func BenchmarkExport(b *testing.B) {
if err != nil {
b.Fatalf("Export: error = %v", err)
}
- if got := sha512.Sum512(data); got != want {
+ if got := sha512.Sum384(data); got != want {
b.Fatalf("Export: hash = %x, want %x", got, want)
return
}