Commit Graph

10 Commits

Author SHA1 Message Date
Jiyong Park 9abfc1f67a Run zipfuse in microdroid
zipfuse now runs in microdroid as a service. The source zip file path
and the mount point are fixed to /dev/block/by-name/microdroid-apk and
/mnt/apk, respectively.

To support that, microdroid_payload.json is amended to add
MicrodroidTestAppk.apk to the payload.img file. This eventually should
be done dynamically by the virt manager.

Bug: 186377508
Test: atest MicrodroidHostTestCases
Change-Id: I7a031ad442995dbd3cdc00a51a0e939c1589a7b2
2021-05-24 09:24:48 +09:00
Jiyong Park e6587cafc6 zipfuse: supports zip on block device
Add a test case to ensure that zipfuse works with a block device whose
content is backed by a zip file. Fortunately, zip-rs already supports
reading a zip file from a block device: it locates the end of central
directory record by reverse-scanning a file from the end.

Bug: 186377508
Test: cargo test (android test missing because we don't have the
loopdevice crate for Android, which is fine)

Change-Id: I8fbbfd18a2a0df2a550e3f679ba74ba603b59efd
2021-05-24 08:18:19 +09:00
Jiyong Park d40f7bb904 zipfuse: add a test for deflate
Add a new test case for the deflate algorithm. Use the zip file that is
created using soong_zip as the input, mount the zip file using zipfuse
and then check the files.

Bug: 186377508
Test: cargo test
Test: atest  ZipFuseTest
Change-Id: I62e9e8af535d8d867b4bc720c636d2dc45ed9953
2021-05-24 07:51:32 +09:00
Jiyong Park a9724a02f3 TEST_MAPPING for ZipFuseTest
Bug: 186377508
Test: watch TH
Change-Id: I2d4fcf851bf6055ee679e0bcaae088e9e3701d2f
2021-05-17 10:00:26 +09:00
Treehugger Robot 6ac0cc0012 Merge "zipfuse: fix on readdir" 2021-05-14 15:03:08 +00:00
Jiyong Park 63a95cf607 zipfuse: fix on readdir
This change fixes a bug that the 'size' parameter of the `readdir` call
was incorrectly interprested as the maximum number of directory entires
that kernel can accept. In fact, that is the maximum number of bytes
that kernel can accept for the directory entries.

To handle this correcty, we incrementally calculate the number of bytes
required to hold directories entries from the specified offset. When the
calculated number becomes greater than the requested buffer size, we
stop and pass the entries enumerated so far.

Adds a test to excercise the path that the directory entries are so many
that they don't fit to a single buffer (thus requiring multiple readdir
calls).

Also made a small change that opendir returns CACHE_DIR so that they are
cached.

Bug: 186377508
Test: atest ZipFuseTest

Change-Id: I86e767b58b2f0793132be462e2a8fa63266f7774
2021-05-14 09:41:37 +09:00
Luke Huang 9761928db0 Add the missing test_suites field to ZipFuseTest
update_crate_tests.py would add ZipFuseTest to the
TEST_MAPPING of crates {syn,futures-task,proc-macro2,libc}
However, due to no test_suites, it would failed TEST_MAPPING presubmit,
error msg "Missing test_suite setting for test: ZipFuseTest"

Bug: 187946695
Test: TH
Change-Id: Ieb94930f5cbe262bffefbca9a68257a31b66f144
2021-05-14 00:56:53 +08:00
Jiyong Park d5df9569eb Fix type error
Bug: 187938225
Test: m zipfuse on aosp_x86_64
Change-Id: I14fe48a09a2b0f204e0a4e5c9e6cb012a7971792
2021-05-13 02:16:54 +09:00
Jiyong Park 851f68ae91 zipfuse: OsString -> CString
libfuse uses CString. In order to avoid conversion between OsString and
CString, zipfuse also internally uses CString.

Bug: 186377508
Test: atest ZipFuseTest

Change-Id: I48cfc294d3d897ab89179205465e652d8ffbeeee
2021-05-12 19:47:45 +09:00
Jiyong Park 331d1ea104 zipfuse: a read-only fuse implementation for zip archive
zipfuse is a read-only FUSE implementation for zip archive. It will be
used to make files embedded in APKs (which are zip files) be accessible
as regular files in microdroid.

Bug: 186377508
Test: atest ZipFuseTest
Change-Id: Idf0fb4d32b8a2d957da9188fedeebb5610050e65
2021-05-12 19:47:41 +09:00