Merge pull request #41499 from thaJeztah/seccomp_test_updates
seccomp: add test for loading old JSON format
This commit is contained in:
commit
410b4da0dc
2 changed files with 1606 additions and 0 deletions
1593
profiles/seccomp/fixtures/default-old-format.json
Normal file
1593
profiles/seccomp/fixtures/default-old-format.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -20,6 +20,19 @@ func TestLoadProfile(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TestLoadLegacyProfile tests loading a seccomp profile in the old format
|
||||
// (before https://github.com/docker/docker/pull/24510)
|
||||
func TestLoadLegacyProfile(t *testing.T) {
|
||||
f, err := ioutil.ReadFile("fixtures/default-old-format.json")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
rs := oci.DefaultSpec()
|
||||
if _, err := LoadProfile(string(f), &rs); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadDefaultProfile(t *testing.T) {
|
||||
f, err := ioutil.ReadFile("default.json")
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue