utils.hh (2d6bf515df9906c2a19acbcb53521ebdd42885bd) | utils.hh (8eecd9ce05ee9744ebf9ecd0c2d1d2431b9fe06c) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 2019 The FreeBSD Foundation 5 * 6 * This software was developed by BFF Storage Systems, LLC under sponsorship 7 * from the FreeBSD Foundation. 8 * --- 26 unchanged lines hidden (view full) --- 35#define NAP_NS (100'000'000) 36 37void get_unprivileged_id(uid_t *uid, gid_t *gid); 38inline void nap() 39{ 40 usleep(NAP_NS / 1000); 41} 42 | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 2019 The FreeBSD Foundation 5 * 6 * This software was developed by BFF Storage Systems, LLC under sponsorship 7 * from the FreeBSD Foundation. 8 * --- 26 unchanged lines hidden (view full) --- 35#define NAP_NS (100'000'000) 36 37void get_unprivileged_id(uid_t *uid, gid_t *gid); 38inline void nap() 39{ 40 usleep(NAP_NS / 1000); 41} 42 |
43extern const uint32_t libfuse_max_write; 44extern const uint32_t default_max_write; |
|
43class FuseTest : public ::testing::Test { 44 protected: 45 uint32_t m_maxreadahead; | 45class FuseTest : public ::testing::Test { 46 protected: 47 uint32_t m_maxreadahead; |
48 uint32_t m_maxwrite; |
|
46 uint32_t m_init_flags; 47 bool m_allow_other; 48 bool m_default_permissions; 49 uint32_t m_kernel_minor_version; 50 enum poll_method m_pm; 51 bool m_push_symlinks_in; 52 bool m_ro; | 49 uint32_t m_init_flags; 50 bool m_allow_other; 51 bool m_default_permissions; 52 uint32_t m_kernel_minor_version; 53 enum poll_method m_pm; 54 bool m_push_symlinks_in; 55 bool m_ro; |
56 bool m_async; |
|
53 MockFS *m_mock = NULL; 54 const static uint64_t FH = 0xdeadbeef1a7ebabe; 55 56 public: 57 int m_maxbcachebuf; 58 59 FuseTest(): 60 /* 61 * libfuse's default max_readahead is UINT_MAX, though it can 62 * be lowered 63 */ 64 m_maxreadahead(UINT_MAX), | 57 MockFS *m_mock = NULL; 58 const static uint64_t FH = 0xdeadbeef1a7ebabe; 59 60 public: 61 int m_maxbcachebuf; 62 63 FuseTest(): 64 /* 65 * libfuse's default max_readahead is UINT_MAX, though it can 66 * be lowered 67 */ 68 m_maxreadahead(UINT_MAX), |
69 m_maxwrite(default_max_write), |
|
65 m_init_flags(0), 66 m_allow_other(false), 67 m_default_permissions(false), 68 m_kernel_minor_version(FUSE_KERNEL_MINOR_VERSION), 69 m_pm(BLOCKING), 70 m_push_symlinks_in(false), | 70 m_init_flags(0), 71 m_allow_other(false), 72 m_default_permissions(false), 73 m_kernel_minor_version(FUSE_KERNEL_MINOR_VERSION), 74 m_pm(BLOCKING), 75 m_push_symlinks_in(false), |
71 m_ro(false) | 76 m_ro(false), 77 m_async(false) |
72 {} 73 74 virtual void SetUp(); 75 76 virtual void TearDown() { 77 if (m_mock) 78 delete m_mock; 79 } --- 127 unchanged lines hidden --- | 78 {} 79 80 virtual void SetUp(); 81 82 virtual void TearDown() { 83 if (m_mock) 84 delete m_mock; 85 } --- 127 unchanged lines hidden --- |