small cleanups to storage test
This commit is contained in:
parent
a9f6220240
commit
2a1f038ba1
1 changed files with 2 additions and 14 deletions
16
t/Storage.t
16
t/Storage.t
|
|
@ -91,10 +91,8 @@ is($guidStorage->getDirectoryId, $newGuid, '... getDirectoryId');
|
||||||
#
|
#
|
||||||
####################################################
|
####################################################
|
||||||
|
|
||||||
my $savecdn = $session->config->get('cdn');
|
WebGUI::Test->originalConfig('cdn');
|
||||||
if ($savecdn) {
|
$session->config->delete('cdn');
|
||||||
$session->config->delete('cdn');
|
|
||||||
}
|
|
||||||
# Note: the CDN configuration will be reverted after CDN tests below
|
# Note: the CDN configuration will be reverted after CDN tests below
|
||||||
|
|
||||||
my $storageDir1 = join '/', $uploadDir, '7e', '8a', '7e8a1b6a';
|
my $storageDir1 = join '/', $uploadDir, '7e', '8a', '7e8a1b6a';
|
||||||
|
|
@ -530,10 +528,7 @@ my $cdnCfg = {
|
||||||
"syncProgram" => "cp -r -- '%s' $cdnTestPath/",
|
"syncProgram" => "cp -r -- '%s' $cdnTestPath/",
|
||||||
"deleteProgram" => "rm -r -- '$cdnTestPath/%s' > /dev/null 2>&1"
|
"deleteProgram" => "rm -r -- '$cdnTestPath/%s' > /dev/null 2>&1"
|
||||||
};
|
};
|
||||||
my ($addedCdnQ, $addedCdnU);
|
|
||||||
$addedCdnQ = mkdir $cdnCfg->{'queuePath'} unless -e $cdnCfg->{'queuePath'};
|
|
||||||
my $dest = substr($cdnCfg->{'url'}, 7);
|
my $dest = substr($cdnCfg->{'url'}, 7);
|
||||||
$addedCdnU = mkdir $dest unless -e $dest;
|
|
||||||
$session->config->set('cdn', $cdnCfg);
|
$session->config->set('cdn', $cdnCfg);
|
||||||
my $cdnUrl = $cdnCfg->{'url'};
|
my $cdnUrl = $cdnCfg->{'url'};
|
||||||
my $cdnUlen = length $cdnUrl;
|
my $cdnUlen = length $cdnUrl;
|
||||||
|
|
@ -715,11 +710,4 @@ END {
|
||||||
) {
|
) {
|
||||||
ref $stor eq "WebGUI::Storage" and $stor->delete;
|
ref $stor eq "WebGUI::Storage" and $stor->delete;
|
||||||
}
|
}
|
||||||
if ($savecdn) {
|
|
||||||
$session->config->set('cdn', $savecdn);
|
|
||||||
} else {
|
|
||||||
$session->config->delete('cdn');
|
|
||||||
}
|
|
||||||
$addedCdnQ and rmdir $addedCdnQ;
|
|
||||||
$addedCdnU and rmdir $addedCdnU;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue