Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service: add some unit test cases #1455

Merged
merged 3 commits into from
Nov 3, 2023
Merged

Commits on Nov 2, 2023

  1. tests: add unit test case for blob_cache.rs, block_device.rs, fs_cach…

    …e.rs, singleton.rs under service/src
    
    1. In blob_cache.rs, two simple lines of code have been added to cover previously missed cases.
    2. In block_device.rs, some test cases are added to cover function export(), block_size(), blocks_to_size(), and size_to_blocks().
    3. In fs_cache.rs, some test cases are added to cover function try_from() for struct FsCacheMsgOpen and FsCacheMsgRead.
    4. In singletion.rs, some test cases are added to cover function initialize_blob_cache() and initialize_fscache_service(). In addition, fscache must be correctly enabled firstly as the device file `/dev/cachefiles` will used by function initialize_fscache_service().
    
    Signed-off-by: hijackthe2 <2948278083@qq.com>
    hijackthe2 committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    42ec78f View commit details
    Browse the repository at this point in the history
  2. docs: add fscache configuation

    Signed-off-by: hijackthe2 <2948278083@qq.com>
    hijackthe2 committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    efa80a0 View commit details
    Browse the repository at this point in the history
  3. ci: add configurations to setup fscache

    Since using `/dev/cachefiles` requires sudo mode, so some environment variables are defined and we use `sudo -E` to pass these environment variables to sudo operations.
    
    The script file for enabling fscache is misc/fscache/setup.sh
    
    Signed-off-by: hijackthe2 <2948278083@qq.com>
    hijackthe2 committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    62adc28 View commit details
    Browse the repository at this point in the history