Add ignore socket test

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2018-03-22 13:17:33 -07:00
parent 2ec3382d2d
commit 9b111bdc39
4 changed files with 31 additions and 1 deletions

View File

@@ -1022,6 +1022,22 @@ func TestDiffTar(t *testing.T) {
fstest.CreateDir("/d3/", 0755),
),
},
{
name: "IgnoreSockets",
validators: []tarEntryValidator{
fileEntry("f2", []byte("content"), 0644),
// There should be _no_ socket here, despite the fstest.CreateSocket below
fileEntry("f3", []byte("content"), 0644),
},
a: fstest.Apply(
fstest.CreateFile("/f1", []byte("content"), 0644),
),
b: fstest.Apply(
fstest.CreateFile("/f2", []byte("content"), 0644),
fstest.CreateSocket("/s0", 0644),
fstest.CreateFile("/f3", []byte("content"), 0644),
),
},
}
for _, at := range tests {