27#define TESTDIR "TestUfs_Store"
33class TestUfs :
public CPPUNIT_NS::TestFixture
70 static bool inited =
false;
110 if (0 > system (
"rm -rf " TESTDIR))
111 throw std::runtime_error(
"Failed to clean test work directory");
124 char *config_line=
xstrdup(
"100 1 1");
130 aStore->
parse(0, path);
178 pe->
unlock(
"TestUfs::testUfsSearch vary");
188 CPPUNIT_ASSERT_EQUAL(
false, search->
error());
189 CPPUNIT_ASSERT_EQUAL(
false, search->
isDone());
195 CPPUNIT_ASSERT_EQUAL(
true,
cbcalled);
199 CPPUNIT_ASSERT_EQUAL(
false, search->
error());
200 CPPUNIT_ASSERT_EQUAL(
false, search->
isDone());
206 CPPUNIT_ASSERT_EQUAL(
true,
cbcalled);
210 CPPUNIT_ASSERT_EQUAL(
false, search->
error());
211 CPPUNIT_ASSERT_EQUAL(
true, search->
isDone());
221 if (0 > system (
"rm -rf " TESTDIR))
222 throw std::runtime_error(
"Failed to clean test work directory");
232 if (0 > system (
"rm -rf " TESTDIR))
233 throw std::runtime_error(
"Failed to clean test work directory");
243 char *config_line=
xstrdup(
"100 1 1");
245 aStore->
parse(0, path);
248 CPPUNIT_ASSERT(aStore->
IO->
io !=
nullptr);
254 if (0 > system (
"rm -rf " TESTDIR))
255 throw std::runtime_error(
"Failed to clean test work directory");
void free_cachedir(Store::DiskConfig *swap)
void allocate_new_swapdir(Store::DiskConfig &swap)
int storeDirWriteCleanLogs(int reopen)
RemovalPolicy * mem_policy
RemovalPolicy * REMOVALPOLICYCREATE(wordlist *args)
RemovalPolicy * createRemovalPolicy(RemovalPolicySettings *settings)
static void SetCfgLine(char *line)
Set the configuration file line to parse.
static DiskIOModule * Find(char const *type)
void parse(int index, char *path) override
void create() override
create system resources needed for this store to operate in the future
Fs::Ufs::UFSStrategy * IO
void setHeaders(Http::StatusCode status, const char *reason, const char *ctype, int64_t clen, time_t lmt, time_t expires)
void packHeadersUsingSlowPacker(Packable &p) const
same as packHeadersUsingFastPacker() but assumes that p cannot quickly process small additions
const HttpReply & freshestReply() const
HttpReply & adjustableBaseReply()
SupportOrVeto cachable
whether the response may be stored in the cache
RemovalPolicySettings * replPolicy
Store::DiskConfig cacheSwap
char * store_dir_select_algorithm
struct SquidConfig::@88 Store
YesNoNone memShared
whether the memory cache is shared among workers
int unlock(const char *context)
sfileno swap_filen
unique ID inside a cache_dir for swapped out entries; -1 for others
bool setPublicKey(const KeyScope keyScope=ksDefault)
virtual bool error() const =0
virtual void next(void(callback)(void *cbdata), void *cbdata)=0
virtual StoreEntry * currentItem()=0
virtual bool isDone() const =0
static int store_dirs_rebuilding
the number of cache_dirs being rebuilt; TODO: move to Disks::Rebuilding
RefCount< SwapDir > * swapDirs
implements test program's main() function while enabling customization
int run(int argc, char *argv[])
CPPUNIT_TEST_SUITE(TestUfs)
void testUfsDefaultEngine()
CPPUNIT_TEST(testUfsDefaultEngine)
CPPUNIT_TEST(testUfsSearch)
void defaultTo(bool beSet)
enables or disables the option; updating to 'implicit' state
char const * visible_appname_string
Controller & Root()
safely access controller singleton
StoreEntry * storeCreateEntry(const char *url, const char *logUrl, const RequestFlags &flags, const HttpRequestMethod &method)
void storeReplAdd(const char *type, REMOVALPOLICYCREATE *create)
REMOVALPOLICYCREATE createRemovalPolicy_lru
RefCount< Fs::Ufs::UFSSwapDir > MySwapDirPointer
static void searchCallback(void *)
static void addSwapDir(MySwapDirPointer aStore)
CPPUNIT_TEST_SUITE_REGISTRATION(TestUfs)