1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
6 import arvados.collection
8 import arvados_fuse.command
15 from .integration_test import IntegrationTest
16 from .mount_test_base import MountTestBase
18 class CacheTest(IntegrationTest):
19 mnt_args = ["--by-id", "--directory-cache=0"]
21 @IntegrationTest.mount(argv=mnt_args)
22 def test_cache_spill(self):
25 cw = arvados.collection.Collection()
26 f = cw.open("blurg%i" % i, "w")
27 f.write("bloop%i" % i)
29 cw.mkdirs("dir%i" % i)
30 f = cw.open("dir%i/blurg" % i, "w")
31 f.write("dirbloop%i" % i)
34 pdh.append(cw.portable_data_hash())
35 self.pool_test(self.mnt, pdh)
38 def _test_cache_spill(self, mnt, pdh):
39 for i,v in enumerate(pdh):
40 j = os.path.join(mnt, "by_id", v, "blurg%i" % i)
41 self.assertTrue(os.path.exists(j))
42 j = os.path.join(mnt, "by_id", v, "dir%i/blurg" % i)
43 self.assertTrue(os.path.exists(j))
45 for i,v in enumerate(pdh):
46 j = os.path.join(mnt, "by_id", v, "blurg%i" % i)
47 self.assertTrue(os.path.exists(j))
48 j = os.path.join(mnt, "by_id", v, "dir%i/blurg" % i)
49 self.assertTrue(os.path.exists(j))