Ignore cleanup with /dev/mapper does not exist

Upstream-commit: 5dd12ba20a962c0f67e5eefb7b0e00e5caccb1e1
Component: engine
This commit is contained in:
Michael Crosby
2013-10-14 14:23:58 -07:00
parent 7b24c05ec6
commit b5fc16147b

View File

@ -121,6 +121,10 @@ func cleanupDevMapper() error {
// Remove any leftover devmapper devices from previous unit run tests
infos, err := ioutil.ReadDir("/dev/mapper")
if err != nil {
// If the mapper file does not exist there is nothing to clean up
if os.IsNotExist(err) {
return nil
}
return err
}
pools := []string{}
@ -148,7 +152,7 @@ func init() {
os.Setenv("TEST", "1")
os.Setenv("DOCKER_LOOPBACK_DATA_SIZE", "209715200") // 200MB
os.Setenv("DOCKER_LOOPBACK_META_SIZE", "104857600") // 100MB
os.Setenv("DOCKER_BASE_FS_SIZE", "157286400") // 150MB
os.Setenv("DOCKER_BASE_FS_SIZE", "157286400") // 150MB
// Hack to run sys init during unit testing
if selfPath := utils.SelfPath(); selfPath == "/sbin/init" || selfPath == "/.dockerinit" {