Ignore cleanup with /dev/mapper does not exist

This commit is contained in:
Michael Crosby
2013-10-14 14:23:58 -07:00
parent 5892c8e469
commit 5dd12ba20a
+5 -1
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" {