generate and maintain resolv.conf for sandbox

Signed-off-by: Crazykev <crazykev@zju.edu.cn>
This commit is contained in:
Crazykev
2017-05-24 15:38:42 +08:00
parent d0949687b4
commit 9bf7ffd51a
7 changed files with 99 additions and 12 deletions

View File

@@ -161,6 +161,7 @@ func TestSetupSandboxFiles(t *testing.T) {
testRootDir := "test-sandbox-root"
expectedCopys := [][]interface{}{
{"/etc/hosts", testRootDir + "/hosts", os.FileMode(0666)},
{"/etc/resolv.conf", testRootDir + "/resolv.conf", os.FileMode(0644)},
}
c := newTestCRIContainerdService()
var copys [][]interface{}
@@ -169,7 +170,7 @@ func TestSetupSandboxFiles(t *testing.T) {
return nil
}
c.setupSandboxFiles(testRootDir, nil)
assert.Equal(t, expectedCopys, copys, "should copy /etc/hosts for sandbox")
assert.Equal(t, expectedCopys, copys, "should copy expected files for sandbox")
}
func TestRunPodSandbox(t *testing.T) {