seccomp: add test for loading old JSON format
Commit 5ff21add06
changed the (JSON) format that's
used for seccomp profiles, but keeping the code backward compatible to allow both
the old or new format.
This patch adds a new test, which loads the old format. It takes the default seccomp
profile before the format was changed.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
ccc1233f37
commit
b8aec34680
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…
Reference in New Issue