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