Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
0ec4c58e
Commit
0ec4c58e
authored
12 years ago
by
Sebastien Ponce
Browse files
Options
Downloads
Patches
Plain Diff
Optimized test suite by recreating directories only once, and not everytime we use a file
parent
f34049b1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/testsuite/castortests/resources/castor/tags.py
+4
-5
4 additions, 5 deletions
test/testsuite/castortests/resources/castor/tags.py
test/testsuite/castortests/resources/ns/tags.py
+7
-4
7 additions, 4 deletions
test/testsuite/castortests/resources/ns/tags.py
with
11 additions
and
9 deletions
test/testsuite/castortests/resources/castor/tags.py
+
4
−
5
View file @
0ec4c58e
...
...
@@ -25,7 +25,6 @@ def _setFileClass(self, path, fileclass):
assert
len
(
output
)
==
0
,
\
'
Failed to set FileClass
'
+
fileclass
+
\
'
on directory
'
+
path
+
os
.
linesep
+
"
Error :
"
+
os
.
linesep
+
output
return
path
Setup
.
_setFileClass
=
_setFileClass
def
_addACLforUnprivUser
(
self
,
path
):
...
...
@@ -41,14 +40,14 @@ def _addACLforUnprivUser(self, path):
assert
len
(
output
)
==
0
,
\
'
Failed to set ACLs for user
'
+
self
.
options
.
get
(
'
Tags
'
,
'
unprivUid
'
)
+
\
'
on working directory
'
+
path
+
os
.
linesep
+
"
Error :
"
+
os
.
linesep
+
output
return
path
Setup
.
_addACLforUnprivUser
=
_addACLforUnprivUser
def
_configuredPath
(
self
,
test
,
fileclass
):
# create the directory and configure it
path
=
self
.
_createDir
(
self
.
getTag
(
test
,
'
_testSessionPath
'
)
+
os
.
sep
+
test
)
path
=
self
.
_setFileClass
(
path
,
fileclass
)
path
=
self
.
_addACLforUnprivUser
(
path
)
path
,
created
=
self
.
_createDir
(
self
.
getTag
(
test
,
'
_testSessionPath
'
)
+
os
.
sep
+
test
)
if
created
:
self
.
_setFileClass
(
path
,
fileclass
)
self
.
_addACLforUnprivUser
(
path
)
return
path
Setup
.
_configuredPath
=
_configuredPath
...
...
This diff is collapsed.
Click to expand it.
test/testsuite/castortests/resources/ns/tags.py
+
7
−
4
View file @
0ec4c58e
...
...
@@ -24,17 +24,20 @@ def _createDir(self, path):
# create the path in the namespace
output
=
Popen
(
'
nsmkdir
'
+
path
)
# check it went fine
assert
len
(
output
)
==
0
or
output
.
find
(
'
File exists
'
),
\
assert
len
(
output
)
==
0
or
output
.
find
(
'
File exists
'
)
>=
0
,
\
'
Failed to create working directory
'
+
path
+
os
.
linesep
+
"
Error :
"
+
os
.
linesep
+
output
# return the created dir
return
path
if
output
.
find
(
'
File exists
'
)
>=
0
:
return
(
path
,
False
)
else
:
return
(
path
,
True
)
Setup
.
_createDir
=
_createDir
def
_testSessionPath
(
self
):
# get the test path
testpath
=
self
.
options
.
get
(
'
Generic
'
,
'
CastorTestDir
'
)
# create a unique directory
return
self
.
_createDir
(
testpath
+
os
.
sep
+
self
.
getTag
(
None
,
'
sessionuuid
'
))
return
self
.
_createDir
(
testpath
+
os
.
sep
+
self
.
getTag
(
None
,
'
sessionuuid
'
))
[
0
]
Setup
.
getTag__testSessionPath
=
_testSessionPath
def
nsDir
(
self
):
...
...
@@ -42,7 +45,7 @@ def nsDir(self):
Setup
.
getTag_nsDir
=
nsDir
def
nsFile
(
self
,
nb
=
0
):
return
(
lambda
test
:
self
.
_createDir
(
self
.
getTag
(
test
,
'
nsDir
'
))
+
\
return
(
lambda
test
:
self
.
_createDir
(
self
.
getTag
(
test
,
'
nsDir
'
))
[
0
]
+
\
os
.
sep
+
test
+
str
(
nb
))
Setup
.
getTag_nsFile
=
nsFile
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment