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
227410b2
Commit
227410b2
authored
7 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[test] Follows file logs through archive and retrieve
parent
befadcef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
continuousintegration/test/simple_test
+45
-17
45 additions, 17 deletions
continuousintegration/test/simple_test
with
45 additions
and
17 deletions
continuousintegration/test/simple_test
+
45
−
17
View file @
227410b2
...
...
@@ -13,17 +13,17 @@ CTA_TAPED_LOG=/var/log/cta/cta-taped.log
# Colours
NC
=
'\033[0m'
# No Color
RED
=
'\033[0;31m'
L
IGH
T_RED
=
'\033[1;31m'
LT_RED
=
'\033[1;31m'
GREEN
=
'\033[0;32m'
L
IGH
T_GREEN
=
'\033[1;32m'
LT_GREEN
=
'\033[1;32m'
ORANGE
=
'\033[0;33m'
YELLOW
=
'\033[1;33m'
BLUE
=
'\033[0;34m'
L
IGH
T_BLUE
=
'\033[1;34m'
LT_BLUE
=
'\033[1;34m'
echo_start
()
{
echo
-ne
${
L
IGH
T_BLUE
}
$*
echo
-ne
${
LT_BLUE
}
$*
}
echo_end
()
...
...
@@ -31,9 +31,11 @@ echo_end()
echo
-e
$*
${
NC
}
}
echo
_blue
()
echo
c
()
{
echo
-e
${
LIGHT_BLUE
}
$*
${
NC
}
COLOUR
=
$1
shift
echo
-e
${
COLOUR
}
$*
${
NC
}
}
error
()
...
...
@@ -85,15 +87,28 @@ getArchiveID()
getTapeLog
()
{
FILEID
=
$1
shift
if
[
$#
-gt
2
]
then
LAST_MSG
=
$2
shift
fi
CURRENT_MSG
=
$2
for
i
in
{
1..15
}
do
LOGLINE
=
$(
grep
" fileId=
\"
${
FILEID
}
\"
"
$CTA_TAPED_LOG
|
grep
" LVL=
\"
Info
\"
"
)
echo
$LOGLINE
|
grep
"
$
*
"
>
/dev/null
echo
$LOGLINE
|
grep
"
$
{
CURRENT_MSG
}
"
>
/dev/null
[
$?
-ne
0
]
||
break
wait_dot
done
[
"
${
LOGLINE
}
"
!=
""
]
||
error
"Archive request fileID=
\"
${
1
}
\"
not found in
${
CTA_TAPED_LOG
}
"
# If this is the retrieve log, delete the archive log items
if
[
"
${
LAST_MSG
}
"
!=
""
]
then
LOGLINE
=
$(
echo
-e
"
${
LOGLINE
}
"
|
awk
-v
LAST_MSG
=
"
${
LAST_MSG
}
"
'BEGIN { is_retrieve = 0; }
is_retrieve { print $0; }
$0 ~ LAST_MSG { is_retrieve = 1; }'
)
fi
}
getFrontendLog
()
...
...
@@ -114,12 +129,13 @@ getFrontendLog()
FILENAME
=
file.
$$
# Copy small file into EOS
echoc
$LT_GREEN
"Copying file into EOS..."
eos
cp
/etc/motd
${
EOS_TEST_DIR
}
/
${
FILENAME
}
echo
_blue
"
\n
Disk file info:"
echo
c
$LT_BLUE
"
\n
Disk file info:"
eos fileinfo
${
EOS_TEST_DIR
}
/
${
FILENAME
}
getEOSDiskFileInfo
${
EOS_TEST_DIR
}
/
${
FILENAME
}
echo
_blue
"EOS Disk ID:
$EOS_DISK_ID
\n
Disk copies:
$DISK_COPIES
\n
Tape copies:
$TAPE_COPIES
\n
"
echo
c
$LT_BLUE
"EOS Disk ID:
$EOS_DISK_ID
\n
Disk copies:
$DISK_COPIES
\n
Tape copies:
$TAPE_COPIES
\n
"
echo_start
"
\n
Waiting for SYNC::CREATE event."
getEOSWFE SYNC::CREATE
${
EOS_TEST_DIR
}
/
${
FILENAME
}
...
...
@@ -139,11 +155,11 @@ echo_end "done"
echo
-e
"
$LOGLINE
\n
"
echo_start
"Waiting for file to be archived to tape."
getTapeLog
$ARCHIVE_FILE_ID
"
Reported to the client a full file archival
"
getTapeLog
$ARCHIVE_FILE_ID
'
Reported to the client a full file archival
'
echo_end
"done"
echo
-e
"
$LOGLINE
\n
"
echo
_blue
"List archived file on tape:"
echo
c
$LT_BLUE
"List archived file on tape:"
cta-admin af
ls
--instance
${
EOS_INSTANCE
}
--diskid
${
EOS_DISK_ID
}
--header
echo_start
"
\n
Waiting for ARCHIVED event."
...
...
@@ -152,16 +168,17 @@ echo_end "done"
echo
-e
"
$LOGLINE
\n
"
getEOSDiskFileInfo
${
EOS_TEST_DIR
}
/
${
FILENAME
}
echo
_blue
"Disk copies:
$DISK_COPIES
\n
Tape copies:
$TAPE_COPIES
\n
"
echo
c
$LT_BLUE
"Disk copies:
$DISK_COPIES
\n
Tape copies:
$TAPE_COPIES
\n
"
##
## Retrieval
##
echoc
$LT_GREEN
"Retrieving file from CTA..."
XrdSecPROTOCOL
=
sss
XrdSecSSSKT
=
/etc/cta/eos.sss.keytab |
\
sudo
xrdfs root://localhost/ prepare
-s
"
${
EOS_TEST_DIR
}
/
${
FILENAME
}
?eos.ruid=
${
EOS_RUID
}
"
echo_start
"
\n
Waiting for SYNC::PREPARE event."
echo_start
"Waiting for SYNC::PREPARE event."
getEOSWFE SYNC::PREPARE
${
EOS_TEST_DIR
}
/
${
FILENAME
}
echo_end
"done"
echo
-e
"
$LOGLINE
\n
"
...
...
@@ -172,10 +189,21 @@ echo_end "done"
echo
-e
"
$LOGLINE
\n
"
echo_start
"Waiting for file to be retrieved from tape."
getTapeLog
$ARCHIVE_FILE_ID
"
File successfully transfered to disk
"
getTapeLog
$ARCHIVE_FILE_ID
'Reported to the client a full file archival'
'
File successfully transfered to disk
'
echo_end
"done"
echo
-e
"
$LOGLINE
\n
"
getEOSDiskFileInfo
${
EOS_TEST_DIR
}
/
${
FILENAME
}
echo_blue
"Disk copies:
$DISK_COPIES
\n
Tape copies:
$TAPE_COPIES
\n
"
echoc
$LT_BLUE
"Disk copies:
$DISK_COPIES
\n
Tape copies:
$TAPE_COPIES
\n
"
echoc
$LT_GREEN
"Copying file out of EOS..."
eos
cp
${
EOS_TEST_DIR
}
/
${
FILENAME
}
/tmp/
${
FILENAME
}
ls
-l
/tmp/
${
FILENAME
}
diff /tmp/
${
FILENAME
}
/etc/motd
if
[
$?
-eq
0
]
then
echoc
$LT_GREEN
"Files match, OK."
else
error
"Files differ."
fi
rm
-f
/tmp/
${
FILENAME
}
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