Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
c8da2d76
Commit
c8da2d76
authored
Jul 24, 2019
by
Michael Davis
Browse files
[migration] Adds packaging for migration test scripts
parent
1e7794eb
Changes
4
Hide whitespace changes
Inline
Side-by-side
cta.spec.in
View file @
c8da2d76
...
...
@@ -307,6 +307,8 @@ directory metadata into the EOS namespace.
%files -n cta-migration-tools
%attr(0755,root,root) %{_bindir}/eos-import-dirs
%attr(0755,root,root) %{_bindir}/eos-import-files
%attr(0755,root,root) %{_bindir}/eos-test-dir-inject
%attr(0755,root,root) %{_bindir}/eos-test-inject.sh
%package -n cta-rmcd
Summary: The Remote Media Changer daemon (rmcd)
...
...
migration/gRPC/CMakeLists.txt
View file @
c8da2d76
...
...
@@ -16,6 +16,8 @@
cmake_minimum_required
(
VERSION 2.6
)
find_package
(
Protobuf3 REQUIRED
)
include_directories
(
${
XRD_SSI_PB_DIR
}
/include
${
XROOTD_INCLUDE_DIR
}
${
XROOTD_INCLUDE_DIR
}
/private
${
CMAKE_BINARY_DIR
}
/eos_cta
${
PROTOBUF3_INCLUDE_DIRS
}
)
...
...
@@ -37,3 +39,5 @@ set_property(TARGET eos-test-dir-inject APPEND PROPERTY INSTALL_RPATH ${PROTOBUF
install
(
TARGETS eos-import-dirs DESTINATION usr/bin
)
install
(
TARGETS eos-import-files DESTINATION usr/bin
)
install
(
TARGETS eos-test-dir-inject DESTINATION usr/bin
)
install
(
FILES
${
CMAKE_SOURCE_DIR
}
/migration/gRPC/eos-test-inject.sh DESTINATION usr/bin
)
migration/gRPC/eos-test-inject.sh
0 → 100755
View file @
c8da2d76
#!/bin/sh
# Colours
NC
=
'\033[0m'
# No colour
RED
=
'\033[0;31m'
LT_RED
=
'\033[1;31m'
GREEN
=
'\033[0;32m'
LT_GREEN
=
'\033[1;32m'
ORANGE
=
'\033[0;33m'
YELLOW
=
'\033[1;33m'
BLUE
=
'\033[0;34m'
LT_BLUE
=
'\033[1;34m'
error
()
{
echo
-e
"
${
RED
}
$*
${
NC
}
"
>
&2
exit
1
}
echoc
()
{
COLOUR
=
$1
shift
echo
-e
"
${
COLOUR
}
$*
${
NC
}
"
}
TEST_PATH
=
$(
which eos-test-dir-inject
)
[
-x
${
TEST_PATH
}
]
||
error
"Can't find executable eos-test-dir-inject"
eos
mkdir
-p
/eos/grpc
# Create directory with system-assigned file id -- should succeed
echoc
$LT_BLUE
"Creating directory with auto-assigned file id"
eos-test-dir-inject
--path
/castor/cern.ch/my_test_dir | json-pretty-print.sh
eos
ls
-l
/eos/grpc
eos fileinfo /eos/grpc/my_test_dir
eos
rmdir
/eos/grpc/my_test_dir
# Create directory with self-assigned file id -- should succeed
echoc
$LT_BLUE
"Creating directory with self-assigned file id"
eos-test-dir-inject
--fileid
9876543210
--path
/castor/cern.ch/my_test_dir | json-pretty-print.sh
eos fileinfo /eos/grpc/my_test_dir
# Try again -- should fail
echoc
$LT_GREEN
"Creating directory with the same file id (should fail)"
eos-test-dir-inject
--fileid
9876543210
--path
/castor/cern.ch/my_test_dir2
>
/dev/null
# Remove and try again -- should succeed after restarting EOS
echoc
$LT_GREEN
"Remove the directory and restart EOS to remove the tombstone"
eos
rmdir
/eos/grpc/my_test_dir
sudo
systemctl restart eos@
*
sleep
3
echoc
$LT_BLUE
"Recreate the directory with self-assigned file id (should succeed this time)"
eos-test-dir-inject
--fileid
9876543210
--path
/castor/cern.ch/my_test_dir
>
/dev/null
eos fileinfo /eos/grpc/my_test_dir
# Restart EOS once more to remove the tombstone
echoc
$LT_GREEN
"Cleaning up: remove the directory and restart EOS to remove the tombstone"
eos
rmdir
/eos/grpc/my_test_dir
sudo
systemctl restart eos@
*
sleep
3
migration/gRPC/test-inject.sh
deleted
100755 → 0
View file @
1e7794eb
#!/bin/sh
TEST_HOME
=
~/CTA_build/migration/gRPC
INJECT
=
${
TEST_HOME
}
/eos-test-dir-inject
# Create directory with system-assigned file id
${
INJECT
}
--path
/castor/cern.ch/my_test_dir | json-pretty-print.sh
eos
ls
-l
/eos/grpc
eos fileinfo /eos/grpc/my_test_dir
eos
rmdir
/eos/grpc/my_test_dir
# Create directory with self-assigned file id
${
INJECT
}
--fileid
9876543210
--path
/castor/cern.ch/my_test_dir | json-pretty-print.sh
eos fileinfo /eos/grpc/my_test_dir
# Try again -- should fail
${
INJECT
}
--fileid
9876543210
--path
/castor/cern.ch/my_test_dir
>
/dev/null
eos fileinfo /eos/grpc/my_test_dir
# Remove and try again
eos
rmdir
/eos/grpc/my_test_dir
sudo
systemctl restart eos@
*
sleep
3
${
INJECT
}
--fileid
9876543210
--path
/castor/cern.ch/my_test_dir
>
/dev/null
eos fileinfo /eos/grpc/my_test_dir
eos
rmdir
/eos/grpc/my_test_dir
eos
ls
/eos/grpc
sudo
systemctl restart eos@
*
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment