[ARVADOS] updated: 1.1.2-141-gd3dd014

Git user git at public.curoverse.com
Tue Jan 30 20:47:13 EST 2018


Summary of changes:
 services/crunch-run/crunchrun.go      |  3 +--
 services/crunch-run/crunchrun_test.go | 11 +++++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

       via  d3dd0147fc7c0e344b4cca1fb92d7c500924bd37 (commit)
      from  e1d26636c385f4c09484673b1b90eec6191ba6c5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit d3dd0147fc7c0e344b4cca1fb92d7c500924bd37
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Tue Jan 30 20:46:50 2018 -0500

    12764: Handle empty directories.  Fix test.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index dfb1eb8..5c4f105 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -588,8 +588,7 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
 				if walkinfo.Mode().IsRegular() {
 					return copyfile(walkpath, path.Join(cp.bind, walkpath[len(cp.src):]))
 				} else if walkinfo.Mode().IsDir() {
-					// will be visited by Walk()
-					return nil
+					return os.MkdirAll(path.Join(cp.bind, walkpath[len(cp.src):]), 0770)
 				} else {
 					return fmt.Errorf("Source %q is not a regular file or directory", cp.src)
 				}
diff --git a/services/crunch-run/crunchrun_test.go b/services/crunch-run/crunchrun_test.go
index 5965a7d..8a7139f 100644
--- a/services/crunch-run/crunchrun_test.go
+++ b/services/crunch-run/crunchrun_test.go
@@ -1243,15 +1243,26 @@ func (s *TestSuite) TestSetupMounts(c *C) {
 			"/tmp/foo": {Kind: "collection",
 				PortableDataHash: "59389a8f9ee9d399be35462a0f92541c+53",
 				Writable:         true},
+			"/tmp/bar": {Kind: "collection",
+				PortableDataHash: "59389a8f9ee9d399be35462a0f92541d+53",
+				Path:             "baz",
+				Writable:         true},
 		}
 		cr.OutputPath = "/tmp"
 
 		os.MkdirAll(realTemp+"/keep1/by_id/59389a8f9ee9d399be35462a0f92541c+53", os.ModePerm)
+		os.MkdirAll(realTemp+"/keep1/by_id/59389a8f9ee9d399be35462a0f92541d+53/baz", os.ModePerm)
+
+		rf, _ := os.Create(realTemp+"/keep1/by_id/59389a8f9ee9d399be35462a0f92541d+53/baz/quux")
+		rf.Write([]byte("bar"))
+		rf.Close()
 
 		err := cr.SetupMounts()
 		c.Check(err, IsNil)
 		_, err = os.Stat(cr.HostOutputDir + "/foo")
 		c.Check(err, IsNil)
+		_, err = os.Stat(cr.HostOutputDir + "/bar/quux")
+		c.Check(err, IsNil)
 		os.RemoveAll(cr.ArvMountPoint)
 		cr.CleanupDirs()
 		checkEmpty()

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list