2016-01-19 22:57:03 +00:00
|
|
|
// +build linux
|
|
|
|
|
2018-02-05 21:05:59 +00:00
|
|
|
package seccomp // import "github.com/docker/docker/profiles/seccomp"
|
2016-01-19 22:57:03 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"io/ioutil"
|
|
|
|
"testing"
|
2016-07-13 13:41:30 +00:00
|
|
|
|
|
|
|
"github.com/docker/docker/oci"
|
2016-01-19 22:57:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestLoadProfile(t *testing.T) {
|
|
|
|
f, err := ioutil.ReadFile("fixtures/example.json")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2016-07-13 13:41:30 +00:00
|
|
|
rs := oci.DefaultSpec()
|
|
|
|
if _, err := LoadProfile(string(f), &rs); err != nil {
|
2016-02-19 08:22:36 +00:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
2016-01-19 22:57:03 +00:00
|
|
|
|
2016-02-19 08:22:36 +00:00
|
|
|
func TestLoadDefaultProfile(t *testing.T) {
|
|
|
|
f, err := ioutil.ReadFile("default.json")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2016-07-13 13:41:30 +00:00
|
|
|
rs := oci.DefaultSpec()
|
|
|
|
if _, err := LoadProfile(string(f), &rs); err != nil {
|
2016-01-19 22:57:03 +00:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|