github.com/skanehira/moby@v17.12.1-ce-rc2+incompatible/profiles/seccomp/seccomp_test.go (about)

     1  // +build linux
     2  
     3  package seccomp
     4  
     5  import (
     6  	"io/ioutil"
     7  	"testing"
     8  
     9  	"github.com/docker/docker/oci"
    10  )
    11  
    12  func TestLoadProfile(t *testing.T) {
    13  	f, err := ioutil.ReadFile("fixtures/example.json")
    14  	if err != nil {
    15  		t.Fatal(err)
    16  	}
    17  	rs := oci.DefaultSpec()
    18  	if _, err := LoadProfile(string(f), &rs); err != nil {
    19  		t.Fatal(err)
    20  	}
    21  }
    22  
    23  func TestLoadDefaultProfile(t *testing.T) {
    24  	f, err := ioutil.ReadFile("default.json")
    25  	if err != nil {
    26  		t.Fatal(err)
    27  	}
    28  	rs := oci.DefaultSpec()
    29  	if _, err := LoadProfile(string(f), &rs); err != nil {
    30  		t.Fatal(err)
    31  	}
    32  }