[ARVADOS] updated: 559acee1dca5524f9650e360d5f16fc1582a77f0

git at public.curoverse.com git at public.curoverse.com
Wed Aug 5 14:30:22 EDT 2015


Summary of changes:
 doc/_includes/_ssh_addkey.liquid                   |   4 +-
 .../create-standard-objects.html.textile.liquid    |  31 +-
 doc/install/install-api-server.html.textile.liquid |  33 ++-
 .../install-arv-git-httpd.html.textile.liquid      | 318 +++++++++++++++++++--
 .../install-compute-node.html.textile.liquid       |   4 +-
 .../install-crunch-dispatch.html.textile.liquid    |  36 ++-
 .../install-shell-server.html.textile.liquid       |  12 +-
 docker/api/Dockerfile                              |   4 +-
 docker/api/setup-gitolite.sh.in                    |   2 +-
 services/api/app/models/collection.rb              |   3 +-
 services/api/config/application.default.yml        |   2 +-
 .../api/script/arvados-git-sync.rb                 |   7 +-
 .../arvados/v1/collections_controller_test.rb      |  37 +++
 services/api/test/unit/collection_test.rb          |  33 +++
 services/fuse/arvados_fuse/fusedir.py              |   1 +
 15 files changed, 468 insertions(+), 59 deletions(-)
 rename docker/api/update-gitolite.rb => services/api/script/arvados-git-sync.rb (96%)

       via  559acee1dca5524f9650e360d5f16fc1582a77f0 (commit)
       via  595d517e5293855690fdc65255648c32970dd31d (commit)
       via  f097af1ebfdb1ff849c1d5be4bda5b098871b877 (commit)
       via  62f471c57d3acd04fe6bb3dc10c195f2cef10024 (commit)
       via  5cff00f1efc7515fd0b8543f618214ecec384eb5 (commit)
       via  5f3ac75bd946f743ca40ebf454dc29900cddfefb (commit)
       via  e0a1fc70f919741a8ad840dc40cfcc87f2751722 (commit)
       via  e9bee65d40255ab7aced5d380c546068c604bc38 (commit)
       via  68481a07e385c86a03b9c963adc9be091373a78a (commit)
       via  b369dfc85a356371e1bfb1eb1c3ddb8e8eaffc3d (commit)
       via  10556d8eea7e57dafe1495f8ceb6fae809d033a3 (commit)
       via  6fad718eea05f4292d89470b62e067754873e85d (commit)
       via  6f883592fd278398f8b5af3d4ff26196469a5050 (commit)
       via  f7e00eb55fbcc41b8cd1f416344ad4abdb020bc0 (commit)
       via  01a76d36f6afcd3bb7c8e224881fe98364a47b85 (commit)
       via  30d1623c0fe687acdef334c037c24752c0c61620 (commit)
       via  c94bc0d5c2ae1514a7b0799477279567fa4df177 (commit)
       via  89dcdd013aef473cef6f2b94bfcd2308b60a55d4 (commit)
       via  70a9d8683b62a91e7d3ee3e827af6b69b9aa9a94 (commit)
       via  4c5925a0eceebcd86a4c59a0123dac49aabffae0 (commit)
       via  b9a61af34e1f77500d5d0850b4bfd6e11a6f783a (commit)
       via  821cb42d42976ec6f750e0b0b191ccc36cbad295 (commit)
       via  cec08599bc15bccdf1acfebb4f773f139cc45dcb (commit)
       via  ed2e9fece8c44c5aa464de012b3fce84e7b049eb (commit)
       via  0c96fc858f1f4954d997f2065550087dcc7f8bec (commit)
       via  2e92762444af21749e1ef232aecb6eeb98b312cd (commit)
       via  7e773735e9d547381a77baeeb139696dfa66a7a6 (commit)
       via  97fa1e269cf5d33365d76fcdc6ec3f6734b0f468 (commit)
       via  e51a22dc5b9da795b68c87cb9d0a45e4732ed2f6 (commit)
      from  004243ab59e3a2fc36a708b66373297dd83e0b91 (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 559acee1dca5524f9650e360d5f16fc1582a77f0
Author: radhika <radhika at curoverse.com>
Date:   Wed Aug 5 14:28:27 2015 -0400

    6277: more tests with error checking

diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb
index 99a09bd..f86cf22 100644
--- a/services/api/app/models/collection.rb
+++ b/services/api/app/models/collection.rb
@@ -172,6 +172,7 @@ class Collection < ArvadosModel
   end
 
   def check_encoding
+    return true if !manifest_text
     if manifest_text.encoding.name == 'UTF-8' and manifest_text.valid_encoding?
       true
     else
@@ -198,7 +199,7 @@ class Collection < ArvadosModel
       Keep::Manifest.validate! manifest_text
       true
     rescue => e
-      logger.warn e
+      errors.add :manifest_text, e.message
       false
     end
   end
diff --git a/services/api/test/functional/arvados/v1/collections_controller_test.rb b/services/api/test/functional/arvados/v1/collections_controller_test.rb
index c521e59..dac960f 100644
--- a/services/api/test/functional/arvados/v1/collections_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb
@@ -826,6 +826,43 @@ EOS
         }
       }
       assert_response 422
+      response_errors = json_response['errors']
+      assert_not_nil response_errors, 'Expected error in response'
+      if manifest_text
+        assert(response_errors.first.include?('Invalid manifest'),
+               "Expected 'Invalid manifest' error in #{response_errors.first}")
+      else
+        assert(response_errors.first.include?('No manifest found'),
+               "Expected 'No manifest found' error in #{response_errors.first}")
+      end
+    end
+  end
+
+  [
+    nil,
+    ". 0:0:foo.txt",
+    ". d41d8cd98f00b204e9800998ecf8427e foo.txt",
+    "d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt",
+    ". d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt",
+  ].each do |manifest_text|
+    test "update collection with invalid manifest #{manifest_text}" do
+      authorize_with :active
+      post :update, {
+        id: 'zzzzz-4zz18-bv31uwvy3neko21',
+        collection: {
+          manifest_text: manifest_text,
+        }
+      }
+      assert_response 422
+      response_errors = json_response['errors']
+      assert_not_nil response_errors, 'Expected error in response'
+      if manifest_text
+        assert(response_errors.first.include?('Invalid manifest'),
+               "Expected 'Invalid manifest' error in #{response_errors.first}")
+      else
+        assert(response_errors.first.include?('No manifest found'),
+               "Expected 'No manifest found' error in #{response_errors.first}")
+      end
     end
   end
 end
diff --git a/services/api/test/unit/collection_test.rb b/services/api/test/unit/collection_test.rb
index bcdefe7..d6b50da 100644
--- a/services/api/test/unit/collection_test.rb
+++ b/services/api/test/unit/collection_test.rb
@@ -39,6 +39,39 @@ class CollectionTest < ActiveSupport::TestCase
     end
   end
 
+  [
+    nil,
+    ". 0:0:foo.txt",
+    ". d41d8cd98f00b204e9800998ecf8427e foo.txt",
+    "d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt",
+    ". d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt",
+  ].each do |manifest_text|
+    test "create collection with invalid manifest text #{manifest_text} and expect error" do
+      act_as_system_user do
+        c = Collection.create(manifest_text: manifest_text)
+        assert !c.valid?
+      end
+    end
+  end
+
+  [
+    nil,
+    ". 0:0:foo.txt",
+    ". d41d8cd98f00b204e9800998ecf8427e foo.txt",
+    "d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt",
+    ". d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt",
+  ].each do |manifest_text|
+    test "update collection with invalid manifest text #{manifest_text} and expect error" do
+      act_as_system_user do
+        c = create_collection 'foo', Encoding::US_ASCII
+        assert c.valid?
+
+        c.update_attribute 'manifest_text', manifest_text
+        assert !c.valid?
+      end
+    end
+  end
+
   test 'create and update collection and verify file_names' do
     act_as_system_user do
       c = create_collection 'foo', Encoding::US_ASCII
diff --git a/services/fuse/arvados_fuse/fusedir.py b/services/fuse/arvados_fuse/fusedir.py
index de12fcc..8ffca49 100644
--- a/services/fuse/arvados_fuse/fusedir.py
+++ b/services/fuse/arvados_fuse/fusedir.py
@@ -23,6 +23,7 @@ _logger = logging.getLogger('arvados.arvados_fuse')
 # appear as underscores in the fuse mount.)
 _disallowed_filename_characters = re.compile('[\x00/]')
 
+# '.' and '..' are not reachable if API server is newer than #6277
 def sanitize_filename(dirty):
     """Replace disallowed filename characters with harmless "_"."""
     if dirty is None:

commit 595d517e5293855690fdc65255648c32970dd31d
Merge: 5cff00f f097af1
Author: radhika <radhika at curoverse.com>
Date:   Wed Aug 5 13:35:06 2015 -0400

    Merge branch 'master' into 6277-check_manifest_validity


commit 5cff00f1efc7515fd0b8543f618214ecec384eb5
Merge: 004243a 5f3ac75
Author: radhika <radhika at curoverse.com>
Date:   Wed Aug 5 12:12:11 2015 -0400

    Merge branch 'master' into 6277-check_manifest_validity


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


hooks/post-receive
-- 




More information about the arvados-commits mailing list