Merge pull request #41499 from thaJeztah/seccomp_test_updates

seccomp: add test for loading old JSON format
This commit is contained in:
Sebastiaan van Stijn 2020-09-28 21:40:33 +02:00 committed by GitHub
commit 410b4da0dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1606 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -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 {