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
aad08ba8
Commit
aad08ba8
authored
10 years ago
by
Daniele Kruse
Browse files
Options
Downloads
Patches
Plain Diff
Fixed small bug with xattr plus created stub VFS test
parent
80965724
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libs/middletier/CMakeLists.txt
+2
-1
2 additions, 1 deletion
libs/middletier/CMakeLists.txt
libs/middletier/Vfs.cpp
+5
-5
5 additions, 5 deletions
libs/middletier/Vfs.cpp
libs/middletier/VfsTest.cpp
+24
-0
24 additions, 0 deletions
libs/middletier/VfsTest.cpp
with
31 additions
and
6 deletions
libs/middletier/CMakeLists.txt
+
2
−
1
View file @
aad08ba8
...
...
@@ -62,7 +62,8 @@ set (MIDDLE_TIER_UNIT_TESTS_LIB_SRC_FILES
MockTapePoolTableTest.cpp
SqliteMiddleTierAdminTest.cpp
SqliteMiddleTierUserTest.cpp
UtilsTest.cpp
)
UtilsTest.cpp
VfsTest.cpp
)
add_library
(
ctamiddletierunittests SHARED
${
MIDDLE_TIER_UNIT_TESTS_LIB_SRC_FILES
}
)
...
...
This diff is collapsed.
Click to expand it.
libs/middletier/Vfs.cpp
+
5
−
5
View file @
aad08ba8
...
...
@@ -68,7 +68,7 @@ cta::Vfs::Vfs() {
throw
(
Exception
(
message
.
str
()));
}
rc
=
setxattr
(
m_fsDir
.
c_str
(),
"CTAStorageClass"
,
(
void
*
)
""
,
0
,
XATTR_REPLACE
);
rc
=
setxattr
(
m_fsDir
.
c_str
(),
"
user.
CTAStorageClass"
,
(
void
*
)
""
,
0
,
0
);
if
(
rc
!=
0
)
{
char
buf
[
256
];
std
::
ostringstream
message
;
...
...
@@ -91,7 +91,7 @@ void cta::Vfs::setDirectoryStorageClass(const SecurityIdentity &requester, const
cta
::
Utils
::
checkAbsolutePathSyntax
(
path
);
checkDirectoryExists
(
m_fsDir
+
path
);
int
rc
=
setxattr
((
m_fsDir
+
path
).
c_str
(),
"CTAStorageClass"
,
(
void
*
)(
storageClassName
.
c_str
()),
storageClassName
.
length
(),
XATTR_REPLACE
);
int
rc
=
setxattr
((
m_fsDir
+
path
).
c_str
(),
"
user.
CTAStorageClass"
,
(
void
*
)(
storageClassName
.
c_str
()),
storageClassName
.
length
(),
0
);
if
(
rc
!=
0
)
{
char
buf
[
256
];
std
::
ostringstream
message
;
...
...
@@ -107,7 +107,7 @@ void cta::Vfs::clearDirectoryStorageClass(const SecurityIdentity &requester, con
cta
::
Utils
::
checkAbsolutePathSyntax
(
path
);
checkDirectoryExists
(
m_fsDir
+
path
);
int
rc
=
removexattr
((
m_fsDir
+
path
).
c_str
(),
"CTAStorageClass"
);
int
rc
=
removexattr
((
m_fsDir
+
path
).
c_str
(),
"
user.
CTAStorageClass"
);
if
(
rc
!=
0
)
{
char
buf
[
256
];
std
::
ostringstream
message
;
...
...
@@ -124,11 +124,11 @@ std::string cta::Vfs::getDirectoryStorageClass(const SecurityIdentity &requester
checkDirectoryExists
(
m_fsDir
+
path
);
char
value
[
1024
];
int
rc
=
getxattr
((
m_fsDir
+
path
).
c_str
(),
"CTAStorageClass"
,
(
void
*
)
value
,
1024
);
int
rc
=
getxattr
((
m_fsDir
+
path
).
c_str
(),
"
user.
CTAStorageClass"
,
(
void
*
)
value
,
1024
);
if
(
rc
!=
0
)
{
char
buf
[
256
];
std
::
ostringstream
message
;
message
<<
"setDirectoryStorageClass() - "
<<
m_fsDir
+
path
<<
"
s
etxattr error. Reason: "
<<
strerror_r
(
errno
,
buf
,
256
);
message
<<
"setDirectoryStorageClass() - "
<<
m_fsDir
+
path
<<
"
g
etxattr error. Reason: "
<<
strerror_r
(
errno
,
buf
,
256
);
throw
(
Exception
(
message
.
str
()));
}
return
std
::
string
(
value
);
...
...
This diff is collapsed.
Click to expand it.
libs/middletier/VfsTest.cpp
0 → 100644
+
24
−
0
View file @
aad08ba8
#include
"Vfs.hpp"
#include
<gtest/gtest.h>
namespace
unitTests
{
class
cta_VfsTest
:
public
::
testing
::
Test
{
protected:
virtual
void
SetUp
()
{
}
virtual
void
TearDown
()
{
}
};
TEST_F
(
cta_VfsTest
,
trimSlashes_emptyString
)
{
using
namespace
cta
;
Vfs
vfs
;
const
std
::
string
s
;
}
}
\ No newline at end of file
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